aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-04-30 21:29:50 -0400
committerTom Rini <trini@konsulko.com>2023-04-30 21:29:50 -0400
commit27dc8826441f0c5dd6aa6617a32909d9049f1202 (patch)
tree18a2dcc2249614fe95b52983a5abe5e992d74840 /drivers/gpio
parentfe3a77cb157a6210d8036845f5f80ea67c183563 (diff)
parent25bc7bfc30532098d9207783ff2ca45cdc5a0161 (diff)
downloadu-boot-27dc8826441f0c5dd6aa6617a32909d9049f1202.zip
u-boot-27dc8826441f0c5dd6aa6617a32909d9049f1202.tar.gz
u-boot-27dc8826441f0c5dd6aa6617a32909d9049f1202.tar.bz2
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiWIP/30Apr2023
Please pull the second part of the sunxi pull request for this cycle. Another bunch of patches that replace old-school U-Boot hacks with proper DM based code, this time for the raw NAND flash driver, and the USB PHY VBUS detection code. Plus two smaller patches that were sitting in my inbox for a while. Gitlab CI passed. In lack of some supported board with NAND flash I couldn't really test this part, but apparently this was tested by the reviewer. I briefly ran the branch on some boards with USB-OTG, and this still worked.
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/axp_gpio.c21
-rw-r--r--drivers/gpio/sunxi_gpio.c6
2 files changed, 5 insertions, 22 deletions
diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
index 35585dc..4967219 100644
--- a/drivers/gpio/axp_gpio.c
+++ b/drivers/gpio/axp_gpio.c
@@ -36,18 +36,11 @@ static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
{
u8 reg;
- switch (pin) {
-#ifndef CONFIG_AXP152_POWER /* NA on axp152 */
- case SUNXI_GPIO_AXP0_VBUS_DETECT:
- return 0;
-#endif
- default:
- reg = axp_get_gpio_ctrl_reg(pin);
- if (reg == 0)
- return -EINVAL;
+ reg = axp_get_gpio_ctrl_reg(pin);
+ if (reg == 0)
+ return -EINVAL;
- return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT);
- }
+ return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT);
}
static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
@@ -83,12 +76,6 @@ static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
int ret;
switch (pin) {
-#ifndef CONFIG_AXP152_POWER /* NA on axp152 */
- case SUNXI_GPIO_AXP0_VBUS_DETECT:
- ret = pmic_bus_read(AXP_POWER_STATUS, &val);
- mask = AXP_POWER_STATUS_VBUS_PRESENT;
- break;
-#endif
#ifdef AXP_MISC_CTRL_N_VBUSEN_FUNC
/* Only available on later PMICs */
case SUNXI_GPIO_AXP0_VBUS_ENABLE:
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 1e85db1..f0b42e4 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -117,11 +117,7 @@ int sunxi_name_to_gpio(const char *name)
#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
char lookup[8];
- if (strcasecmp(name, "AXP0-VBUS-DETECT") == 0) {
- sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d",
- SUNXI_GPIO_AXP0_VBUS_DETECT);
- name = lookup;
- } else if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) {
+ if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) {
sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d",
SUNXI_GPIO_AXP0_VBUS_ENABLE);
name = lookup;