mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-06 23:36:59 +02:00
gpio: msm_gpio: return correct value for gpio read
In the current implementation, the GPIO read operation considers both the input and outbut bits (bits 0 and 1). It should only consider the state of input bit, i.e bit 0. To address this, mask input bit alone and read it. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250508113646.1462518-1-aswin.murugan@oss.qualcomm.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
This commit is contained in:
parent
35811a7b0d
commit
ddc527ac43
@ -202,7 +202,7 @@ static int msm_gpio_get_value(struct udevice *dev, unsigned int gpio)
|
||||
if (qcom_is_special_pin(priv->pin_data, gpio))
|
||||
return msm_gpio_get_value_special(priv, gpio);
|
||||
|
||||
return !!(readl(priv->base + GPIO_IN_OUT_REG(dev, gpio)) >> GPIO_IN);
|
||||
return !!(readl(priv->base + GPIO_IN_OUT_REG(dev, gpio)) & BIT(GPIO_IN));
|
||||
}
|
||||
|
||||
static int msm_gpio_get_function_special(struct msm_gpio_bank *priv,
|
||||
|
Loading…
Reference in New Issue
Block a user