From: Neil Armstrong <neil.armstrong@linaro.org>
To: Jonathan Cormier <jcormier@criticallink.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Michael Williamson <michael.williamson@criticallink.com>,
Bob Duke <bduke@criticallink.com>
Subject: Re: [PATCH v3 3/3] drm/bridge: tfp410: If connected, use I2C for polled HPD status.
Date: Fri, 31 Mar 2023 11:03:17 +0200 [thread overview]
Message-ID: <15047d72-1cc1-5afe-0003-c67d093dc297@linaro.org> (raw)
In-Reply-To: <20230125-tfp410_i2c-v3-3-a85d5f0f50f1@criticallink.com>
On 20/02/2023 23:10, Jonathan Cormier wrote:
> From: Michael Williamson <michael.williamson@criticallink.com>
>
> If the I2C bus is connected on the TFP410, then use the register
> status bit to determine connection state. This is needed, in particular,
> for polling the state when the Hot Plug detect is not connected to
> a controlling CPU via GPIO/IRQ lane.
>
> Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
> Signed-off-by: Jonathan Cormier <jcormier@criticallink.com>
> ---
> drivers/gpu/drm/bridge/ti-tfp410.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
> index 41007d05d584..eeb7202452aa 100644
> --- a/drivers/gpu/drm/bridge/ti-tfp410.c
> +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
> @@ -28,6 +28,9 @@
> #define TFP410_BIT_BSEL BIT(2)
> #define TFP410_BIT_DSEL BIT(3)
>
> +#define TFP410_REG_CTL_2_MODE 0x09
> +#define TFP410_BIT_HTPLG BIT(1)
> +
> static const struct regmap_config tfp410_regmap_config = {
> .reg_bits = 8,
> .val_bits = 8,
> @@ -105,6 +108,15 @@ static enum drm_connector_status
> tfp410_connector_detect(struct drm_connector *connector, bool force)
> {
> struct tfp410 *dvi = drm_connector_to_tfp410(connector);
> + int ret;
> +
> + if (dvi->i2c) {
> + ret = regmap_test_bits(dvi->regmap, TFP410_REG_CTL_2_MODE, TFP410_BIT_HTPLG);
> + if (ret < 0)
> + dev_err(dvi->dev, "%s failed to read HTPLG bit : %d\n", __func__, ret);
> + else
> + return ret ? connector_status_connected : connector_status_disconnected;
> + }
>
> return drm_bridge_detect(dvi->next_bridge);
> }
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
prev parent reply other threads:[~2023-03-31 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 22:10 [PATCH v3 0/3] drm/bridge: tfp410: Add i2c support Jonathan Cormier
2023-02-20 22:10 ` [PATCH v3 1/3] drm/bridge: tfp410: Support basic I2C interface Jonathan Cormier
2023-03-31 8:59 ` Neil Armstrong
2023-02-20 22:10 ` [PATCH v3 2/3] drm/bridge: tfp410: Fix logic to configured polled HPD Jonathan Cormier
2023-03-31 9:00 ` Neil Armstrong
2023-04-04 13:54 ` Jon Cormier
2023-02-20 22:10 ` [PATCH v3 3/3] drm/bridge: tfp410: If connected, use I2C for polled HPD status Jonathan Cormier
2023-03-31 9:03 ` Neil Armstrong [this message]
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=15047d72-1cc1-5afe-0003-c67d093dc297@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=bduke@criticallink.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jcormier@criticallink.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.williamson@criticallink.com \
--cc=robh+dt@kernel.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).