mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-13 12:26:01 +01:00
gpio: axp: Report the correct value for outputs
Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
parent
20575f5984
commit
cfb7b08923
@ -33,6 +33,15 @@ static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
|
||||
const struct axp_gpio_desc *desc = dev_get_priv(dev);
|
||||
int ret;
|
||||
|
||||
ret = pmic_reg_read(dev->parent, desc->pins[pin]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ret == AXP_GPIO_CTRL_OUTPUT_LOW)
|
||||
return 0;
|
||||
if (ret == AXP_GPIO_CTRL_OUTPUT_HIGH)
|
||||
return 1;
|
||||
|
||||
ret = pmic_reg_read(dev->parent, desc->status_reg);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user