linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <mythripk@ti.com>
To: tomi.valkeinen@ti.com, linux-omap@vger.kernel.org
Cc: Mythri P K <mythripk@ti.com>
Subject: [PATCH v2 2/3] OMAPDSS: HDMI: Handle HPD event in ip
Date: Fri, 6 Jan 2012 18:14:36 +0530	[thread overview]
Message-ID: <1325853877-6712-3-git-send-email-mythripk@ti.com> (raw)
In-Reply-To: <1325853877-6712-2-git-send-email-mythripk@ti.com>

From: Mythri P K <mythripk@ti.com>

HPD event is notified to ip file and based on the
notification appropriate action is taken. As the PHY
should be in LDO_ON state and not TX_ON (transmission),
this transition is handled in ip file.

Signed-off-by: Mythri P K <mythripk@ti.com>
---
 drivers/video/omap2/dss/ti_hdmi.h         |    4 +++
 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |   31 ++++++++++++++++++++++++----
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 9a31683..eba2ed4 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -113,6 +113,8 @@ struct ti_hdmi_ip_ops {
 
 	int (*configure_range)(struct hdmi_ip_data *ip_data);
 
+	int (*notify_hpd)(struct hdmi_ip_data *ip_data, int hpd_state);
+
 };
 
 /*
@@ -167,6 +169,7 @@ struct hdmi_ip_data {
 	struct hdmi_pll_info pll_data;
 	struct hdmi_core_infoframe_avi avi_cfg;
 	enum hdmi_range range;
+	bool hdmi_phy_tx_enabled;
 };
 int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
@@ -185,4 +188,5 @@ void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
 void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable);
 #endif
 int ti_hdmi_4xxx_configure_range(struct hdmi_ip_data *ip_data);
+int ti_hdmi_4xxx_notify_hpd(struct hdmi_ip_data *ip_data, bool hpd_state);
 #endif
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index 58c5782..10c845d 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -223,15 +223,11 @@ void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data)
 	hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF);
 }
 
-int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data)
+int ti_hdmi_4xxx_phy_poweron(struct hdmi_ip_data *ip_data)
 {
 	u16 r = 0;
 	void __iomem *phy_base = hdmi_phy_base(ip_data);
 
-	r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON);
-	if (r)
-		return r;
-
 	r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_TXON);
 	if (r)
 		return r;
@@ -260,11 +256,36 @@ int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data)
 	return 0;
 }
 
+int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data)
+{
+	int r = 0;
+
+	r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON);
+
+	return r;
+}
+
 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data)
 {
 	hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF);
 }
 
+int ti_hdmi_4xxx_notify_hpd(struct hdmi_ip_data *ip_data, bool hpd_state)
+{
+	int r = 0;
+
+	if (hpd_state != ip_data->hdmi_phy_tx_enabled) {
+		if (hpd_state)
+			r = ti_hdmi_4xxx_phy_poweron(ip_data);
+		else
+			r = ti_hdmi_4xxx_phy_enable(ip_data);
+		if (!r)
+			ip_data->hdmi_phy_tx_enabled = hpd_state;
+	}
+
+	return r;
+}
+
 static int hdmi_core_ddc_init(struct hdmi_ip_data *ip_data)
 {
 	void __iomem *base = hdmi_core_sys_base(ip_data);
-- 
1.7.5.4


  reply	other threads:[~2012-01-06 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06 12:44 [PATCH 0/3] OMAPDSS: HDMI: HDMI Hot-plug detect support mythripk
2012-01-06 12:44 ` [PATCH v2 1/3] OMAPDSS: HDMI: HPD support in boardfile mythripk
2012-01-06 12:44   ` mythripk [this message]
2012-01-06 12:44     ` [PATCH v2 3/3] OMAPDSS: HDMI: HPD support added to HDMI driver mythripk
2012-01-10  7:58       ` Shubhrajyoti
2012-01-10  7:37   ` [PATCH v2 1/3] OMAPDSS: HDMI: HPD support in boardfile Tomi Valkeinen
2012-01-10  7:43     ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325853877-6712-3-git-send-email-mythripk@ti.com \
    --to=mythripk@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).