diff options
author | Venkat Reddy Talla <vreddytalla@nvidia.com> | 2016-06-27 06:56:24 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-07-04 05:39:38 -0400 |
commit | 1941b4419a24e026ce8354a2fd40c9387577697e (patch) | |
tree | b7d12a264b45529a1530decd57a9b19734c27d41 /drivers/gpio/gpio-max77620.c | |
parent | 7eebe96f22e7968656a64458620f5cdabee8903c (diff) |
gpio: max77620: get gpio value based on direction
Gpio direction is determined by DIRx bit of GPIO
configuration register, return max77620 gpio value
based on direction in or out.
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-max77620.c')
-rw-r--r-- | drivers/gpio/gpio-max77620.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c index 8658c32c4690..b46b436cb97f 100644 --- a/drivers/gpio/gpio-max77620.c +++ b/drivers/gpio/gpio-max77620.c | |||
@@ -123,7 +123,10 @@ static int max77620_gpio_get(struct gpio_chip *gc, unsigned int offset) | |||
123 | return ret; | 123 | return ret; |
124 | } | 124 | } |
125 | 125 | ||
126 | return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK); | 126 | if (val & MAX77620_CNFG_GPIO_DIR_MASK) |
127 | return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK); | ||
128 | else | ||
129 | return !!(val & MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK); | ||
127 | } | 130 | } |
128 | 131 | ||
129 | static int max77620_gpio_dir_output(struct gpio_chip *gc, unsigned int offset, | 132 | static int max77620_gpio_dir_output(struct gpio_chip *gc, unsigned int offset, |