* [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter
@ 2025-12-08 16:17 Vladimir Yakovlev
2025-12-16 7:37 ` Luca Ceresoli
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Yakovlev @ 2025-12-08 16:17 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Vladimir Yakovlev, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, dri-devel, linux-kernel
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)
Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 26 ++++++++++++++--------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 3868ad05e011..4d550cd1a9a1 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -851,19 +851,25 @@ static int lt9611uxc_probe(struct i2c_client *client)
init_waitqueue_head(<9611uxc->wq);
INIT_WORK(<9611uxc->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, "The interrupt (IRQ) is not specified in the DTS.\n");
+ dev_warn(dev, "Check the interrupt (IRQ) or polling will be used!!!\n");
}
i2c_set_clientdata(client, lt9611uxc);
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;
@@ -892,7 +898,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(<9611uxc->work);
drm_bridge_remove(<9611uxc->bridge);
@@ -910,7 +917,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(<9611uxc->work);
lt9611uxc_audio_exit(lt9611uxc);
drm_bridge_remove(<9611uxc->bridge);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter
2025-12-08 16:17 [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter Vladimir Yakovlev
@ 2025-12-16 7:37 ` Luca Ceresoli
0 siblings, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2025-12-16 7:37 UTC (permalink / raw)
To: Vladimir Yakovlev, Dmitry Baryshkov
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel
Hello,
On Mon Dec 8, 2025 at 5:17 PM CET, Vladimir Yakovlev wrote:
> 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)
>
> Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
> ---
> drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 26 ++++++++++++++--------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
> index 3868ad05e011..4d550cd1a9a1 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
> @@ -851,19 +851,25 @@ static int lt9611uxc_probe(struct i2c_client *client)
> init_waitqueue_head(<9611uxc->wq);
> INIT_WORK(<9611uxc->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);
This is per se correct, but while you're touching this it's a good
opportunity to switch to devm_request_threaded_irq(). This would simplify
the removal code too (see below).
> + if (ret) {
> + dev_err(dev, "failed to request irq\n");
> + goto err_disable_regulators;
> + }
> + dev_dbg(dev, "Uses IRQ\n");
> + } else {
> + dev_warn(dev, "The interrupt (IRQ) is not specified in the DTS.\n");
> + dev_warn(dev, "Check the interrupt (IRQ) or polling will be used!!!\n");
If hardware without this IRQ is supported, there is no reason to warn. You
can have a dev_dbg() at most, or even nothing at all.
> }
>
> i2c_set_clientdata(client, lt9611uxc);
>
> 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;
>
> @@ -892,7 +898,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);
With devm_request_threaded_irq() you can remove entirely the free_irq()
here...
> cancel_work_sync(<9611uxc->work);
> drm_bridge_remove(<9611uxc->bridge);
>
> @@ -910,7 +917,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);
...as well as here.
So I'd suggest to add a new patch to switch to devm_request_threaded_irq(),
followed by this one, which will be a simpler.
Best regards,
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] drm/bridge: lontium-lt9611uxc: disable audio capture for HDMI card
@ 2025-09-02 23:18 Vladimir Yakovlev
2025-09-02 23:18 ` [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter Vladimir Yakovlev
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Yakovlev @ 2025-09-02 23:18 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel
Cc: vovchkir
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.
Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index b17483f1550c..79feaec77afc 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -562,6 +562,7 @@ static int lt9611uxc_audio_init(struct device *dev, struct lt9611uxc *lt9611uxc)
struct hdmi_codec_pdata codec_data = {
.ops = <9611uxc_codec_ops,
.max_i2s_channels = 2,
+ .no_i2s_capture = 1,
.i2s = 1,
.data = lt9611uxc,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter
2025-09-02 23:18 [PATCH] drm/bridge: lontium-lt9611uxc: disable audio capture for HDMI card Vladimir Yakovlev
@ 2025-09-02 23:18 ` Vladimir Yakovlev
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Yakovlev @ 2025-09-02 23:18 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel
Cc: vovchkir
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)
Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 25 ++++++++++++++--------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 1aeb5b29704b..b17483f1550c 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -854,12 +854,17 @@ static int lt9611uxc_probe(struct i2c_client *client)
init_waitqueue_head(<9611uxc->wq);
INIT_WORK(<9611uxc->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 = <9611uxc_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(<9611uxc->work);
drm_bridge_remove(<9611uxc->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(<9611uxc->work);
lt9611uxc_audio_exit(lt9611uxc);
drm_bridge_remove(<9611uxc->bridge);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-16 7:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 16:17 [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter Vladimir Yakovlev
2025-12-16 7:37 ` Luca Ceresoli
-- strict thread matches above, loose matches on Subject: below --
2025-09-02 23:18 [PATCH] drm/bridge: lontium-lt9611uxc: disable audio capture for HDMI card Vladimir Yakovlev
2025-09-02 23:18 ` [PATCH] drm/bridge: lontium-lt9611uxc: use irq as optional parameter Vladimir Yakovlev
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).