总目录:高通821平台LCD调试
可以看到mdss_dsi_ctrl_probe这个接口实际上时初始化的最终执行者,继续分析这个接口内部的实现流程,主要是上电使能和屏初始化。
一、上电使能
1. probe函数中会调用Panel的注册函数:dsi_panel_device_register
rc = dsi_panel_device_register(pdev, dsi_pan_node, ctrl_pdata);
然后在注册函数中会填充事件处理函数的处理接口:mdss_dsi_event_handler
ctrl_pdata->panel_data.event_handler = mdss_dsi_event_handler;
然后在LINK_READY时,调用mdss_dsi_on
case MDSS_EVENT_LINK_READY:
if (ctrl_pdata->refresh_clk_rate)
rc = mdss_dsi_clk_refresh(pdata,
ctrl_pdata->update_phy_timing);
rc = mdss_dsi_on(pdata);
pr_info("SOLEN MDSS_EVENT_LINK_READY\n");
mdss_dsi_op_mode_config(pdata->panel_info.mipi.mode,
pdata);
break;
然后mdss_dsi_on调用power_ctrl
ret = mdss_dsi_panel_power_ctrl(pdata, MDSS_PANEL_POWER_ON);
继续追踪,上电时会调用mdss_dsi_panel_power_on
case MDSS_PANEL_POWER_ON:
if (mdss_dsi_is_panel_on_lp(pdata))
ret = mdss_dsi_panel_power_lp(pdata, false);
else
ret = mdss_dsi_panel_power_on(pdata);
break;
最终实现如下:
static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
{
int ret = 0;
int i = 0;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
if (pdata == NULL) {
pr_err("%s: Invalid input data\n", __func__);
return -EINVAL;
}
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
#if ((defined DISPLAY_TIANMA_2K_VIDEO_PANEL) || (defined DISPLAY_BOE_4K_DSC_CMD_PANEL) || (defined DISPLAY_TIANMA_2K90_DSC_VIDEO_PANEL))/*modified by PICO_driver webber.wang for bug 14410 - BOE 4K lcd debug*/
/*modified by webber.wang to fix Bug 14244:lcd will go out when going to kernel --start--*/
if(0 == boot_on){
boot_on++;
ret = msm_dss_enable_vreg(
ctrl_pdata->panel_power_data.vreg_config,
ctrl_pdata->panel_power_data.num_vreg, 1);
for(i=0;i < ctrl_pdata->panel_power_data.num_vreg;i++)
{
pr_info("SOLEN in %s line292,num_vreg = %d,vreg=%s\n",__func__,i,ctrl_pdata->panel_power_data.vreg_config[i].vreg_name);
}
if (ret) {
pr_err("%s: failed to enable vregs for %s\n",
__func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
return ret;
}
}
/*added by PICO_driver jim.qiu for bug13856:debug tianma lcd,fix flicker of LCD when resume system --end--*/
else{
/*added by PICO_driver jim.qiu for bug13856:debug tianma lcd,fix flicker of LCD when resume system --start--*/
ret = msm_dss_enable_vreg(
ctrl_pdata->panel_power_data.vreg_config,
ctrl_pdata->panel_power_data.num_vreg-1, 1);
if (ret) {
pr_err("%s: failed to enable vregs for %s\n",
__func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
return ret;
}
}
/*modified by webber.wang to fix Bug 14244:lcd will go out when going to kernel --end--*/
#else
ret = msm_dss_enable_vreg(
ctrl_pdata->panel_power_data.vreg_config,
ctrl_pdata->panel_power_data.num_vreg, 1);
if (ret) {
pr_err("%s: failed to enable vregs for %s\n",
__func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
return ret;
}
#endif
/*
* If continuous splash screen feature is enabled, then we need to
* request all the GPIOs that have already been configured in the
* bootloader. This needs to be done irresepective of whether
* the lp11_init flag is set or not.
*/
if (pdata->panel_info.cont_splash_enabled ||
!pdata->panel_info.mipi.lp11_init) {
if (mdss_dsi_pinctrl_set_state(ctrl_pdata, true))
pr_debug("reset enable: pinctrl not enabled\n");
ret = mdss_dsi_panel_reset(pdata, 1);
if (ret)
pr_err("%s: Panel reset failed. rc=%d\n",
__func__, ret);
}
return ret;
}
打印的LOg为
[ 1.574276] SOLEN in mdss_dsi_panel_power_on line292,num_vreg = 0,vreg=vddio
[ 1.574281] SOLEN in mdss_dsi_panel_power_on line292,num_vreg = 1,vreg=lab
[ 1.574285] SOLEN in mdss_dsi_panel_power_on line292,num_vreg = 2,vreg=ibb
[ 1.574288] SOLEN in mdss_dsi_panel_power_on line292,num_vreg = 3,vreg=oled-vdda
这显然都是在设备树中dsi_panel_pwr_supply中定义的电源。
即依次给这四路电源上电
二、Panel初始化
首先看一下event时间的状态切换:
1. 开始亮屏时:
扫描二维码关注公众号,回复:
2424773 查看本文章
[ 1.606577] SOLEN MDSS_EVENT_FB_REGISTERED
[ 1.606694] SOLEN MDSS_EVENT_FB_REGISTERED
[ 1.606971] SOLEN MDSS_EVENT_REGISTER_RECOVERY_HANDLER
[ 1.606976] SOLEN MDSS_EVENT_REGISTER_RECOVERY_HANDLER
[ 1.607021] SOLEN MDSS_EVENT_REGISTER_RECOVERY_HANDLER
[ 18.672811] SOLEN MDSS_EVENT_LINK_READY
[ 18.672837] SOLEN MDSS_EVENT_LINK_READY
[ 18.672882] SOLEN MDSS_EVENT_UNBLANK
[ 18.672900] SOLEN MDSS_EVENT_UNBLANK
[ 18.676632] SOLEN MDSS_EVENT_PANEL_ON
[ 18.676641] SOLEN MDSS_EVENT_PANEL_ON
[ 18.676653] SOLEN MDSS_EVENT_POST_PANEL_ON
[ 18.676665] SOLEN MDSS_EVENT_POST_PANEL_ON
2. 休眠灭屏时
[ 110.840325] SOLEN MDSS_EVENT_BLANK
[ 111.026104] SOLEN MDSS_EVENT_BLANK
[ 111.067714] SOLEN MDSS_EVENT_PANEL_OFF
[ 111.094403] SOLEN MDSS_EVENT_PANEL_OFF
主要看一下PANEL_ON和POST_PANEL_ON的流程:
待补充