aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorGraeme Smecher <gsmecher@threespeedlogic.com>2013-09-13 17:41:48 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-09-23 06:57:11 -0400
commite5304db8d7541c1338a6313ae951355b5a72cd19 (patch)
tree0e3fb0e5efe909e605900025d475bdaaeec5a763 /drivers/gpio
parent8fa82b16304b5cdcddb929afbfebfddfb7adb716 (diff)
gpio: pca953x: Don't flip bits on PCA957x GPIO expanders when probing them.
The pca957x driver supports a handful of I2C GPIO expanders from NXP, Maxim, and TI. For the PCA9574 and PCA9575 devices only, the driver resets the GPIO level and direction in the pca957x_probe function. This seems like the wrong thing to do, since it can cause hardware bit twiddles during warm reboots when the chip state and reset values don't match. This kind of initialization is best left upstream (in a bootloader) or downstream (in userspace). It's also an inconsistency across devices supported by this driver. This patch is NOT boot-tested: the SoC I'm using is stuck on 2.6.37, and the patch doesn't apply trivially. Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pca953x.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index cdd1aa12b895..6e48c07e3d8c 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -683,17 +683,6 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
683 int ret; 683 int ret;
684 u8 val[MAX_BANK]; 684 u8 val[MAX_BANK];
685 685
686 /* Let every port in proper state, that could save power */
687 memset(val, 0, NBANK(chip));
688 pca953x_write_regs(chip, PCA957X_PUPD, val);
689 memset(val, 0xFF, NBANK(chip));
690 pca953x_write_regs(chip, PCA957X_CFG, val);
691 memset(val, 0, NBANK(chip));
692 pca953x_write_regs(chip, PCA957X_OUT, val);
693
694 ret = pca953x_read_regs(chip, PCA957X_IN, val);
695 if (ret)
696 goto out;
697 ret = pca953x_read_regs(chip, PCA957X_OUT, chip->reg_output); 686 ret = pca953x_read_regs(chip, PCA957X_OUT, chip->reg_output);
698 if (ret) 687 if (ret)
699 goto out; 688 goto out;