[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220408013356.673732-1-nfraprado@collabora.com>
Date: Thu, 7 Apr 2022 21:33:56 -0400
From: Nícolas F. R. A. Prado
<nfraprado@...labora.com>
To: Robert Foss <robert.foss@...aro.org>,
Neil Armstrong <narmstrong@...libre.com>,
Andrzej Hajda <andrzej.hajda@...el.com>
Cc: kernel@...labora.com,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Nícolas F. R. A. Prado
<nfraprado@...labora.com>, Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jonas Karlman <jonas@...boo.se>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Maxime Ripard <maxime@...no.tech>,
Pi-Hsun Shih <pihsun@...omium.org>,
Sam Ravnborg <sam@...nborg.org>,
Tzung-Bi Shih <tzungbi@...gle.com>,
Xin Ji <xji@...logixsemi.com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/bridge: anx7625: Use irq flags from devicetree
Read the irq flags, like which edge to trigger on, from the devicetree
and use those when registering the irq instead of hardcoding them.
In case none was specified, fallback to falling edge trigger.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 6516f9570b86..97d954b8cc12 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -2588,6 +2588,7 @@ static int anx7625_i2c_probe(struct i2c_client *client,
struct anx7625_platform_data *pdata;
int ret = 0;
struct device *dev = &client->dev;
+ unsigned long irqflags;
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_I2C_BLOCK)) {
@@ -2639,10 +2640,13 @@ static int anx7625_i2c_probe(struct i2c_client *client,
goto free_hdcp_wq;
}
+ irqflags = irq_get_trigger_type(client->irq);
+ if (!irqflags)
+ irqflags = IRQF_TRIGGER_FALLING;
+
ret = devm_request_threaded_irq(dev, platform->pdata.intp_irq,
NULL, anx7625_intr_hpd_isr,
- IRQF_TRIGGER_FALLING |
- IRQF_ONESHOT,
+ irqflags | IRQF_ONESHOT,
"anx7625-intp", platform);
if (ret) {
DRM_DEV_ERROR(dev, "fail to request irq\n");
--
2.35.1
Powered by blists - more mailing lists