summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAjay Singh Parmar <aparmar@codeaurora.org>2014-01-12 16:52:51 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:25:15 -0700
commit112fac3fa3f442633f8de4033ed88dba64c8ee1a (patch)
treeb7040a4fc13bd3f3a4d6e66505622a140ae0038b /drivers/video/fbdev
parenta8c6d5f6c455d04a50acb7427e8019b47e34aff5 (diff)
msm: mdss: hdmi: Support for HPD enable/disable
Provide support for HPD (Hot Plug Detection) enable/disable using sysfs node. Write 3 to sysfs node "hpd" to disable the HPD until written 4 to enable it back. Change-Id: Ib80ea1f55b859e7935e7f187dc06222ab6bea2d8 Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c25
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.h1
2 files changed, 25 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index cda1f39c7f1b..ca16e083d1de 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -103,7 +103,9 @@ enum msm_hdmi_supported_audio_sample_rates {
enum hdmi_tx_hpd_states {
HPD_OFF,
HPD_ON,
- HPD_ON_CONDITIONAL_MTP
+ HPD_ON_CONDITIONAL_MTP,
+ HPD_DISABLE,
+ HPD_ENABLE
};
/* parameters for clock regeneration */
@@ -596,6 +598,10 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
switch (hpd) {
case HPD_OFF:
+ case HPD_DISABLE:
+ if (hpd == HPD_DISABLE)
+ hdmi_ctrl->hpd_disabled = true;
+
if (!hdmi_ctrl->hpd_feature_on) {
DEV_DBG("%s: HPD is already off\n", __func__);
return ret;
@@ -613,6 +619,12 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
hdmi_ctrl->sdev.state);
break;
case HPD_ON:
+ if (hdmi_ctrl->hpd_disabled == true) {
+ DEV_ERR("%s: hpd is disabled, state %d not allowed\n",
+ __func__, hpd);
+ return ret;
+ }
+
if (hdmi_ctrl->pdata.cond_power_on) {
DEV_ERR("%s: hpd state %d not allowed w/ cond. hpd\n",
__func__, hpd);
@@ -627,6 +639,12 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, true);
break;
case HPD_ON_CONDITIONAL_MTP:
+ if (hdmi_ctrl->hpd_disabled == true) {
+ DEV_ERR("%s: hpd is disabled, state %d not allowed\n",
+ __func__, hpd);
+ return ret;
+ }
+
if (!hdmi_ctrl->pdata.cond_power_on) {
DEV_ERR("%s: hpd state %d not allowed w/o cond. hpd\n",
__func__, hpd);
@@ -640,6 +658,11 @@ static ssize_t hdmi_tx_sysfs_wta_hpd(struct device *dev,
rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, true);
break;
+ case HPD_ENABLE:
+ hdmi_ctrl->hpd_disabled = false;
+
+ rc = hdmi_tx_sysfs_enable_hpd(hdmi_ctrl, true);
+ break;
default:
DEV_ERR("%s: Invalid HPD state requested\n", __func__);
return ret;
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.h b/drivers/video/fbdev/msm/mdss_hdmi_tx.h
index 7e31c1f9f4da..366e1a8b4aca 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.h
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.h
@@ -84,6 +84,7 @@ struct hdmi_tx_ctrl {
struct work_struct cable_notify_work;
bool hdcp_feature_on;
+ bool hpd_disabled;
u32 present_hdcp;
u8 spd_vendor_name[9];