GPIO: gpio-pxa: fix bug when get gpio value
Subsystems (2)
PATCH v2 1/1 GPIO: gpio-pxa: fix bug when get gpio value
We need to return 0 or 1 when get gpio value.
--- drivers/gpio/gpio-pxa.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/gpio/gpio-pxa.c +3 -1
@@ -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)
Signature · 1 line
1.7.4.1
Quoted 23 lines · Neil Zhang
We need to return 0 or 1 when get gpio value.
Signed-off-by Neil Zhang <[email protected]>--- drivers/gpio/gpio-pxa.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/gpio/gpio-pxa.c +3
-2@@ -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) --
Quoted 2 lines
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
Quoted 34 lines
-----Original Message-----
From: Haojian Zhuang [mailto:[email protected]]
Sent: 2012年9月26日 14:44
To: Neil Zhang
Cc: [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH V2] GPIO: gpio-pxa: fix bug when get gpio valuedrivers/gpio/gpio-pxa.c static int pxa_gpio_direction_output(struct gpio_chip
Quoted 12 lines · Neil Zhang
We need to return 0 or 1 when get gpio value.
Signed-off-by Neil Zhang <[email protected]>--- drivers/gpio/gpio-pxa.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/gpio/gpio-pxa.c +0
-0@@ -269,7 +269,9 @@ static int pxa_gpio_direction_output(struct gpio_chip*chip,
drivers/gpio/gpio-pxa.c static int pxa_gpio_direction_output(struct gpio_chip *chip,
Quoted 4 lines
drivers/gpio/gpio-pxa.c +0
-1static int pxa_gpio_get (struct gpio_chip *chip,unsigned offset) { - return readl_relaxed(gpio_chip_base(chip) + GPLR_OFFSET) & (1 <<offset);
drivers/gpio/gpio-pxa.c static int pxa_gpio_direction_output(struct gpio_chip *chip,
Quoted 6 lines
drivers/gpio/gpio-pxa.c +3
-0+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
Quoted 9 lines
value)
Quoted 3 lines
drivers/gpio/gpio-pxa.c +0
-1--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.
Quoted 2 lines
Regards
Haojian
Best Regards,
Neil Zhang �翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m����鹅�⒏?朓�
Quoted 3 lines · Neil Zhang
We need to return 0 or 1 when get gpio value.
Signed-off-by Neil Zhang <[email protected]>
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