diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2014-03-27 09:02:08 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-03-28 16:52:35 -0400 |
commit | 8650ea1ebc31e9b0ab17c31d844dc106e60269db (patch) | |
tree | a344b34557258337eb513fb8d53e6c8e1fca31c6 /drivers/gpio | |
parent | c3626fdea044cc97bfc035ebb048f7619acb6736 (diff) |
gpio-lynxpoint: force gpio_get() to return "1" and "0" only
Don't return the IN_LVL_BIT directly, a high gpio line returned
value "1073741824" intestead of "1" because IN_LVL_BIT is BIT(30)
Tested-by: Jerome Blin <jerome.blin@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-lynxpoint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c index 41f79cb24a9e..9a82a9074a2c 100644 --- a/drivers/gpio/gpio-lynxpoint.c +++ b/drivers/gpio/gpio-lynxpoint.c | |||
@@ -188,7 +188,7 @@ static int lp_irq_type(struct irq_data *d, unsigned type) | |||
188 | static int lp_gpio_get(struct gpio_chip *chip, unsigned offset) | 188 | static int lp_gpio_get(struct gpio_chip *chip, unsigned offset) |
189 | { | 189 | { |
190 | unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); | 190 | unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); |
191 | return inl(reg) & IN_LVL_BIT; | 191 | return !!(inl(reg) & IN_LVL_BIT); |
192 | } | 192 | } |
193 | 193 | ||
194 | static void lp_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 194 | static void lp_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |