From: Sumit Garg <sumit.garg@kernel.org>
To: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Cc: casey.connolly@linaro.org, neil.armstrong@linaro.org,
trini@konsulko.com, u-boot-qcom@groups.io, u-boot@lists.denx.de
Subject: Re: [PATCH v1 1/1] gpio: msm_gpio: return correct value for gpio read
Date: Mon, 12 May 2025 12:59:16 +0530 [thread overview]
Message-ID: <aCGjTLuK0_dz9P9E@sumit-X1> (raw)
In-Reply-To: <20250508113646.1462518-1-aswin.murugan@oss.qualcomm.com>
On Thu, May 08, 2025 at 05:06:46PM +0530, Aswin Murugan wrote:
> 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>
> ---
> drivers/gpio/msm_gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
-Sumit
>
> diff --git a/drivers/gpio/msm_gpio.c b/drivers/gpio/msm_gpio.c
> index 6783fc756f4..7de332c66ae 100644
> --- a/drivers/gpio/msm_gpio.c
> +++ b/drivers/gpio/msm_gpio.c
> @@ -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,
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-05-12 7:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 11:36 [PATCH v1 1/1] gpio: msm_gpio: return correct value for gpio read Aswin Murugan
2025-05-08 15:49 ` neil.armstrong
2025-05-09 10:42 ` Casey Connolly
2025-05-12 7:29 ` Sumit Garg [this message]
2025-06-23 23:49 ` Casey Connolly
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=aCGjTLuK0_dz9P9E@sumit-X1 \
--to=sumit.garg@kernel.org \
--cc=aswin.murugan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=neil.armstrong@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
/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