From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com> To: Robert Foss <robert.foss@linaro.org>, Neil Armstrong <narmstrong@baylibre.com>, Andrzej Hajda <andrzej.hajda@intel.com> Cc: kernel@collabora.com, "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>, "Nícolas F. R. A. Prado" <nfraprado@collabora.com>, "Daniel Vetter" <daniel@ffwll.ch>, "David Airlie" <airlied@linux.ie>, "Hsin-Yi Wang" <hsinyi@chromium.org>, "Jernej Skrabec" <jernej.skrabec@gmail.com>, "Jonas Karlman" <jonas@kwiboo.se>, "Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>, "Maxime Ripard" <maxime@cerno.tech>, "Pi-Hsun Shih" <pihsun@chromium.org>, "Sam Ravnborg" <sam@ravnborg.org>, "Tzung-Bi Shih" <tzungbi@google.com>, "Xin Ji" <xji@analogixsemi.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge: anx7625: Use irq flags from devicetree Date: Thu, 7 Apr 2022 21:33:56 -0400 [thread overview] Message-ID: <20220408013356.673732-1-nfraprado@collabora.com> (raw) 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@collabora.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
WARNING: multiple messages have this Message-ID (diff)
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com> To: Robert Foss <robert.foss@linaro.org>, Neil Armstrong <narmstrong@baylibre.com>, Andrzej Hajda <andrzej.hajda@intel.com> Cc: "Pi-Hsun Shih" <pihsun@chromium.org>, "Nícolas F. R. A. Prado" <nfraprado@collabora.com>, "Jonas Karlman" <jonas@kwiboo.se>, "David Airlie" <airlied@linux.ie>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Jernej Skrabec" <jernej.skrabec@gmail.com>, "Tzung-Bi Shih" <tzungbi@google.com>, "Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>, "Hsin-Yi Wang" <hsinyi@chromium.org>, "Maxime Ripard" <maxime@cerno.tech>, kernel@collabora.com, "Sam Ravnborg" <sam@ravnborg.org>, "Xin Ji" <xji@analogixsemi.com>, "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com> Subject: [PATCH] drm/bridge: anx7625: Use irq flags from devicetree Date: Thu, 7 Apr 2022 21:33:56 -0400 [thread overview] Message-ID: <20220408013356.673732-1-nfraprado@collabora.com> (raw) 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@collabora.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
next reply other threads:[~2022-04-08 1:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-08 1:33 Nícolas F. R. A. Prado [this message] 2022-04-08 1:33 ` [PATCH] drm/bridge: anx7625: Use irq flags from devicetree Nícolas F. R. A. Prado 2022-04-08 10:15 ` AngeloGioacchino Del Regno 2022-04-08 10:15 ` AngeloGioacchino Del Regno 2022-04-08 15:34 ` Nícolas F. R. A. Prado 2022-04-08 15:34 ` Nícolas F. R. A. Prado
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220408013356.673732-1-nfraprado@collabora.com \ --to=nfraprado@collabora.com \ --cc=Laurent.pinchart@ideasonboard.com \ --cc=airlied@linux.ie \ --cc=andrzej.hajda@intel.com \ --cc=angelogioacchino.delregno@collabora.com \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=hsinyi@chromium.org \ --cc=jernej.skrabec@gmail.com \ --cc=jonas@kwiboo.se \ --cc=kernel@collabora.com \ --cc=linux-kernel@vger.kernel.org \ --cc=maxime@cerno.tech \ --cc=narmstrong@baylibre.com \ --cc=pihsun@chromium.org \ --cc=robert.foss@linaro.org \ --cc=sam@ravnborg.org \ --cc=tzungbi@google.com \ --cc=xji@analogixsemi.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.