diff options
Diffstat (limited to 'drivers/power/axp221.c')
-rw-r--r-- | drivers/power/axp221.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c index d49de86e97..7bbaec87e4 100644 --- a/drivers/power/axp221.c +++ b/drivers/power/axp221.c @@ -319,67 +319,3 @@ int axp221_get_sid(unsigned int *sid) return 0; } - -int axp_gpio_direction_input(struct udevice *dev, unsigned pin) -{ - switch (pin) { - case SUNXI_GPIO_AXP0_VBUS_DETECT: - return 0; - default: - return -EINVAL; - } -} - -int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val) -{ - int ret; - - switch (pin) { - case SUNXI_GPIO_AXP0_VBUS_ENABLE: - ret = axp221_clrbits(AXP221_MISC_CTRL, - AXP221_MISC_CTRL_N_VBUSEN_FUNC); - if (ret) - return ret; - - return axp_gpio_set_value(dev, pin, val); - default: - return -EINVAL; - } -} - -int axp_gpio_get_value(struct udevice *dev, unsigned pin) -{ - int ret; - u8 val; - - switch (pin) { - case SUNXI_GPIO_AXP0_VBUS_DETECT: - ret = pmic_bus_read(AXP221_POWER_STATUS, &val); - if (ret) - return ret; - - return !!(val & AXP221_POWER_STATUS_VBUS_AVAIL); - default: - return -EINVAL; - } -} - -int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val) -{ - int ret; - - switch (pin) { - case SUNXI_GPIO_AXP0_VBUS_ENABLE: - if (val) - ret = axp221_setbits(AXP221_VBUS_IPSOUT, - AXP221_VBUS_IPSOUT_DRIVEBUS); - else - ret = axp221_clrbits(AXP221_VBUS_IPSOUT, - AXP221_VBUS_IPSOUT_DRIVEBUS); - - if (ret) - return ret; - } - - return 0; -} |