summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:44:08 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:35 -0700
commit7d0c2c3feb2edeff73654fb851de2580966e24c5 (patch)
treee00116272b710de5f57f52767d0a3a7992477855 /drivers/gpio
parent78a10b66566f313a2933ee5169494d44a1442578 (diff)
rockchip: gpio: Read the GPIO value correctly
This function should return 0 or 1, not a mask. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/rk_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index fbdf9f3fd9..a22e2195e4 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -53,7 +53,7 @@ static int rockchip_gpio_get_value(struct udevice *dev, unsigned offset)
struct rockchip_gpio_priv *priv = dev_get_priv(dev);
struct rockchip_gpio_regs *regs = priv->regs;
- return readl(&regs->ext_port) & OFFSET_TO_BIT(offset);
+ return readl(&regs->ext_port) & OFFSET_TO_BIT(offset) ? 1 : 0;
}
static int rockchip_gpio_set_value(struct udevice *dev, unsigned offset,