Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-21 Thread Liu Gang
On Wed, 2013-11-20 at 18:32 -0600, Scott Wood wrote: > For userspace value setting, it looks like gpiolib blocks the write if > the pin if FLAG_IS_OUT is set. This suggests that this is an error > condition for other uses as well. Though, I notice that > mpc8xxx_gpio_dir_out() calls gpio_set() be

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-20 Thread Scott Wood
On Wed, 2013-11-20 at 10:54 +0800, Liu Gang wrote: > On Tue, 2013-11-19 at 16:51 -0600, Scott Wood wrote: > > > @@ -71,6 +71,7 @@ static int mpc8572_gpio_get(struct gpio_chip *gc, > > > unsigned int gpio) > > > struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm); > > > > > > val

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-19 Thread Liu Gang
On Tue, 2013-11-19 at 16:51 -0600, Scott Wood wrote: > > @@ -71,6 +71,7 @@ static int mpc8572_gpio_get(struct gpio_chip *gc, > > unsigned int gpio) > > struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm); > > > > val = in_be32(mm->regs + GPIO_DAT) & ~in_be32(mm->regs + GPIO_D

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-19 Thread Liu Gang
On Tue, 2013-11-19 at 16:32 +0100, Anatolij Gustschin wrote: > On Fri, 15 Nov 2013 15:16:29 +0800 > Liu Gang wrote: > > > For MPC8572/MPC8536, the status of GPIOs defined as output > > cannot be determined by reading GPDAT register, so the code > > use shadow data register instead. But if the inp

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-19 Thread Scott Wood
On Fri, 2013-11-15 at 15:16 +0800, Liu Gang wrote: > For MPC8572/MPC8536, the status of GPIOs defined as output > cannot be determined by reading GPDAT register, so the code > use shadow data register instead. But if the input pins are > asserted high, they will always read high due to the shadow >

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-19 Thread Anatolij Gustschin
On Fri, 15 Nov 2013 15:16:29 +0800 Liu Gang wrote: > For MPC8572/MPC8536, the status of GPIOs defined as output > cannot be determined by reading GPDAT register, so the code > use shadow data register instead. But if the input pins are > asserted high, they will always read high due to the shadow

Re: [PATCH] powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536

2013-11-19 Thread Linus Walleij
On Fri, Nov 15, 2013 at 8:16 AM, Liu Gang wrote: > For MPC8572/MPC8536, the status of GPIOs defined as output > cannot be determined by reading GPDAT register, so the code > use shadow data register instead. But if the input pins are > asserted high, they will always read high due to the shadow >