[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210131095537.962292-1-ddone@aruko.org>
Date: Sun, 31 Jan 2021 11:55:35 +0200
From: Mykyta Poturai <ddone@...ko.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Mykyta Poturai <ddone@...ko.org>,
Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...l.net>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Sam Ravnborg <sam@...nborg.org>,
Boris Brezillon <boris.brezillon@...labora.com>,
Liu Ying <victor.liu@....com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] drm/bridge: dw-hdmi: Add DT binding to disable hotplug detect
Add "disable-hpd" boolean binding for the device tree. When this option
is turned on HPD-related IRQ is disabled and it is assumed that the HDMI
connector is connected all the time. This may be useful in systems where
it is impossible or undesirable to connect the HPD pin, or the
connection is broken.
Signed-off-by: Mykyta Poturai <ddone@...ko.org>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 0c79a9ba48bb..4ca0ac130beb 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -194,6 +194,7 @@ struct dw_hdmi {
unsigned int audio_cts;
unsigned int audio_n;
bool audio_enable;
+ bool disable_hpd;
unsigned int reg_shift;
struct regmap *regm;
@@ -1559,7 +1560,7 @@ static void dw_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data)
enum drm_connector_status dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi,
void *data)
{
- return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD ?
+ return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD || hdmi->disable_hpd ?
connector_status_connected : connector_status_disconnected;
}
EXPORT_SYMBOL_GPL(dw_hdmi_phy_read_hpd);
@@ -1585,6 +1586,10 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data)
* Configure the PHY RX SENSE and HPD interrupts polarities and clear
* any pending interrupt.
*/
+
+ if (hdmi->disable_hpd)
+ return;
+
hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0);
hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
HDMI_IH_PHY_STAT0);
@@ -3212,6 +3217,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
mutex_init(&hdmi->cec_notifier_mutex);
spin_lock_init(&hdmi->audio_lock);
+ if (of_property_read_bool(np, "disable-hpd")) {
+ dev_info(hdmi->dev, "Disabling HPD\n");
+ hdmi->disable_hpd = true;
+ }
ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
if (ddc_node) {
hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node);
--
2.30.0
Powered by blists - more mailing lists