diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-12-16 15:53:52 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-12-16 15:53:52 +0100 |
commit | d09476018bee39495d6ece7a2e069de29a9c0ed5 (patch) | |
tree | 866fff4323f94681e6b423f269f0549df0a34066 /drivers/gpio/gpio-mpc8xxx.c | |
parent | 337bb336b95bd7884fa3a194eafbdf52a0216b2e (diff) | |
parent | afdcd431cebe3498db9aa963c780fdd5099917ec (diff) | |
download | op-kernel-dev-d09476018bee39495d6ece7a2e069de29a9c0ed5.zip op-kernel-dev-d09476018bee39495d6ece7a2e069de29a9c0ed5.tar.gz |
Merge branch 'for-linus' into for-next
Diffstat (limited to 'drivers/gpio/gpio-mpc8xxx.c')
-rw-r--r-- | drivers/gpio/gpio-mpc8xxx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 914e859..d7d6d72 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -70,10 +70,14 @@ static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio) u32 val; struct of_mm_gpio_chip *mm = to_of_mm_gpio_chip(gc); struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm); + u32 out_mask, out_shadow; - val = in_be32(mm->regs + GPIO_DAT) & ~in_be32(mm->regs + GPIO_DIR); + out_mask = in_be32(mm->regs + GPIO_DIR); - return (val | mpc8xxx_gc->data) & mpc8xxx_gpio2mask(gpio); + val = in_be32(mm->regs + GPIO_DAT) & ~out_mask; + out_shadow = mpc8xxx_gc->data & out_mask; + + return (val | out_shadow) & mpc8xxx_gpio2mask(gpio); } static int mpc8xxx_gpio_get(struct gpio_chip *gc, unsigned int gpio) |