mirror of
https://xff.cz/git/u-boot/
synced 2025-09-03 17:52:07 +02:00
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>
This commit is contained in:
@@ -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(®s->ext_port) & OFFSET_TO_BIT(offset);
|
||||
return readl(®s->ext_port) & OFFSET_TO_BIT(offset) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int rockchip_gpio_set_value(struct udevice *dev, unsigned offset,
|
||||
|
Reference in New Issue
Block a user