diff options
author | Bhupesh Sharma <bhupesh.sharma@st.com> | 2012-02-27 00:49:43 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-03-12 13:36:38 -0400 |
commit | 7535b8bef067b71070ed5bdcf3606402f1e99618 (patch) | |
tree | bb4c57bbbe2c143a98d9d1f9690df8dc2ed97356 /drivers/gpio/gpio-stmpe.c | |
parent | 0dc665d426691fd75fe9b6b16295ad0c02677d21 (diff) |
gpio/gpio-stmpe: Fix the value returned by _get_value routine
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
(irrelevant bits are replace by 0).
For e.g. if we request the value of GPIO 6 in the earlier implementation the
value returned is:
BIT6 followed by 6 0's
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>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio/gpio-stmpe.c')
-rw-r--r-- | 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 87a68a896abf..8abf4e9e2300 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) | |||
54 | if (ret < 0) | 54 | if (ret < 0) |
55 | return ret; | 55 | return ret; |
56 | 56 | ||
57 | return ret & mask; | 57 | return !!(ret & mask); |
58 | } | 58 | } |
59 | 59 | ||
60 | static void stmpe_gpio_set(struct gpio_chip *chip, unsigned offset, int val) | 60 | static void stmpe_gpio_set(struct gpio_chip *chip, unsigned offset, int val) |