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>
This commit is contained in:
parent
727dad9a94
commit
da4d92394d
1 changed files with 33 additions and 8 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue