diff options
| author | Ajay Singh Parmar <aparmar@codeaurora.org> | 2016-01-22 16:09:37 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:18:01 -0700 |
| commit | da4d92394dde4bb55fd26f4a355dc60a8b4ce7e8 (patch) | |
| tree | 43b3c529543a5a871cb049948289bd3fabfb2877 /drivers/video/fbdev/msm | |
| parent | 727dad9a94e78f44904d7534e17ea6cb9c3ca05a (diff) | |
msm: mdss: hdmi: use hardware hot plug trigger
On receiving hot plug power off event, switch off 5V
regulator in case cable is still connected to sink to
receive disconnect hardware interrupt. Do not issue
software based disconnect event in this case as it can
cause different modules to go out of sync resulting in
unstable system.
Change-Id: I19d82b62e8ad507458abd21a8a71fbcae8adefec
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev/msm')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_tx.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index bb2e064665ae..c2dc735137ca 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -656,6 +656,29 @@ void *hdmi_get_featuredata_from_sysfs_dev(struct device *device, } /* hdmi_tx_get_featuredata_from_sysfs_dev */ EXPORT_SYMBOL(hdmi_get_featuredata_from_sysfs_dev); +static int hdmi_tx_config_5v(struct hdmi_tx_ctrl *hdmi_ctrl, bool enable) +{ + struct dss_module_power *pd = NULL; + int ret = 0; + + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid input\n", __func__); + ret = -EINVAL; + goto end; + } + + pd = &hdmi_ctrl->pdata.power_data[HDMI_TX_HPD_PM]; + if (!pd || !pd->gpio_config) { + DEV_ERR("%s: Error: invalid power data\n", __func__); + ret = -EINVAL; + goto end; + } + + gpio_set_value(pd->gpio_config->gpio, enable); +end: + return ret; +} + static ssize_t hdmi_tx_sysfs_rda_connected(struct device *dev, struct device_attribute *attr, char *buf) { @@ -887,11 +910,12 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev, hdmi_ctrl->audio_ack_enabled = false; - hdmi_tx_set_audio_switch_node(hdmi_ctrl, 0); - hdmi_tx_wait_for_audio_engine(hdmi_ctrl); - hdmi_tx_send_cable_notification(hdmi_ctrl, 0); - - rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, false); + if (hdmi_ctrl->panel_power_on) { + hdmi_ctrl->hpd_off_pending = true; + hdmi_tx_config_5v(hdmi_ctrl, false); + } else { + hdmi_tx_hpd_off(hdmi_ctrl); + } break; case HPD_ON: @@ -1242,7 +1266,7 @@ static ssize_t hdmi_tx_sysfs_wta_5v(struct device *dev, mutex_lock(&hdmi_ctrl->tx_lock); pd = &hdmi_ctrl->pdata.power_data[HDMI_TX_HPD_PM]; - if (!pd) { + if (!pd || !pd->gpio_config) { DEV_ERR("%s: Error: invalid power data\n", __func__); ret = -EINVAL; goto end; @@ -1256,8 +1280,9 @@ static ssize_t hdmi_tx_sysfs_wta_5v(struct device *dev, read = ~(!!read ^ pd->gpio_config->value) & BIT(0); - DEV_DBG("%s: writing %d to 5v gpio\n", __func__, read); - gpio_set_value(pd->gpio_config->gpio, read); + ret = hdmi_tx_config_5v(hdmi_ctrl, read); + if (ret) + goto end; ret = strnlen(buf, PAGE_SIZE); end: |
