Skip to contentSkip to conversation

drm/bridge: lontium-lt9611uxc: disable audio capture for HDMI card

PATCH New Vladimir Yakovlev 1 participant 4 messages Sep 2, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: lontium-lt9611uxc: disable audio capture for HDMI card

The LT9611UXC only has an I2S input and therefore only an HDMI-TX audio channel. In this case, the capture channel must be disabled on the HDMI sound card.

---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +1 -0
index b17483f1550c..79feaec77afc 100644
@@ -562,6 +562,7 @@ static int lt9611uxc_audio_init(struct device *dev, struct lt9611uxc *lt9611uxc)
 	struct hdmi_codec_pdata codec_data = {
 		.ops = &lt9611uxc_codec_ops,
 		.max_i2s_channels = 2,
+		.no_i2s_capture = 1,
 		.i2s = 1,
 		.data = lt9611uxc,
 	};
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 drm/bridge: lontium-lt9611uxc: start wake all thread when call detect()

The chip does not receive an interrupt if the monitor was connected before powering up.
Therefore, you need to wake up the task if the necessary bits are set when calling bridge_detect() after DRM is started.

---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +9 -2
index 748bed8acd2d..5051cdfe2fee 100644
@@ -358,17 +358,24 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid
 	unsigned int reg_val = 0;
 	int ret;
 	bool connected = true;
+	bool edid_read = true;
 
 	lt9611uxc_lock(lt9611uxc);
 
 	if (lt9611uxc->hpd_supported) {
 		ret = regmap_read(lt9611uxc->regmap, 0xb023, &reg_val);
 
-		if (ret)
+		if (ret) {
 			dev_err(lt9611uxc->dev, "failed to read hpd status: %d\n", ret);
-		else
+		} else {
+			dev_dbg(lt9611uxc->dev, "detect() reg[0xb023]=0x%02X\n", reg_val);
 			connected  = reg_val & BIT(1);
+			edid_read = reg_val & BIT(0);
+			if (edid_read)
+				wake_up_all(&lt9611uxc->wq);
+		}
 	}
+	lt9611uxc->edid_read = edid_read;
 	lt9611uxc->hdmi_connected = connected;
 
 	lt9611uxc_unlock(lt9611uxc);
Signature · 1 line
2.34.1
#2 lore raw

PATCH 1/1 drm/bridge: lontium-lt9611uxc: use irq as optional parameter

In reply to Vladimir Yakovlev

On some systems the interrupt pin may not be used.
In this case we exclude DRM_BRIDGE_OP_HPD from supported operations, after which a polling thread is started to detect the connection. (the default polling period for DRM is 10 seconds)

---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 25 ++++++++++++++--------
 1 file changed, 16 insertions(+), 9 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +16 -9
index 1aeb5b29704b..b17483f1550c 100644
@@ -854,12 +854,17 @@ static int lt9611uxc_probe(struct i2c_client *client)
 	init_waitqueue_head(&lt9611uxc->wq);
 	INIT_WORK(&lt9611uxc->work, lt9611uxc_hpd_work);
 
-	ret = request_threaded_irq(client->irq, NULL,
-				   lt9611uxc_irq_thread_handler,
-				   IRQF_ONESHOT, "lt9611uxc", lt9611uxc);
-	if (ret) {
-		dev_err(dev, "failed to request irq\n");
-		goto err_disable_regulators;
+	if (client->irq) {
+		ret = request_threaded_irq(client->irq, NULL,
+					   lt9611uxc_irq_thread_handler,
+					   IRQF_ONESHOT, "lt9611uxc", lt9611uxc);
+		if (ret) {
+			dev_err(dev, "failed to request irq\n");
+			goto err_disable_regulators;
+		}
+		dev_dbg(dev, "Uses IRQ\n");
+	} else {
+		dev_warn(dev, "Irq isn't present. Check Irq or use the polling!!\n");
 	}
 
 	i2c_set_clientdata(client, lt9611uxc);
@@ -867,7 +872,7 @@ static int lt9611uxc_probe(struct i2c_client *client)
 	lt9611uxc->bridge.funcs = &lt9611uxc_bridge_funcs;
 	lt9611uxc->bridge.of_node = client->dev.of_node;
 	lt9611uxc->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID;
-	if (lt9611uxc->hpd_supported)
+	if (lt9611uxc->hpd_supported && client->irq)
 		lt9611uxc->bridge.ops |= DRM_BRIDGE_OP_HPD;
 	lt9611uxc->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
 
@@ -896,7 +901,8 @@ static int lt9611uxc_probe(struct i2c_client *client)
 	return 0;
 
 err_remove_bridge:
-	free_irq(client->irq, lt9611uxc);
+	if (client->irq)
+		free_irq(client->irq, lt9611uxc);
 	cancel_work_sync(&lt9611uxc->work);
 	drm_bridge_remove(&lt9611uxc->bridge);
 
@@ -914,7 +920,8 @@ static void lt9611uxc_remove(struct i2c_client *client)
 {
 	struct lt9611uxc *lt9611uxc = i2c_get_clientdata(client);
 
-	free_irq(client->irq, lt9611uxc);
+	if (client->irq)
+		free_irq(client->irq, lt9611uxc);
 	cancel_work_sync(&lt9611uxc->work);
 	lt9611uxc_audio_exit(lt9611uxc);
 	drm_bridge_remove(&lt9611uxc->bridge);
Signature · 1 line
2.34.1
#3 lore raw

PATCH 1/1 drm/bridge: lontium-lt9611uxc: use reset_gpio as optional parameter

In reply to Vladimir Yakovlev

On some systems the reset pin may not be used.

---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +4 -1
index 5051cdfe2fee..1aeb5b29704b 100644
@@ -179,6 +179,9 @@ static void lt9611uxc_hpd_work(struct work_struct *work)
 
 static void lt9611uxc_reset(struct lt9611uxc *lt9611uxc)
 {
+	if (!lt9611uxc->reset_gpio)
+		return;
+
 	gpiod_set_value_cansleep(lt9611uxc->reset_gpio, 1);
 	msleep(20);
 
@@ -460,7 +463,7 @@ static int lt9611uxc_gpio_init(struct lt9611uxc *lt9611uxc)
 {
 	struct device *dev = lt9611uxc->dev;
 
-	lt9611uxc->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	lt9611uxc->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(lt9611uxc->reset_gpio)) {
 		dev_err(dev, "failed to acquire reset gpio\n");
 		return PTR_ERR(lt9611uxc->reset_gpio);
Signature · 1 line
2.34.1