mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine
@ 2012-02-24 10:34 Viresh Kumar
  2012-02-24 14:15 ` Rabin Vincent
  2012-02-27  5:49 ` [PATCH Resend] " Viresh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2012-02-24 10:34 UTC (permalink / raw)
  To: grant.likely, linus.walleij, rabin
  Cc: linux-kernel, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi,
	salvatore.dedominicis

From: Bhupesh Sharma <bhupesh.sharma@st.com>

The present _get_value routine returns the contents of the GPIO
Monitor Pin Status Register(GPMR) starting from the bit whose value
is requested to BIT 0.

For e.g. if we request the value of GPIO 6 in the earlier
implementation the value returned is:

	BIT6 to BIT0

whereas it should just return BIT6.

This patch addresses the same.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com>
Reviewed-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/gpio/gpio-stmpe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 094c5c4..dce3472 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -54,7 +54,7 @@ static int stmpe_gpio_get(struct gpio_chip *chip, unsigned offset)
 	if (ret < 0)
 		return ret;
 
-	return ret & mask;
+	return !!(ret & mask);
 }
 
 static void stmpe_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
-- 
1.7.8.110.g4cb5d


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-27  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 10:34 [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine Viresh Kumar
2012-02-24 14:15 ` Rabin Vincent
     [not found]   ` <CAOh2x=kDxqddm8EdRKp0+38Efs2QX33TtofLgLxe6auex0YZWQ@mail.gmail.com>
2012-02-24 14:42     ` Rabin Vincent
2012-02-27  5:49 ` [PATCH Resend] " Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®