From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org,
DRI mailing list <dri-devel@lists.freedesktop.org>,
Philipp Zabel <philipp.zabel@gmail.com>
Subject: [PATCH] imx-drm: imx-hdmi: fix hdmi hotplug detection initial state
Date: Fri, 06 Jun 2014 14:56:43 +0100 [thread overview]
Message-ID: <E1WsudP-0003TB-R1@rmk-PC.arm.linux.org.uk> (raw)
The initial state at boot is assumed to be disconnected, and we hope
to receive an interrupt to update the status. Let's be more explicit
about the current state - reading the PHY status register tells us
the current level of the hotplug signal, which we can report back in
the _detect() method.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
This fix should go in for -rc - though it's probably too late to get it
in for 3.15, it may be considered as a potential stable candidate. If
not, can we get this in for 3.16-rc1 please?
Thanks.
drivers/staging/imx-drm/imx-hdmi.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c
index d47dedd2cdb4..6f5efcc89880 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -120,8 +120,6 @@ struct imx_hdmi {
struct clk *isfr_clk;
struct clk *iahb_clk;
- enum drm_connector_status connector_status;
-
struct hdmi_data_info hdmi_data;
int vic;
@@ -1382,7 +1380,9 @@ static enum drm_connector_status imx_hdmi_connector_detect(struct drm_connector
{
struct imx_hdmi *hdmi = container_of(connector, struct imx_hdmi,
connector);
- return hdmi->connector_status;
+
+ return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD ?
+ connector_status_connected : connector_status_disconnected;
}
static int imx_hdmi_connector_get_modes(struct drm_connector *connector)
@@ -1524,7 +1524,6 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id)
hdmi_modb(hdmi, 0, HDMI_PHY_HPD, HDMI_PHY_POL0);
- hdmi->connector_status = connector_status_connected;
imx_hdmi_poweron(hdmi);
} else {
dev_dbg(hdmi->dev, "EVENT=plugout\n");
@@ -1532,7 +1531,6 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id)
hdmi_modb(hdmi, HDMI_PHY_HPD, HDMI_PHY_HPD,
HDMI_PHY_POL0);
- hdmi->connector_status = connector_status_disconnected;
imx_hdmi_poweroff(hdmi);
}
drm_helper_hpd_irq_event(hdmi->connector.dev);
@@ -1606,7 +1604,6 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data)
return -ENOMEM;
hdmi->dev = dev;
- hdmi->connector_status = connector_status_disconnected;
hdmi->sample_rate = 48000;
hdmi->ratio = 100;
--
1.8.3.1
next reply other threads:[~2014-06-06 13:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 13:56 Russell King [this message]
2014-06-06 14:06 ` [PATCH] imx-drm: imx-hdmi: fix hdmi hotplug detection initial state Greg Kroah-Hartman
2014-06-09 13:44 ` Fabio Estevam
2014-06-09 14:06 ` Russell King - ARM Linux
2014-06-09 14:29 ` Fabio Estevam
2014-06-09 14:33 ` Shawn Guo
2014-06-09 15:19 ` Fabio Estevam
2014-06-09 17:49 ` Russell King - ARM Linux
2014-06-09 18:15 ` Fabio Estevam
2014-06-09 18:38 ` Fabio Estevam
2014-06-09 18:47 ` Fabio Estevam
2014-06-09 20:09 ` Russell King - ARM Linux
2014-06-09 21:03 ` Fabio Estevam
2014-06-10 12:58 ` Fabio Estevam
2014-06-10 13:32 ` Fabio Estevam
2014-06-11 8:17 ` Russell King - ARM Linux
2014-06-11 15:34 ` Philipp Zabel
2014-06-16 14:13 ` Fabio Estevam
2014-06-16 21:49 ` Russell King - ARM Linux
2014-06-10 15:13 ` Russell King - ARM Linux
2014-06-10 16:14 ` Russell King - ARM Linux
2014-06-10 17:04 ` Russell King - ARM Linux
2014-06-10 17:36 ` Fabio Estevam
2014-06-09 19:29 ` Russell King - ARM Linux
2014-06-09 19:29 ` Russell King - ARM Linux
2014-06-10 18:54 ` Tim Harvey
2014-06-10 19:03 ` Fabio Estevam
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=E1WsudP-0003TB-R1@rmk-PC.arm.linux.org.uk \
--to=rmk+kernel@arm.linux.org.uk \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=philipp.zabel@gmail.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).