]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio: axp209: use correct register for GPIO input status
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Wed, 23 Nov 2016 14:11:50 +0000 (15:11 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Nov 2016 15:19:02 +0000 (16:19 +0100)
The GPIO input status was read from control register
(AXP20X_GPIO[210]_CTRL) instead of status register (AXP20X_GPIO20_SS).

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-axp209.c

index d9c2a517c6df75f0b26f8be0d8706b67ef7c62aa..4a346b7b4172ad70898ecfd3c49f3f7f086d87e6 100644 (file)
@@ -64,13 +64,9 @@ static int axp20x_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
        struct axp20x_gpio *gpio = gpiochip_get_data(chip);
        unsigned int val;
-       int reg, ret;
-
-       reg = axp20x_gpio_get_reg(offset);
-       if (reg < 0)
-               return reg;
+       int ret;
 
-       ret = regmap_read(gpio->regmap, reg, &val);
+       ret = regmap_read(gpio->regmap, AXP20X_GPIO20_SS, &val);
        if (ret)
                return ret;