diff options
| author | Kuogee Hsieh <khsieh@codeaurora.org> | 2013-10-23 15:49:52 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:23:08 -0700 |
| commit | 4410dae327055a1aa7162e753ca01a0e52166951 (patch) | |
| tree | 828d37ea680b55e56315a992f25fbc652285ce26 | |
| parent | fc3e1adbaa8007fed24a72406ae41c10ed7be997 (diff) | |
msm: mdss: do not shut down edp link during link training
Use locks to prevent shutting down edp link at panel off if link
training is ongoing, since EDP Link training requires that link
is in running state.
Change-Id: I79715675f0a919815dfc60689215f4771400b28a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_edp.c | 5 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_edp.h | 1 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_edp_aux.c | 11 |
3 files changed, 14 insertions, 3 deletions
diff --git a/drivers/video/fbdev/msm/mdss_edp.c b/drivers/video/fbdev/msm/mdss_edp.c index 85400342d27f..19bc1b144321 100644 --- a/drivers/video/fbdev/msm/mdss_edp.c +++ b/drivers/video/fbdev/msm/mdss_edp.c @@ -591,6 +591,8 @@ int mdss_edp_off(struct mdss_panel_data *pdata) } pr_debug("%s:+, cont_splash=%d\n", __func__, edp_drv->cont_splash); + /* wait until link training is completed */ + mutex_lock(&edp_drv->train_mutex); INIT_COMPLETION(edp_drv->idle_comp); mdss_edp_state_ctrl(edp_drv, ST_PUSH_IDLE); @@ -624,6 +626,8 @@ int mdss_edp_off(struct mdss_panel_data *pdata) pr_debug("%s-: state_ctrl=%x\n", __func__, edp_read(edp_drv->base + 0x8)); + + mutex_unlock(&edp_drv->train_mutex); return 0; } @@ -802,7 +806,6 @@ static void mdss_edp_do_link_train(struct mdss_edp_drv_pdata *ep) if (ep->cont_splash) return; - INIT_COMPLETION(ep->train_comp); mdss_edp_link_train(ep); } diff --git a/drivers/video/fbdev/msm/mdss_edp.h b/drivers/video/fbdev/msm/mdss_edp.h index e57d6898194a..78563b556265 100644 --- a/drivers/video/fbdev/msm/mdss_edp.h +++ b/drivers/video/fbdev/msm/mdss_edp.h @@ -316,6 +316,7 @@ struct mdss_edp_drv_pdata { struct completion idle_comp; struct completion video_comp; struct mutex aux_mutex; + struct mutex train_mutex; u32 aux_cmd_busy; u32 aux_cmd_i2c; int aux_trans_num; diff --git a/drivers/video/fbdev/msm/mdss_edp_aux.c b/drivers/video/fbdev/msm/mdss_edp_aux.c index 208e8122ebcc..7aa9792e8c6f 100644 --- a/drivers/video/fbdev/msm/mdss_edp_aux.c +++ b/drivers/video/fbdev/msm/mdss_edp_aux.c @@ -1193,7 +1193,6 @@ static int edp_link_rate_down_shift(struct mdss_edp_drv_pdata *ep) static void edp_clear_training_pattern(struct mdss_edp_drv_pdata *ep) { pr_debug("%s:\n", __func__); - edp_write(ep->base + EDP_STATE_CTRL, 0); edp_train_pattern_set_write(ep, 0); usleep(ep->dpcd.training_read_interval); } @@ -1221,6 +1220,7 @@ train_start: mdss_edp_config_ctrl(ep); mdss_edp_lane_power_ctrl(ep, 1); + mdss_edp_state_ctrl(ep, 0); edp_clear_training_pattern(ep); usleep(ep->dpcd.training_read_interval); @@ -1237,6 +1237,7 @@ train_start: pr_debug("%s: Training 1 completed successfully", __func__); + mdss_edp_state_ctrl(ep, 0); edp_clear_training_pattern(ep); ret = edp_start_link_train_2(ep); if (ret < 0) { @@ -1309,12 +1310,18 @@ int mdss_edp_sink_power_state(struct mdss_edp_drv_pdata *ep, char state) int mdss_edp_link_train(struct mdss_edp_drv_pdata *ep) { - return edp_aux_link_train(ep); + int ret; + + mutex_lock(&ep->train_mutex); + ret = edp_aux_link_train(ep); + mutex_unlock(&ep->train_mutex); + return ret; } void mdss_edp_aux_init(struct mdss_edp_drv_pdata *ep) { mutex_init(&ep->aux_mutex); + mutex_init(&ep->train_mutex); init_completion(&ep->aux_comp); init_completion(&ep->train_comp); init_completion(&ep->idle_comp); |
