Skip to contentSkip to conversation

drm/bridge: dw-hdmi: Add DT binding to disable hotplug detect

PATCH Neil Armstrong 1 participant 1 message Feb 8, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Mykyta Poturai

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.

DRM mode forcing exists for this reason.

You can even force an EDID to have a fixed mode.

Neil

Quoted 40 lines
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +6 -1
index 0c79a9ba48bb..4ca0ac130beb 100644
@@ -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);

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, · line 3226

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +4 -0
@@ -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);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel