示例#1
0
s32 disp_hdmi_enable(struct disp_hdmi* hdmi)
{
	s32 index, ret;
	struct disp_hdmi_private_data *hdmip = disp_hdmi_get_priv(hdmi);
	if((NULL == hdmi) || (NULL == hdmip)) {
		DE_WRN("hdmi set func null  hdl!\n");
		return DIS_FAIL;
	}

	if(hdmip->hdmi_func.hdmi_get_video_timing_info == NULL) {
		DE_WRN("hdmi_get_video_timing_info func is null\n");
		return DIS_FAIL;
	}

	hdmip->hdmi_func.hdmi_get_video_timing_info(&(hdmip->video_info));

	if(hdmip->video_info == NULL) {
		DE_WRN("video info is null\n");
		return DIS_FAIL;
	}

	if(hdmip->hdmi_func.hdmi_get_video_info_index == NULL) {
		DE_WRN("hdmi_get_video_info_index func is null\n");
		return DIS_FAIL;
	}

	index = hdmip->hdmi_func.hdmi_get_video_info_index(hdmip->mode);

	if(index < 0) {
		DE_WRN("hdmi get video info index fail\n");
		return DIS_FAIL;
	}

	hdmip->video_info = hdmip->video_info + index;

	hdmi_clk_enable(hdmi);
	disp_al_hdmi_init(hdmi->channel_id, hdmip->support_4k);
	disp_al_hdmi_cfg(hdmi->channel_id, hdmip->video_info);
	disp_al_hdmi_enable(hdmi->channel_id);

	if(hdmip->hdmi_func.hdmi_open == NULL)
	    return -1;

	ret = hdmip->hdmi_func.hdmi_open();

#if defined(__LINUX_PLAT__)
	{
	unsigned long flags;
	spin_lock_irqsave(&hdmi_data_lock, flags);
#endif
	hdmip->enabled = 1;
#if defined(__LINUX_PLAT__)
	    spin_unlock_irqrestore(&hdmi_data_lock, flags);
	}
#endif

	return ret;
}
示例#2
0
s32 disp_hdmi_enable(struct disp_device* hdmi)
{
	unsigned long flags;
	struct disp_device_private_data *hdmip = disp_hdmi_get_priv(hdmi);
	struct disp_manager *mgr = NULL;
	if((NULL == hdmi) || (NULL == hdmip)) {
		DE_WRN("hdmi set func null  hdl!\n");
		return DIS_FAIL;
	}
	mgr = hdmi->manager;
	if(!mgr) {
		DE_WRN("hdmi%d's mgr is NULL\n", hdmi->disp);
		return DIS_FAIL;
	}

	if(hdmip->hdmi_func.hdmi_get_video_timing_info == NULL) {
		DE_WRN("hdmi_get_video_timing_info func is null\n");
		return DIS_FAIL;
	}

	hdmip->hdmi_func.hdmi_get_video_timing_info(&(hdmip->video_info));

	if(hdmip->video_info == NULL) {
		DE_WRN("video info is null\n");
		return DIS_FAIL;
	}
	memcpy(&hdmi->timings, hdmip->video_info, sizeof(disp_video_timings));
	if(mgr->enable)
		mgr->enable(mgr);

	disp_sys_register_irq(hdmip->irq_no,0,disp_hdmi_event_proc,(void*)hdmi->disp,0,0);
	disp_sys_enable_irq(hdmip->irq_no);

	hdmi_clk_enable(hdmi);
	disp_al_hdmi_cfg(hdmi->disp, hdmip->video_info);
	disp_al_hdmi_enable(hdmi->disp);

	if(NULL != hdmip->hdmi_func.hdmi_open)
		hdmip->hdmi_func.hdmi_open();
	else
		DE_WRN("hdmi_open is NULL\n");

	disp_sys_irqlock((void*)&hdmi_data_lock, &flags);
	hdmip->enabled = 1;
	disp_sys_irqunlock((void*)&hdmi_data_lock, &flags);

	return 0;
}
示例#3
0
int target_hdmi_panel_clock(uint8_t enable, struct msm_panel_info *pinfo)
{
	uint32_t ret;

	dprintf(SPEW, "%s: target_panel_clock\n", __func__);

	if (enable) {
		mdp_gdsc_ctrl(enable);
		mmss_bus_clock_enable();
		mdp_clock_enable();
		ret = restore_secure_cfg(SECURE_DEVICE_MDSS);
		if (ret) {
			dprintf(CRITICAL,
				"%s: Failed to restore MDP security configs",
				__func__);
			mdp_clock_disable();
			mmss_bus_clock_disable();
			mdp_gdsc_ctrl(0);
			return ret;
		}

		hdmi_phy_reset();
		hdmi_pll_config();
		hdmi_vco_enable();
		hdmi_clk_enable();
	} else if(!target_cont_splash_screen()) {
		/* Disable clocks if continuous splash off */
		hdmi_clk_disable();
		hdmi_vco_disable();
		mdp_clock_disable();
		mmss_bus_clock_disable();
		mdp_gdsc_ctrl(enable);
	}

	return NO_ERROR;
}