mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@st.com>
To: <grant.likely@secretlab.ca>, <linus.walleij@stericsson.com>,
	<rabin@rab.in>
Cc: <linux-kernel@vger.kernel.org>, <armando.visconti@st.com>,
	<shiraz.hashim@st.com>, <vipin.kumar@st.com>,
	<rajeev-dlh.kumar@st.com>, <deepak.sikri@st.com>,
	<vipulkumar.samar@st.com>, <amit.virdi@st.com>,
	<viresh.kumar@st.com>, <pratyush.anand@st.com>,
	<bhupesh.sharma@st.com>, <viresh.linux@gmail.com>,
	<bhavna.yadav@st.com>, <vincenzo.frascino@st.com>,
	<mirko.gardi@st.com>, <salvatore.dedominicis@st.com>
Subject: [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine
Date: Fri, 24 Feb 2012 16:04:39 +0530	[thread overview]
Message-ID: <2f2b55523b707d514a15d822ff812cfae654510a.1330079584.git.viresh.kumar@st.com> (raw)

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


             reply	other threads:[~2012-02-24 10:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 10:34 Viresh Kumar [this message]
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

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=2f2b55523b707d514a15d822ff812cfae654510a.1330079584.git.viresh.kumar@st.com \
    --to=viresh.kumar@st.com \
    --cc=amit.virdi@st.com \
    --cc=armando.visconti@st.com \
    --cc=bhavna.yadav@st.com \
    --cc=bhupesh.sharma@st.com \
    --cc=deepak.sikri@st.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirko.gardi@st.com \
    --cc=pratyush.anand@st.com \
    --cc=rabin@rab.in \
    --cc=rajeev-dlh.kumar@st.com \
    --cc=salvatore.dedominicis@st.com \
    --cc=shiraz.hashim@st.com \
    --cc=vincenzo.frascino@st.com \
    --cc=vipin.kumar@st.com \
    --cc=vipulkumar.samar@st.com \
    --cc=viresh.linux@gmail.com \
    /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

all inboxes | Powered by JetHome®