diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-09-13 10:58:15 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-09-13 10:58:15 -0700 |
| commit | 3bbf983f457b334f1d2c8827b56139ff0dc31531 (patch) | |
| tree | c6bcd5f2753d661cae3864442c8899d9e41be582 | |
| parent | 288edc578d8b4cc6333dc93cc63597361727c838 (diff) | |
| parent | 942e1ce7e92bf016179b383373025ccb66f92354 (diff) | |
Merge "msm: mdss: hdmi: fix no audio over HDMI on device bootup"
| -rw-r--r-- | drivers/platform/msm/msm_ext_display.c | 23 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_tx.c | 55 |
2 files changed, 59 insertions, 19 deletions
diff --git a/drivers/platform/msm/msm_ext_display.c b/drivers/platform/msm/msm_ext_display.c index 4f7d27db8dee..bc15ef2a5b2b 100644 --- a/drivers/platform/msm/msm_ext_display.c +++ b/drivers/platform/msm/msm_ext_display.c @@ -39,6 +39,8 @@ struct msm_ext_disp { struct list_head display_list; struct mutex lock; struct completion hpd_comp; + bool update_audio; + u32 flags; }; static int msm_ext_disp_get_intf_data(struct msm_ext_disp *ext_disp, @@ -340,6 +342,8 @@ static int msm_ext_disp_hpd(struct platform_device *pdev, goto end; } + ext_disp->flags = flags; + if (state == EXT_DISPLAY_CABLE_CONNECT) { if (!msm_ext_disp_validate_connect(ext_disp, type, flags)) { pr_err("Display interface (%s) already connected\n", @@ -570,6 +574,7 @@ static int msm_ext_disp_update_audio_ops(struct msm_ext_disp *ext_disp, { int ret = 0; struct msm_ext_disp_audio_codec_ops *ops = ext_disp->ops; + ext_disp->update_audio = false; if (!(flags & MSM_EXT_DISP_HPD_AUDIO)) { pr_debug("skipping audio ops setup for display (%s)\n", @@ -579,6 +584,10 @@ static int msm_ext_disp_update_audio_ops(struct msm_ext_disp *ext_disp, if (!ops) { pr_err("Invalid audio ops\n"); + if (state == EXT_DISPLAY_CABLE_CONNECT) { + /* update audio ops once audio codec gets registered */ + ext_disp->update_audio = true; + } ret = -EINVAL; goto end; } @@ -682,6 +691,18 @@ int msm_ext_disp_register_audio_codec(struct platform_device *pdev, pr_debug("audio codec registered\n"); + mutex_lock(&ext_disp->lock); + if (ext_disp->update_audio) { + msm_ext_disp_update_audio_ops(ext_disp, ext_disp->current_disp, + EXT_DISPLAY_CABLE_CONNECT, ext_disp->flags); + + msm_ext_disp_process_audio(ext_disp, ext_disp->current_disp, + EXT_DISPLAY_CABLE_CONNECT, ext_disp->flags); + + ext_disp->update_audio = false; + } + mutex_unlock(&ext_disp->lock); + return ret; } @@ -803,6 +824,8 @@ static int msm_ext_disp_probe(struct platform_device *pdev) INIT_LIST_HEAD(&ext_disp->display_list); init_completion(&ext_disp->hpd_comp); ext_disp->current_disp = EXT_DISPLAY_TYPE_MAX; + ext_disp->flags = 0; + ext_disp->update_audio = false; return ret; diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index e06b4d6579ba..13c57f811a81 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -410,29 +410,33 @@ static inline void hdmi_tx_cec_device_suspend(struct hdmi_tx_ctrl *hdmi_ctrl) hdmi_cec_device_suspend(fd, hdmi_ctrl->panel_suspend); } -static inline void hdmi_tx_send_cable_notification( +static inline void hdmi_tx_send_audio_notification( + struct hdmi_tx_ctrl *hdmi_ctrl, int val) +{ + if (hdmi_ctrl && hdmi_ctrl->ext_audio_data.intf_ops.hpd) { + u32 flags = 0; + + if (!hdmi_tx_is_dvi_mode(hdmi_ctrl)) + flags |= MSM_EXT_DISP_HPD_AUDIO; + + if (flags) + hdmi_ctrl->ext_audio_data.intf_ops.hpd( + hdmi_ctrl->ext_pdev, + hdmi_ctrl->ext_audio_data.type, val, flags); + } +} + +static inline void hdmi_tx_send_video_notification( struct hdmi_tx_ctrl *hdmi_ctrl, int val, bool async) { if (hdmi_ctrl && hdmi_ctrl->ext_audio_data.intf_ops.hpd) { u32 flags = 0; - if (async || hdmi_tx_is_in_splash(hdmi_ctrl)) { + if (async || hdmi_tx_is_in_splash(hdmi_ctrl)) flags |= MSM_EXT_DISP_HPD_ASYNC_VIDEO; - - if (async) { - if (!hdmi_tx_is_dvi_mode(hdmi_ctrl)) - flags |= MSM_EXT_DISP_HPD_ASYNC_AUDIO; - } else - if (!hdmi_tx_is_dvi_mode(hdmi_ctrl)) - flags |= MSM_EXT_DISP_HPD_AUDIO; - - } else { + else flags |= MSM_EXT_DISP_HPD_VIDEO; - if (!hdmi_tx_is_dvi_mode(hdmi_ctrl)) - flags |= MSM_EXT_DISP_HPD_AUDIO; - } - hdmi_ctrl->ext_audio_data.intf_ops.hpd(hdmi_ctrl->ext_pdev, hdmi_ctrl->ext_audio_data.type, val, flags); } @@ -445,6 +449,8 @@ static inline void hdmi_tx_ack_state( !hdmi_tx_is_dvi_mode(hdmi_ctrl)) hdmi_ctrl->ext_audio_data.intf_ops.notify(hdmi_ctrl->ext_pdev, val); + + hdmi_tx_send_audio_notification(hdmi_ctrl, val); } static struct hdmi_tx_ctrl *hdmi_tx_get_drvdata_from_panel_data( @@ -876,7 +882,8 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev, * No need to blocking wait for display/audio in this * case since HAL is not up so no ACK can be expected. */ - hdmi_tx_send_cable_notification(hdmi_ctrl, 0, true); + hdmi_tx_send_audio_notification(hdmi_ctrl, 0); + hdmi_tx_send_video_notification(hdmi_ctrl, 0, true); } break; @@ -2373,7 +2380,15 @@ static void hdmi_tx_hpd_int_work(struct work_struct *work) mutex_unlock(&hdmi_ctrl->tx_lock); - hdmi_tx_send_cable_notification(hdmi_ctrl, hdmi_ctrl->hpd_state, false); + if (hdmi_ctrl->hpd_state) + hdmi_tx_send_video_notification(hdmi_ctrl, + hdmi_ctrl->hpd_state, true); + else { + hdmi_tx_send_audio_notification(hdmi_ctrl, + hdmi_ctrl->hpd_state); + hdmi_tx_send_video_notification(hdmi_ctrl, + hdmi_ctrl->hpd_state, true); + } } /* hdmi_tx_hpd_int_work */ static int hdmi_tx_check_capability(struct hdmi_tx_ctrl *hdmi_ctrl) @@ -3989,7 +4004,8 @@ static int hdmi_tx_post_evt_handle_resume(struct hdmi_tx_ctrl *hdmi_ctrl) &hdmi_ctrl->hpd_int_done, HZ/10); if (!timeout) { pr_debug("cable removed during suspend\n"); - hdmi_tx_send_cable_notification(hdmi_ctrl, 0, false); + hdmi_tx_send_audio_notification(hdmi_ctrl, 0); + hdmi_tx_send_video_notification(hdmi_ctrl, 0, true); } } @@ -4000,7 +4016,8 @@ static int hdmi_tx_post_evt_handle_panel_on(struct hdmi_tx_ctrl *hdmi_ctrl) { if (hdmi_ctrl->panel_suspend) { pr_debug("panel suspend has triggered\n"); - hdmi_tx_send_cable_notification(hdmi_ctrl, 0, false); + hdmi_tx_send_audio_notification(hdmi_ctrl, 0); + hdmi_tx_send_video_notification(hdmi_ctrl, 0, true); } return 0; |
