linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value
@ 2012-09-26  1:46 Neil Zhang
  2012-09-26  6:44 ` Haojian Zhuang
  2012-09-30  8:30 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Neil Zhang @ 2012-09-26  1:46 UTC (permalink / raw)
  To: grant.likely, linus.walleij, haojian.zhuang; +Cc: linux-kernel, Neil Zhang

We need to return 0 or 1 when get gpio value.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
---
 drivers/gpio/gpio-pxa.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 9cac88a..3c9dc8c 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -269,7 +269,9 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
 
 static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-	return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
+	u32 gplr = readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET);
+
+	return (gplr & (1 << offset)) ? 1 : 0;
 }
 
 static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-- 
1.7.4.1


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

* Re: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value
  2012-09-26  1:46 [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value Neil Zhang
@ 2012-09-26  6:44 ` Haojian Zhuang
  2012-09-27  1:25   ` Neil Zhang
  2012-09-30  8:30 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Haojian Zhuang @ 2012-09-26  6:44 UTC (permalink / raw)
  To: Neil Zhang; +Cc: grant.likely, linus.walleij, linux-kernel

On Wed, Sep 26, 2012 at 9:46 AM, Neil Zhang <zhangwm@marvell.com> wrote:
> We need to return 0 or 1 when get gpio value.
>
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> ---
>  drivers/gpio/gpio-pxa.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index 9cac88a..3c9dc8c 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c
> @@ -269,7 +269,9 @@ static int pxa_gpio_direction_output(struct gpio_chip *chip,
>
>  static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
>  {
> -       return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
> +       u32 gplr = readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET);
> +
> +       return (gplr & (1 << offset)) ? 1 : 0;
>  }
>
>  static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
> --
> 1.7.4.1
>

gpio_get_value() is used to dump bits from GPLR register in mach-pxa directory.
Unless you update those code at the same time, this patch can't be merged.

Regards
Haojian

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

* RE: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value
  2012-09-26  6:44 ` Haojian Zhuang
@ 2012-09-27  1:25   ` Neil Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Neil Zhang @ 2012-09-27  1:25 UTC (permalink / raw)
  To: Haojian Zhuang; +Cc: grant.likely, linus.walleij, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1682 bytes --]


> -----Original Message-----
> From: Haojian Zhuang [mailto:haojian.zhuang@gmail.com]
> Sent: 2012Äê9ÔÂ26ÈÕ 14:44
> To: Neil Zhang
> Cc: grant.likely@secretlab.ca; linus.walleij@linaro.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value
> 
> On Wed, Sep 26, 2012 at 9:46 AM, Neil Zhang <zhangwm@marvell.com> wrote:
> > We need to return 0 or 1 when get gpio value.
> >
> > Signed-off-by: Neil Zhang <zhangwm@marvell.com>
> > ---
> >  drivers/gpio/gpio-pxa.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> > index 9cac88a..3c9dc8c 100644
> > --- a/drivers/gpio/gpio-pxa.c
> > +++ b/drivers/gpio/gpio-pxa.c
> > @@ -269,7 +269,9 @@ static int pxa_gpio_direction_output(struct gpio_chip
> *chip,
> >
> >  static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
> >  {
> > -       return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 <<
> offset);
> > +       u32 gplr = readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET);
> > +
> > +       return (gplr & (1 << offset)) ? 1 : 0;
> >  }
> >
> >  static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int
> value)
> > --
> > 1.7.4.1
> >
> 
> gpio_get_value() is used to dump bits from GPLR register in mach-pxa
> directory.
> Unless you update those code at the same time, this patch can't be merged.
> 
It's a big change, I will do it when I have time.

> Regards
> Haojian

Best Regards,
Neil Zhang
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value
  2012-09-26  1:46 [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value Neil Zhang
  2012-09-26  6:44 ` Haojian Zhuang
@ 2012-09-30  8:30 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-09-30  8:30 UTC (permalink / raw)
  To: Neil Zhang; +Cc: grant.likely, haojian.zhuang, linux-kernel

On Wed, Sep 26, 2012 at 3:46 AM, Neil Zhang <zhangwm@marvell.com> wrote:

> We need to return 0 or 1 when get gpio value.
>
> Signed-off-by: Neil Zhang <zhangwm@marvell.com>

Aha there is another patch fixing that comment I had, sorry, going through
the mail backlog.

But you need to take Haojian's comments into account so I'm not applying
it right now.

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-09-30  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-26  1:46 [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value Neil Zhang
2012-09-26  6:44 ` Haojian Zhuang
2012-09-27  1:25   ` Neil Zhang
2012-09-30  8:30 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).