Beispiel #1
0
void mipi_dsi_clk_enable(void)
{
	u32 pll_ctrl = MIPI_INP(MIPI_DSI_BASE + 0x0200);
	if (mipi_dsi_clk_on) {
		pr_info("%s: mipi_dsi_clks already ON\n", __func__);
		return;
	}
	MIPI_OUTP(MIPI_DSI_BASE + 0x0200, pll_ctrl | 0x01);
	mipi_dsi_phy_rdy_poll();

	if (clk_set_rate(dsi_byte_div_clk, 1) < 0)	/* divided by 1 */
		pr_err("%s: dsi_byte_div_clk - "
			"clk_set_rate failed\n", __func__);
	if (clk_set_rate(dsi_esc_clk, esc_byte_ratio) < 0) /* divided by esc */
		pr_err("%s: dsi_esc_clk - "			 /* clk ratio */
			"clk_set_rate failed\n", __func__);
	mipi_dsi_pclk_ctrl(&dsi_pclk, 1);
	mipi_dsi_clk_ctrl(&dsicore_clk, 1);
	clk_enable(dsi_byte_div_clk);
	clk_enable(dsi_esc_clk);
	mipi_dsi_clk_on = 1;
	mdp4_stat.dsi_clk_on++;
#ifdef CONFIG_SHLCDC_BOARD /* CUST_ID_00097 */
	SHLCDC_EVENTLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_DSI_CLK_ENABLE,0);
#endif /* CONFIG_SHLCDC_BOARD */
}
Beispiel #2
0
void mipi_dsi_clk_disable(void)
{
	if (mipi_dsi_clk_on == 0) {
		pr_info("%s: mipi_dsi_clks already OFF\n", __func__);
		return;
	}
	clk_disable(dsi_esc_clk);
	clk_disable(dsi_byte_div_clk);
	mipi_dsi_pclk_ctrl(&dsi_pclk, 0);
	mipi_dsi_clk_ctrl(&dsicore_clk, 0);
	/* DSIPHY_PLL_CTRL_0, disable dsi pll */
	MIPI_OUTP(MIPI_DSI_BASE + 0x0200, 0x0);
	mipi_dsi_clk_on = 0;
	mdp4_stat.dsi_clk_off++;
#ifdef CONFIG_SHLCDC_BOARD /* CUST_ID_00097 */
	SHLCDC_EVENTLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_DSI_CLK_DISABLE,0);
#endif /* CONFIG_SHLCDC_BOARD */
}
Beispiel #3
0
void msm_lcd_recovery(void)
{
	struct msm_fb_data_type *mfd;
	struct fb_info *info = NULL;
	int ret;
	int i;
	int vsync_status;

	suspended_recovery_flg = 0;

	if (!num_registered_fb){
		mipi_sharp_lcd_init_det_info();
		return;
	}
	info = registered_fb[0];
	if (!info){
		mipi_sharp_lcd_init_det_info();
		return;
	}

	
	lock_recovery();
    if(mipi_dsi_get_err_contention_lp1_flag() == 3) {
        SHLCDC_ERRLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_RECOVERY_ERR,0);
        MSM_FB_WARNING("msm_lcd_recovery already retry over. return\n");
    	unlock_recovery();
        return;
    }

    mfd = (struct msm_fb_data_type *)info->par;

    if(!mfd->panel_power_on) {
        SHLCDC_ERRLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_RECOVERY_ERR,1);
        MSM_FB_WARNING("msm_lcd_recovery already suspend. return\n");
        suspended_recovery_flg = 1;
        unlock_recovery();
        return;
    }

	mipi_sharp_stat_inc(SHDISP_STAT_INC_RECOVERY);

	mdp_clk_ctrl(1);

	vsync_status = mdp4_overlay_vsync_get_status();

	if(vsync_status){
		ret = mdp4_overlay_vsync_ctrl(info, 0);
	}

	SHLCDC_EVENTLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_RECOVERY,0);

	MSM_FB_WARNING("msm_lcd_recovery start\n");

	lcd_recovering = LCD_RECOVERY_ACTIVE;

	for (i=0; i<LCD_RECOVERY_LOOP_MAX; i++) {

		
		msm_fb_suspend_sub_recovery(mfd);
		
		
		mipi_sharp_delay_us(40000);
	
		
		shdisp_api_do_recovery();

		
		msm_fb_resume_sub_recovery(mfd);

		msm_fb_resume_sub_recovery_phase2(info);
		ret = shdisp_api_check_recovery();

		
		if (ret == SHDISP_RESULT_SUCCESS) {
			
			lcd_recovering = LCD_RECOVERY_STOP;
			
			mipi_sharp_lcd_init_det_info();

			SHLCDC_EVENTLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_RECOVERY,1);

			MSM_FB_WARNING("msm_lcd_recovery completed\n");

			if(vsync_status){
				ret = mdp4_overlay_vsync_ctrl(info, 1);
			}

			mdp_clk_ctrl(0);
			
			unlock_recovery();
			return;
		}
	}

	
	
	

	lcd_recovering = LCD_RECOVERY_STOP;

    if(shdisp_api_get_mipi_dsi_det_recovery_flag()) {
        mipi_dsi_clr_err_int_mask0_b25();
    }

	SHLCDC_ERRLOG_REC(FB,LCD,MSM_FB_KERL,EEVENTID_FB_RECOVERY_OVER,0);

	MSM_FB_ERR("msm_lcd_recovery retry over\n");

	
	unlock_recovery();

}