lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15047d72-1cc1-5afe-0003-c67d093dc297@linaro.org>
Date:   Fri, 31 Mar 2023 11:03:17 +0200
From:   Neil Armstrong <neil.armstrong@...aro.org>
To:     Jonathan Cormier <jcormier@...ticallink.com>,
        Andrzej Hajda <andrzej.hajda@...el.com>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Jonas Karlman <jonas@...boo.se>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc:     dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Michael Williamson <michael.williamson@...ticallink.com>,
        Bob Duke <bduke@...ticallink.com>
Subject: Re: [PATCH v3 3/3] drm/bridge: tfp410: If connected, use I2C for
 polled HPD status.

On 20/02/2023 23:10, Jonathan Cormier wrote:
> From: Michael Williamson <michael.williamson@...ticallink.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@...ticallink.com>
> Signed-off-by: Jonathan Cormier <jcormier@...ticallink.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@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ