From: plaes@plaes.org (Priit Laes)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drm/sun4i: hdmi: Improve compatibility with non-hotplug capable connectors
Date: Fri, 16 Nov 2018 19:18:29 +0200 [thread overview]
Message-ID: <20181116171830.23465-1-plaes@plaes.org> (raw)
From: Priit Laes <priit.laes@paf.com>
Even though HDMI connector features hotplug detect pin (HPD), there are
devices that which do not support it. For these devices fall back to
additional check on I2C bus. Of course, there might be also devices
that do not wire DDC pins too, so we don't really know whether cable
has been connected.
Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Priit Laes <priit.laes@paf.com>
---
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 061d2e0d9011..bded09af1340 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -238,14 +238,18 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)
struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
unsigned long reg;
- if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg,
+ if (!readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg,
reg & SUN4I_HDMI_HPD_HIGH,
0, 500000)) {
- cec_phys_addr_invalidate(hdmi->cec_adap);
- return connector_status_disconnected;
+ return connector_status_connected;
}
- return connector_status_connected;
+ if (!IS_ERR(hdmi->i2c) && drm_probe_ddc(hdmi->i2c))
+ return connector_status_connected;
+
+ cec_phys_addr_invalidate(hdmi->cec_adap);
+
+ return connector_status_unknown;
}
static const struct drm_connector_funcs sun4i_hdmi_connector_funcs = {
--
2.19.1
next reply other threads:[~2018-11-16 17:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 17:18 Priit Laes [this message]
2018-11-19 8:19 ` [PATCH] drm/sun4i: hdmi: Improve compatibility with non-hotplug capable connectors Maxime Ripard
2018-11-19 8:50 ` Priit Laes
2018-11-19 10:26 ` Russell King - ARM Linux
2018-11-20 8:58 ` Maxime Ripard
2018-12-05 13:18 ` Priit Laes
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=20181116171830.23465-1-plaes@plaes.org \
--to=plaes@plaes.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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