Re: [PATCH 1/3] gpio: tps65219: Fix GPIO input value reads
From: Jon Cormier
Date: Mon Sep 21 2026 - 11:33:36 EST
On Sat, Sep 19, 2026 at 1:11 PM Karl Mehltretter <kmehltretter@xxxxxxxxx> wrote:
>
> TPS65219_MFP_GPIO_STATUS_MASK is already BIT(4). Passing it to BIT()
> again tests bit 16, which cannot be set in the 8-bit MFP_CTRL register,
> so GPIO0 is always reported low when configured as an input.
>
> Test the register value with the mask directly.
>
> Fixes: 57e30e00bd5b ("gpio: tps65219: add GPIO support for TPS65219 PMIC")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
> ---
> Testing:
>
> - A temporary KUnit test instantiated the driver with a RAM-backed
> regmap under x86_64 QEMU 10.2.1. The TPS65219 input-high test
> failed on the base commit and passes with this series.
> - This has not been tested on real hardware; testing on affected
> hardware is welcome.
>
> drivers/gpio/gpio-tps65219.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-tps65219.c b/drivers/gpio/gpio-tps65219.c
> index 457fd8a589e89..b25c6f7277680 100644
> --- a/drivers/gpio/gpio-tps65219.c
> +++ b/drivers/gpio/gpio-tps65219.c
> @@ -79,7 +79,7 @@ static int tps65219_gpio_get(struct gpio_chip *gc, unsigned int offset)
> if (ret)
> return ret;
>
> - ret = !!(val & BIT(TPS65219_MFP_GPIO_STATUS_MASK));
> + ret = !!(val & TPS65219_MFP_GPIO_STATUS_MASK);
> dev_warn(dev, "GPIO%d = %d, MULTI_DEVICE_ENABLE, not a standard GPIO\n", offset, ret);
>
> /*
> --
> 2.53.0
Makes sense to me, our hardware has this pin connected as an input so
I must not have tested this case.
Reviewed-by: Jonathan Cormier <jcormier@xxxxxxxxxxxxxxxx>
--
Jonathan Cormier
Senior Software Engineer
Office: 315.425.4045 x222
http://www.CriticalLink.com
6712 Brooklawn Parkway, Syracuse, NY 13211