RE: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio value

From: Neil Zhang
Date: Wed Sep 26 2012 - 21:25:23 EST



> -----Original Message-----
> From: Haojian Zhuang [mailto:haojian.zhuang@xxxxxxxxx]
> Sent: 2012年9月26日 14:44
> To: Neil Zhang
> Cc: grant.likely@xxxxxxxxxxxx; linus.walleij@xxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> 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@xxxxxxxxxxx> wrote:
> > We need to return 0 or 1 when get gpio value.
> >
> > Signed-off-by: Neil Zhang <zhangwm@xxxxxxxxxxx>
> > ---
> > 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?叉??y??b??千v??藓{.n???{?赙zXФ?塄}?财??j:+v???赙zZ+€?zf"?????i????ア??璀??撷f?^j谦y??@A?囤?0鹅h??i