]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: axp/sunxi: Remove virtual VBUS detection GPIO
authorSamuel Holland <samuel@sholland.org>
Sun, 22 Jan 2023 23:46:22 +0000 (17:46 -0600)
committerAndre Przywara <andre.przywara@arm.com>
Fri, 28 Apr 2023 00:30:24 +0000 (01:30 +0100)
Now that this functionality is modeled using the device tree and
regulator uclass, the named GPIO is not referenced anywhere. Remove it.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/include/asm/arch-sunxi/gpio.h
drivers/gpio/axp_gpio.c
drivers/gpio/sunxi_gpio.c
include/axp209.h
include/axp221.h
include/axp809.h
include/axp818.h

index 437e86479ced6f17b02e3bec6ba108b2ec63390c..6eaeece4e24bc52f03532240cf4f795b5580e658 100644 (file)
@@ -209,7 +209,6 @@ enum sunxi_gpio_number {
 
 /* Virtual AXP0 GPIOs */
 #define SUNXI_GPIO_AXP0_PREFIX "AXP0-"
-#define SUNXI_GPIO_AXP0_VBUS_DETECT    4
 #define SUNXI_GPIO_AXP0_VBUS_ENABLE    5
 #define SUNXI_GPIO_AXP0_GPIO_COUNT     6
 
index 35585dc8ac9b55157b139ef493ec9a56e752b7be..49672193ffcdd0b2eee73c9a490418ddb7d4c9f9 100644 (file)
@@ -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:
index 1e85db179a65cd483e290f00c07d5d8b3e6563bb..f0b42e4fdb7dd010eb48c49227472cf8e059d8d7 100644 (file)
@@ -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;
index 414f88a32c656707642019754f5184d7a37a7e58..d8bf44f1fa60ce9e892a8cb3e6586ef4de5a9262 100644 (file)
@@ -77,7 +77,6 @@ enum axp209_reg {
 #ifdef CONFIG_AXP209_POWER
 #define AXP_POWER_STATUS               0x00
 #define AXP_POWER_STATUS_ALDO_IN               BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT          BIT(5)
 #define AXP_GPIO0_CTRL                 0x90
 #define AXP_GPIO1_CTRL                 0x92
 #define AXP_GPIO2_CTRL                 0x93
index 8dfcc5b5a2314d74524d426774f6c3eb51264a8f..32b988f3a9cd775ee265543c2b4cd30b70a553b9 100644 (file)
@@ -53,7 +53,6 @@
 #ifdef CONFIG_AXP221_POWER
 #define AXP_POWER_STATUS               0x00
 #define AXP_POWER_STATUS_ALDO_IN               BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT          BIT(5)
 #define AXP_VBUS_IPSOUT                        0x30
 #define AXP_VBUS_IPSOUT_DRIVEBUS               (1 << 2)
 #define AXP_MISC_CTRL                  0x8f
index 8082e402e2ab2348aad0a46ec13e771068f49923..71a7cb2aaa12559fdb75247cbade192eecd25568 100644 (file)
@@ -47,7 +47,6 @@
 #ifdef CONFIG_AXP809_POWER
 #define AXP_POWER_STATUS               0x00
 #define AXP_POWER_STATUS_ALDO_IN               BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT          BIT(5)
 #define AXP_VBUS_IPSOUT                        0x30
 #define AXP_VBUS_IPSOUT_DRIVEBUS               (1 << 2)
 #define AXP_MISC_CTRL                  0x8f
index 8ac517a2bf29358016a014e12e92a8a121813b89..08ac35d15fa7a42b89428e87ae5b7540123c7a89 100644 (file)
@@ -61,7 +61,6 @@
 #ifdef CONFIG_AXP818_POWER
 #define AXP_POWER_STATUS               0x00
 #define AXP_POWER_STATUS_ALDO_IN               BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT          BIT(5)
 #define AXP_VBUS_IPSOUT                        0x30
 #define AXP_VBUS_IPSOUT_DRIVEBUS               (1 << 2)
 #define AXP_MISC_CTRL                  0x8f