* [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
* Re: [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine
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-27 5:49 ` [PATCH Resend] " Viresh Kumar
1 sibling, 1 reply; 4+ messages in thread
From: Rabin Vincent @ 2012-02-24 14:15 UTC (permalink / raw)
To: Viresh Kumar
Cc: grant.likely, linus.walleij, linux-kernel, armando.visconti,
shiraz.hashim, vipin.kumar, rajeev-dlh.kumar, deepak.sikri,
vipulkumar.samar, amit.virdi, pratyush.anand, bhupesh.sharma,
viresh.linux, bhavna.yadav, vincenzo.frascino, mirko.gardi,
salvatore.dedominicis
On Fri, Feb 24, 2012 at 16:04, Viresh Kumar <viresh.kumar@st.com> wrote:
> 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.
The current implementation just returns (ret & mask) where mask
would have only BIT6 set, so how can it return "BIT6 to BIT0" ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio/gpio-stmpe: Fix the value returned by _get_value routine
[not found] ` <CAOh2x=kDxqddm8EdRKp0+38Efs2QX33TtofLgLxe6auex0YZWQ@mail.gmail.com>
@ 2012-02-24 14:42 ` Rabin Vincent
0 siblings, 0 replies; 4+ messages in thread
From: Rabin Vincent @ 2012-02-24 14:42 UTC (permalink / raw)
To: viresh kumar
Cc: salvatore.dedominicis, bhavna.yadav, rajeev-dlh.kumar,
Viresh Kumar, pratyush.anand, shiraz.hashim, grant.likely,
deepak.sikri, mirko.gardi, vipulkumar.samar, linus.walleij,
armando.visconti, amit.virdi, vincenzo.frascino, vipin.kumar,
linux-kernel, bhupesh.sharma
On Fri, Feb 24, 2012 at 19:59, viresh kumar <viresh.linux@gmail.com> wrote:
> On Feb 24, 2012 7:46 PM, "Rabin Vincent" <rabin@rab.in> wrote:
>> On Fri, Feb 24, 2012 at 16:04, Viresh Kumar <viresh.kumar@st.com> wrote:
>> > 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.
>>
>> The current implementation just returns (ret & mask) where mask
>> would have only BIT6 set, so how can it return "BIT6 to BIT0" ?
>
> Oops! I gave same comment when i saw this patch
> on our internal list and i forgot to fix log while applying.
>
> It actually returns 0b1000000 for example. And we need 1 here.
According to the documentation, gpio_get_value() (i.e. this function)
can return zero or non-zero, not necessarily zero or one.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH Resend] gpio/gpio-stmpe: Fix the value returned by _get_value routine
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
@ 2012-02-27 5:49 ` Viresh Kumar
1 sibling, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2012-02-27 5:49 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
(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>
---
Changes in Resend: Commit log fixed
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®