* [PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model
@ 2023-01-22 23:46 Samuel Holland
2023-01-22 23:46 ` [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply Samuel Holland
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Samuel Holland @ 2023-01-22 23:46 UTC (permalink / raw)
To: Andre Przywara, Jagan Teki, Jaehoon Chung; +Cc: u-boot, Samuel Holland
This is the next step, after basic regulator support[1], of converting
the X-Powers AXPxxx PMIC to use the driver model. This series creates a
regulator driver to represent the VBUS detection function, which is used
by the sun4i USB PHY driver. The USB PHY driver has already been updated
to use this regulator device when present[2]. The net result is removing
some ugly hacks from a couple of GPIO drivers.
[1]: https://lore.kernel.org/u-boot/20230121231307.42628-1-samuel@sholland.org/
[2]: commit 6fa41cdd19b9 ("phy: sun4i-usb: Support VBUS detection via power supply")
Samuel Holland (3):
power: regulator: Add a driver for the AXP USB power supply
sunxi: Switch to PMIC USB power supply VBUS detection
gpio: axp/sunxi: Remove virtual VBUS detection GPIO
arch/arm/include/asm/arch-sunxi/gpio.h | 1 -
configs/A33-OLinuXino_defconfig | 2 +-
configs/Ainol_AW1_defconfig | 2 +-
configs/Cubieboard4_defconfig | 3 +-
configs/Cubietruck_plus_defconfig | 2 +-
configs/MSI_Primo81_defconfig | 2 +-
configs/Merrii_A80_Optimus_defconfig | 3 +-
.../Nintendo_NES_Classic_Edition_defconfig | 2 +-
configs/Sinovoip_BPI_M3_defconfig | 2 +-
configs/Wexler_TAB7200_defconfig | 2 +-
configs/Yones_Toptech_BD1078_defconfig | 2 +-
configs/Yones_Toptech_BS1078_V2_defconfig | 2 +-
configs/colorfly_e708_q1_defconfig | 2 +-
configs/ga10h_v1_1_defconfig | 2 +-
configs/gt90h_v4_defconfig | 2 +-
configs/iNet_D978_rev2_defconfig | 2 +-
configs/inet86dz_defconfig | 2 +-
configs/inet_q972_defconfig | 2 +-
configs/polaroid_mid2407pxe03_defconfig | 2 +-
configs/polaroid_mid2809pxe04_defconfig | 2 +-
configs/q8_a23_tablet_800x480_defconfig | 2 +-
configs/q8_a33_tablet_1024x600_defconfig | 2 +-
configs/q8_a33_tablet_800x480_defconfig | 2 +-
configs/tbs_a711_defconfig | 2 +-
drivers/gpio/axp_gpio.c | 21 ++------
drivers/gpio/sunxi_gpio.c | 6 +--
drivers/power/regulator/Kconfig | 7 +++
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/axp_usb_power.c | 49 +++++++++++++++++++
include/axp209.h | 1 -
include/axp221.h | 1 -
include/axp809.h | 1 -
include/axp818.h | 1 -
33 files changed, 87 insertions(+), 50 deletions(-)
create mode 100644 drivers/power/regulator/axp_usb_power.c
--
2.37.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply
2023-01-22 23:46 [PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model Samuel Holland
@ 2023-01-22 23:46 ` Samuel Holland
2023-04-28 0:15 ` Andre Przywara
2023-01-22 23:46 ` [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection Samuel Holland
2023-01-22 23:46 ` [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO Samuel Holland
2 siblings, 1 reply; 7+ messages in thread
From: Samuel Holland @ 2023-01-22 23:46 UTC (permalink / raw)
To: Andre Przywara, Jagan Teki, Jaehoon Chung; +Cc: u-boot, Samuel Holland
This driver reports the presence/absence of voltage on the PMIC's USB
VBUS pin. This information is used by the USB PHY driver. The
corresponding Linux driver uses the power supply class, which does not
exist in U-Boot. UCLASS_REGULATOR seems to be the closest match.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/power/regulator/Kconfig | 7 ++++
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/axp_usb_power.c | 49 +++++++++++++++++++++++++
3 files changed, 57 insertions(+)
create mode 100644 drivers/power/regulator/axp_usb_power.c
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index c346d03507..eb5aa38c1c 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -57,6 +57,13 @@ config SPL_REGULATOR_AXP
Enable support in SPL for the regulators (DCDCs, LDOs) in the
X-Powers AXP152, AXP2xx, and AXP8xx PMICs.
+config REGULATOR_AXP_USB_POWER
+ bool "Enable driver for X-Powers AXP PMIC USB power supply"
+ depends on DM_REGULATOR && PMIC_AXP
+ help
+ Enable support for reading the USB power supply status from
+ X-Powers AXP2xx and AXP8xx PMICs.
+
config DM_REGULATOR_BD71837
bool "Enable Driver Model for ROHM BD71837/BD71847 regulators"
depends on DM_REGULATOR && DM_PMIC_BD71837
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index 2d97e1033a..d9e0cd5949 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
obj-$(CONFIG_$(SPL_)REGULATOR_AXP) += axp_regulator.o
+obj-$(CONFIG_$(SPL_)REGULATOR_AXP_USB_POWER) += axp_usb_power.o
obj-$(CONFIG_$(SPL_)DM_REGULATOR_DA9063) += da9063.o
obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
obj-$(CONFIG_DM_REGULATOR_NPCM8XX) += npcm8xx_regulator.o
diff --git a/drivers/power/regulator/axp_usb_power.c b/drivers/power/regulator/axp_usb_power.c
new file mode 100644
index 0000000000..f32fb6a92d
--- /dev/null
+++ b/drivers/power/regulator/axp_usb_power.c
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <dm/device.h>
+#include <errno.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+#define AXP_POWER_STATUS 0x00
+#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
+
+static int axp_usb_power_get_enable(struct udevice *dev)
+{
+ int ret;
+
+ ret = pmic_reg_read(dev->parent, AXP_POWER_STATUS);
+ if (ret < 0)
+ return ret;
+
+ return !!(ret & AXP_POWER_STATUS_VBUS_PRESENT);
+}
+
+static const struct dm_regulator_ops axp_usb_power_ops = {
+ .get_enable = axp_usb_power_get_enable,
+};
+
+static int axp_usb_power_probe(struct udevice *dev)
+{
+ struct dm_regulator_uclass_plat *uc_plat = dev_get_uclass_plat(dev);
+
+ uc_plat->type = REGULATOR_TYPE_FIXED;
+
+ return 0;
+}
+
+static const struct udevice_id axp_usb_power_ids[] = {
+ { .compatible = "x-powers,axp202-usb-power-supply" },
+ { .compatible = "x-powers,axp221-usb-power-supply" },
+ { .compatible = "x-powers,axp223-usb-power-supply" },
+ { .compatible = "x-powers,axp813-usb-power-supply" },
+ { }
+};
+
+U_BOOT_DRIVER(axp_usb_power) = {
+ .name = "axp_usb_power",
+ .id = UCLASS_REGULATOR,
+ .of_match = axp_usb_power_ids,
+ .probe = axp_usb_power_probe,
+ .ops = &axp_usb_power_ops,
+};
--
2.37.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection
2023-01-22 23:46 [PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model Samuel Holland
2023-01-22 23:46 ` [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply Samuel Holland
@ 2023-01-22 23:46 ` Samuel Holland
2023-04-28 0:24 ` Andre Przywara
2023-01-22 23:46 ` [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO Samuel Holland
2 siblings, 1 reply; 7+ messages in thread
From: Samuel Holland @ 2023-01-22 23:46 UTC (permalink / raw)
To: Andre Przywara, Jagan Teki, Jaehoon Chung; +Cc: u-boot, Samuel Holland
Update boards to use the USB power supply driver, as referenced in the
device tree, instead of a virtual GPIO. This removes the need for some
DM-incompatible special cases in the GPIO driver.
The following five boards used AXP0-VBUS-DETECT in their config, but are
missing the "usb0_vbus_power-supply" property in their device tree:
- Ainol_AW1_defconfig / sun7i-a20-ainol-aw1
- Cubieboard4_defconfig / sun9i-a80-cubieboard4
- Merrii_A80_Optimus_defconfig / sun9i-a80-optimus
- Yones_Toptech_BD1078_defconfig / sun7i-a20-yones-toptech-bd1078
- Yones_Toptech_BS1078_V2_defconfig /
sun6i-a31s-yones-toptech-bs1078-v2
None of those five boards have the MUSB controller (USB OTG) enabled in
their device trees, so this change should not break anything for them.
Additionally, the following board intentionally omits the property
because VBUS is always enabled:
- Nintendo_NES_Classic_Edition_defconfig /
sun8i-r16-nintendo-nes-classic
The PHY driver already assumes VBUS is enabled when no detection method
is available, so again this will not cause any problems.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
configs/A33-OLinuXino_defconfig | 2 +-
configs/Ainol_AW1_defconfig | 2 +-
configs/Cubieboard4_defconfig | 3 ++-
configs/Cubietruck_plus_defconfig | 2 +-
configs/MSI_Primo81_defconfig | 2 +-
configs/Merrii_A80_Optimus_defconfig | 3 ++-
configs/Nintendo_NES_Classic_Edition_defconfig | 2 +-
configs/Sinovoip_BPI_M3_defconfig | 2 +-
configs/Wexler_TAB7200_defconfig | 2 +-
configs/Yones_Toptech_BD1078_defconfig | 2 +-
configs/Yones_Toptech_BS1078_V2_defconfig | 2 +-
configs/colorfly_e708_q1_defconfig | 2 +-
configs/ga10h_v1_1_defconfig | 2 +-
configs/gt90h_v4_defconfig | 2 +-
configs/iNet_D978_rev2_defconfig | 2 +-
configs/inet86dz_defconfig | 2 +-
configs/inet_q972_defconfig | 2 +-
configs/polaroid_mid2407pxe03_defconfig | 2 +-
configs/polaroid_mid2809pxe04_defconfig | 2 +-
configs/q8_a23_tablet_800x480_defconfig | 2 +-
configs/q8_a33_tablet_1024x600_defconfig | 2 +-
configs/q8_a33_tablet_800x480_defconfig | 2 +-
configs/tbs_a711_defconfig | 2 +-
23 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/configs/A33-OLinuXino_defconfig b/configs/A33-OLinuXino_defconfig
index 351a454339..896ddbb95f 100644
--- a/configs/A33-OLinuXino_defconfig
+++ b/configs/A33-OLinuXino_defconfig
@@ -8,7 +8,6 @@ CONFIG_DRAM_ZQ=15291
CONFIG_DRAM_ODT_EN=y
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PB3"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
@@ -16,5 +15,6 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_BL_EN="PB2"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Ainol_AW1_defconfig b/configs/Ainol_AW1_defconfig
index 9a18af8c6e..ec0c216413 100644
--- a/configs/Ainol_AW1_defconfig
+++ b/configs/Ainol_AW1_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=123
CONFIG_MMC0_CD_PIN="PH1"
CONFIG_USB0_VBUS_PIN="PB9"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:40000,le:87,ri:112,up:38,lo:141,hs:1,vs:1,sync:3,vmode:0"
CONFIG_VIDEO_LCD_POWER="PH8"
@@ -18,4 +17,5 @@ CONFIG_SPL_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Cubieboard4_defconfig b/configs/Cubieboard4_defconfig
index 04ed79afb6..82a8deac77 100644
--- a/configs/Cubieboard4_defconfig
+++ b/configs/Cubieboard4_defconfig
@@ -7,10 +7,11 @@ CONFIG_DRAM_CLK=672
CONFIG_MMC0_CD_PIN="PH18"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH16"
CONFIG_USB1_VBUS_PIN="PH14"
CONFIG_USB3_VBUS_PIN="PH15"
CONFIG_AXP_GPIO=y
CONFIG_SYS_I2C_SUN8I_RSB=y
+CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP809_POWER=y
diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
index 13f958977b..29f4df2b81 100644
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -8,7 +8,6 @@ CONFIG_DRAM_ZQ=15355
CONFIG_DRAM_ODT_EN=y
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH11"
CONFIG_USB1_VBUS_PIN="PD29"
CONFIG_USB2_VBUS_PIN="PL6"
@@ -22,6 +21,7 @@ CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
CONFIG_PHY_REALTEK=y
CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_FLDO1_VOLT=1200
diff --git a/configs/MSI_Primo81_defconfig b/configs/MSI_Primo81_defconfig
index e77b007292..d60eedb482 100644
--- a/configs/MSI_Primo81_defconfig
+++ b/configs/MSI_Primo81_defconfig
@@ -6,13 +6,13 @@ CONFIG_MACH_SUN6I=y
CONFIG_DRAM_CLK=360
CONFIG_DRAM_ZQ=122
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:768,y:1024,depth:18,pclk_khz:66000,le:56,ri:60,up:30,lo:36,hs:64,vs:50,sync:3,vmode:0"
CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Merrii_A80_Optimus_defconfig b/configs/Merrii_A80_Optimus_defconfig
index c5d1f40df3..e772634064 100644
--- a/configs/Merrii_A80_Optimus_defconfig
+++ b/configs/Merrii_A80_Optimus_defconfig
@@ -7,10 +7,11 @@ CONFIG_DRAM_CLK=672
CONFIG_MMC0_CD_PIN="PH18"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH3"
CONFIG_USB1_VBUS_PIN="PH4"
CONFIG_USB3_VBUS_PIN="PH5"
CONFIG_AXP_GPIO=y
CONFIG_SYS_I2C_SUN8I_RSB=y
+CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP809_POWER=y
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig b/configs/Nintendo_NES_Classic_Edition_defconfig
index 18fa3779d4..3046f45012 100644
--- a/configs/Nintendo_NES_Classic_Edition_defconfig
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN8I_A33=y
CONFIG_DRAM_CLK=600
CONFIG_DRAM_ZQ=15291
CONFIG_DRAM_ODT_EN=y
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_AXP_GPIO=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
# CONFIG_CMD_FLASH is not set
@@ -20,6 +19,7 @@ CONFIG_SYS_NAND_ONFI_DETECTION=y
CONFIG_SYS_NAND_PAGE_SIZE=0x800
CONFIG_SYS_NAND_OOBSIZE=0x40
CONFIG_SYS_NAND_MAX_ECCPOS=1664
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ELDO2_VOLT=1800
CONFIG_CONS_INDEX=5
diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index 5116fab52d..5642e52ec5 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -9,7 +9,6 @@ CONFIG_DRAM_ZQ=15355
CONFIG_DRAM_ODT_EN=y
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH11"
CONFIG_USB1_VBUS_PIN="PD24"
CONFIG_AXP_GPIO=y
@@ -19,6 +18,7 @@ CONFIG_CONSOLE_MUX=y
CONFIG_PHY_REALTEK=y
CONFIG_SUN8I_EMAC=y
CONFIG_INITIAL_USB_SCAN_DELAY=500
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_AXP_DLDO3_VOLT=3300
CONFIG_AXP_SW_ON=y
diff --git a/configs/Wexler_TAB7200_defconfig b/configs/Wexler_TAB7200_defconfig
index 101ce57aa4..40aeb6680c 100644
--- a/configs/Wexler_TAB7200_defconfig
+++ b/configs/Wexler_TAB7200_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
CONFIG_USB0_VBUS_PIN="PB9"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH4"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:24,pclk_khz:33000,le:45,ri:210,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
@@ -17,6 +16,7 @@ CONFIG_SPL_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Yones_Toptech_BD1078_defconfig b/configs/Yones_Toptech_BD1078_defconfig
index f1ceb8b552..f64b29819c 100644
--- a/configs/Yones_Toptech_BD1078_defconfig
+++ b/configs/Yones_Toptech_BD1078_defconfig
@@ -9,7 +9,6 @@ CONFIG_MMC1_CD_PIN="PH2"
CONFIG_MMC1_PINS_PH=y
CONFIG_MMC_SUNXI_SLOT_EXTRA=1
CONFIG_USB0_VBUS_PIN="PB9"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:63000,le:32,ri:287,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=0
@@ -23,4 +22,5 @@ CONFIG_SPL_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Yones_Toptech_BS1078_V2_defconfig b/configs/Yones_Toptech_BS1078_V2_defconfig
index 6701ecce2f..e54dbeddf5 100644
--- a/configs/Yones_Toptech_BS1078_V2_defconfig
+++ b/configs/Yones_Toptech_BS1078_V2_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=420
CONFIG_DRAM_ZQ=251
CONFIG_MMC0_CD_PIN="PA8"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PA15"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:70000,le:120,ri:180,up:17,lo:15,hs:20,vs:3,sync:3,vmode:0"
@@ -16,5 +15,6 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/colorfly_e708_q1_defconfig b/configs/colorfly_e708_q1_defconfig
index 5d3636e34e..5a77ec11e8 100644
--- a/configs/colorfly_e708_q1_defconfig
+++ b/configs/colorfly_e708_q1_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=251
CONFIG_MMC0_CD_PIN="PA8"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PA15"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:1280,depth:24,pclk_khz:64000,le:20,ri:34,up:1,lo:16,hs:10,vs:1,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO2_VOLT=1800
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/ga10h_v1_1_defconfig b/configs/ga10h_v1_1_defconfig
index 599eeb96b4..935071d61a 100644
--- a/configs/ga10h_v1_1_defconfig
+++ b/configs/ga10h_v1_1_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=15291
CONFIG_DRAM_ODT_EN=y
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:52000,le:138,ri:162,up:22,lo:10,hs:20,vs:3,sync:3,vmode:0"
@@ -17,6 +16,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_EHCI_HCD=y
diff --git a/configs/gt90h_v4_defconfig b/configs/gt90h_v4_defconfig
index 1a5fe06bbe..85185930db 100644
--- a/configs/gt90h_v4_defconfig
+++ b/configs/gt90h_v4_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=480
CONFIG_DRAM_ZQ=32767
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:55000,le:159,ri:160,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/iNet_D978_rev2_defconfig b/configs/iNet_D978_rev2_defconfig
index 9a90252dbd..f9d0f88e67 100644
--- a/configs/iNet_D978_rev2_defconfig
+++ b/configs/iNet_D978_rev2_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
CONFIG_DRAM_ZQ=15291
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:18,pclk_khz:65000,le:120,ri:180,up:22,lo:13,hs:20,vs:3,sync:3,vmode:0"
@@ -17,6 +16,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
CONFIG_CONS_INDEX=5
diff --git a/configs/inet86dz_defconfig b/configs/inet86dz_defconfig
index 3ade9fea82..7f8651d898 100644
--- a/configs/inet86dz_defconfig
+++ b/configs/inet86dz_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=63351
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:138,ri:162,up:22,lo:10,hs:20,vs:3,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/inet_q972_defconfig b/configs/inet_q972_defconfig
index 1769256b7d..408c9ccac9 100644
--- a/configs/inet_q972_defconfig
+++ b/configs/inet_q972_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=384
CONFIG_DRAM_ZQ=251
CONFIG_MMC0_CD_PIN="PA8"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PA15"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:18,pclk_khz:65000,le:280,ri:20,up:22,lo:8,hs:20,vs:8,sync:3,vmode:0"
@@ -15,6 +14,7 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
diff --git a/configs/polaroid_mid2407pxe03_defconfig b/configs/polaroid_mid2407pxe03_defconfig
index 17fffeb1e2..d11d72ba99 100644
--- a/configs/polaroid_mid2407pxe03_defconfig
+++ b/configs/polaroid_mid2407pxe03_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=63351
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/polaroid_mid2809pxe04_defconfig b/configs/polaroid_mid2809pxe04_defconfig
index e542b71113..68e2392643 100644
--- a/configs/polaroid_mid2809pxe04_defconfig
+++ b/configs/polaroid_mid2809pxe04_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=63351
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:36,ri:210,up:18,lo:22,hs:10,vs:5,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/q8_a23_tablet_800x480_defconfig b/configs/q8_a23_tablet_800x480_defconfig
index dda1a0c51f..dcf23e90d2 100644
--- a/configs/q8_a23_tablet_800x480_defconfig
+++ b/configs/q8_a23_tablet_800x480_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=63306
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:36,ri:210,up:18,lo:22,hs:10,vs:5,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/q8_a33_tablet_1024x600_defconfig b/configs/q8_a33_tablet_1024x600_defconfig
index 7925677d30..74635985a0 100644
--- a/configs/q8_a33_tablet_1024x600_defconfig
+++ b/configs/q8_a33_tablet_1024x600_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
CONFIG_DRAM_ZQ=15291
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:159,ri:160,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/q8_a33_tablet_800x480_defconfig b/configs/q8_a33_tablet_800x480_defconfig
index f3335f9d23..770acc840d 100644
--- a/configs/q8_a33_tablet_800x480_defconfig
+++ b/configs/q8_a33_tablet_800x480_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
CONFIG_DRAM_ZQ=15291
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH8"
CONFIG_AXP_GPIO=y
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
@@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
CONFIG_USB_MUSB_HOST=y
diff --git a/configs/tbs_a711_defconfig b/configs/tbs_a711_defconfig
index b3c2e69d6c..9a70b6bee5 100644
--- a/configs/tbs_a711_defconfig
+++ b/configs/tbs_a711_defconfig
@@ -9,11 +9,11 @@ CONFIG_DRAM_ZQ=15355
CONFIG_DRAM_ODT_EN=y
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
-CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH11"
CONFIG_AXP_GPIO=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
--
2.37.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO
2023-01-22 23:46 [PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model Samuel Holland
2023-01-22 23:46 ` [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply Samuel Holland
2023-01-22 23:46 ` [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection Samuel Holland
@ 2023-01-22 23:46 ` Samuel Holland
2023-04-28 0:26 ` Andre Przywara
2 siblings, 1 reply; 7+ messages in thread
From: Samuel Holland @ 2023-01-22 23:46 UTC (permalink / raw)
To: Andre Przywara, Jagan Teki, Jaehoon Chung; +Cc: u-boot, Samuel Holland
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>
---
arch/arm/include/asm/arch-sunxi/gpio.h | 1 -
drivers/gpio/axp_gpio.c | 21 ++++-----------------
drivers/gpio/sunxi_gpio.c | 6 +-----
include/axp209.h | 1 -
include/axp221.h | 1 -
include/axp809.h | 1 -
include/axp818.h | 1 -
7 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
index 437e86479c..6eaeece4e2 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -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
diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
index 35585dc8ac..49672193ff 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 1e85db179a..f0b42e4fdb 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;
diff --git a/include/axp209.h b/include/axp209.h
index 414f88a32c..d8bf44f1fa 100644
--- a/include/axp209.h
+++ b/include/axp209.h
@@ -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
diff --git a/include/axp221.h b/include/axp221.h
index 8dfcc5b5a2..32b988f3a9 100644
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -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
diff --git a/include/axp809.h b/include/axp809.h
index 8082e402e2..71a7cb2aaa 100644
--- a/include/axp809.h
+++ b/include/axp809.h
@@ -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
diff --git a/include/axp818.h b/include/axp818.h
index 8ac517a2bf..08ac35d15f 100644
--- a/include/axp818.h
+++ b/include/axp818.h
@@ -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
--
2.37.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply
2023-01-22 23:46 ` [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply Samuel Holland
@ 2023-04-28 0:15 ` Andre Przywara
0 siblings, 0 replies; 7+ messages in thread
From: Andre Przywara @ 2023-04-28 0:15 UTC (permalink / raw)
To: Samuel Holland; +Cc: Jagan Teki, Jaehoon Chung, u-boot
On Sun, 22 Jan 2023 17:46:20 -0600
Samuel Holland <samuel@sholland.org> wrote:
> This driver reports the presence/absence of voltage on the PMIC's USB
> VBUS pin. This information is used by the USB PHY driver. The
> corresponding Linux driver uses the power supply class, which does not
> exist in U-Boot. UCLASS_REGULATOR seems to be the closest match.
That's a quite clever and lean solution, since the USB PHY already
checks for such a regulator enable status. The bits match up, so:
Acked-by: Andre Przywara <andre.przywara@arm.com>
queued for sunxi/master
Cheers,
Andre
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> drivers/power/regulator/Kconfig | 7 ++++
> drivers/power/regulator/Makefile | 1 +
> drivers/power/regulator/axp_usb_power.c | 49 +++++++++++++++++++++++++
> 3 files changed, 57 insertions(+)
> create mode 100644 drivers/power/regulator/axp_usb_power.c
>
> diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
> index c346d03507..eb5aa38c1c 100644
> --- a/drivers/power/regulator/Kconfig
> +++ b/drivers/power/regulator/Kconfig
> @@ -57,6 +57,13 @@ config SPL_REGULATOR_AXP
> Enable support in SPL for the regulators (DCDCs, LDOs) in the
> X-Powers AXP152, AXP2xx, and AXP8xx PMICs.
>
> +config REGULATOR_AXP_USB_POWER
> + bool "Enable driver for X-Powers AXP PMIC USB power supply"
> + depends on DM_REGULATOR && PMIC_AXP
> + help
> + Enable support for reading the USB power supply status from
> + X-Powers AXP2xx and AXP8xx PMICs.
> +
> config DM_REGULATOR_BD71837
> bool "Enable Driver Model for ROHM BD71837/BD71847 regulators"
> depends on DM_REGULATOR && DM_PMIC_BD71837
> diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
> index 2d97e1033a..d9e0cd5949 100644
> --- a/drivers/power/regulator/Makefile
> +++ b/drivers/power/regulator/Makefile
> @@ -8,6 +8,7 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
> obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
> obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
> obj-$(CONFIG_$(SPL_)REGULATOR_AXP) += axp_regulator.o
> +obj-$(CONFIG_$(SPL_)REGULATOR_AXP_USB_POWER) += axp_usb_power.o
> obj-$(CONFIG_$(SPL_)DM_REGULATOR_DA9063) += da9063.o
> obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
> obj-$(CONFIG_DM_REGULATOR_NPCM8XX) += npcm8xx_regulator.o
> diff --git a/drivers/power/regulator/axp_usb_power.c b/drivers/power/regulator/axp_usb_power.c
> new file mode 100644
> index 0000000000..f32fb6a92d
> --- /dev/null
> +++ b/drivers/power/regulator/axp_usb_power.c
> @@ -0,0 +1,49 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +#include <dm/device.h>
> +#include <errno.h>
> +#include <power/pmic.h>
> +#include <power/regulator.h>
> +
> +#define AXP_POWER_STATUS 0x00
> +#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
> +
> +static int axp_usb_power_get_enable(struct udevice *dev)
> +{
> + int ret;
> +
> + ret = pmic_reg_read(dev->parent, AXP_POWER_STATUS);
> + if (ret < 0)
> + return ret;
> +
> + return !!(ret & AXP_POWER_STATUS_VBUS_PRESENT);
> +}
> +
> +static const struct dm_regulator_ops axp_usb_power_ops = {
> + .get_enable = axp_usb_power_get_enable,
> +};
> +
> +static int axp_usb_power_probe(struct udevice *dev)
> +{
> + struct dm_regulator_uclass_plat *uc_plat = dev_get_uclass_plat(dev);
> +
> + uc_plat->type = REGULATOR_TYPE_FIXED;
> +
> + return 0;
> +}
> +
> +static const struct udevice_id axp_usb_power_ids[] = {
> + { .compatible = "x-powers,axp202-usb-power-supply" },
> + { .compatible = "x-powers,axp221-usb-power-supply" },
> + { .compatible = "x-powers,axp223-usb-power-supply" },
> + { .compatible = "x-powers,axp813-usb-power-supply" },
> + { }
> +};
> +
> +U_BOOT_DRIVER(axp_usb_power) = {
> + .name = "axp_usb_power",
> + .id = UCLASS_REGULATOR,
> + .of_match = axp_usb_power_ids,
> + .probe = axp_usb_power_probe,
> + .ops = &axp_usb_power_ops,
> +};
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection
2023-01-22 23:46 ` [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection Samuel Holland
@ 2023-04-28 0:24 ` Andre Przywara
0 siblings, 0 replies; 7+ messages in thread
From: Andre Przywara @ 2023-04-28 0:24 UTC (permalink / raw)
To: Samuel Holland; +Cc: Jagan Teki, Jaehoon Chung, u-boot
On Sun, 22 Jan 2023 17:46:21 -0600
Samuel Holland <samuel@sholland.org> wrote:
> Update boards to use the USB power supply driver, as referenced in the
> device tree, instead of a virtual GPIO. This removes the need for some
> DM-incompatible special cases in the GPIO driver.
Confirmed that it replaces AXP0-VBUS-DETECT with
CONFIG_REGULATOR_AXP_USB_POWER for all 23 boards affected.
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Queued for sunxi/master.
Cheers,
Andre
> The following five boards used AXP0-VBUS-DETECT in their config, but are
> missing the "usb0_vbus_power-supply" property in their device tree:
> - Ainol_AW1_defconfig / sun7i-a20-ainol-aw1
> - Cubieboard4_defconfig / sun9i-a80-cubieboard4
> - Merrii_A80_Optimus_defconfig / sun9i-a80-optimus
> - Yones_Toptech_BD1078_defconfig / sun7i-a20-yones-toptech-bd1078
> - Yones_Toptech_BS1078_V2_defconfig /
> sun6i-a31s-yones-toptech-bs1078-v2
>
> None of those five boards have the MUSB controller (USB OTG) enabled in
> their device trees, so this change should not break anything for them.
>
> Additionally, the following board intentionally omits the property
> because VBUS is always enabled:
> - Nintendo_NES_Classic_Edition_defconfig /
> sun8i-r16-nintendo-nes-classic
>
> The PHY driver already assumes VBUS is enabled when no detection method
> is available, so again this will not cause any problems.
>
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> configs/A33-OLinuXino_defconfig | 2 +-
> configs/Ainol_AW1_defconfig | 2 +-
> configs/Cubieboard4_defconfig | 3 ++-
> configs/Cubietruck_plus_defconfig | 2 +-
> configs/MSI_Primo81_defconfig | 2 +-
> configs/Merrii_A80_Optimus_defconfig | 3 ++-
> configs/Nintendo_NES_Classic_Edition_defconfig | 2 +-
> configs/Sinovoip_BPI_M3_defconfig | 2 +-
> configs/Wexler_TAB7200_defconfig | 2 +-
> configs/Yones_Toptech_BD1078_defconfig | 2 +-
> configs/Yones_Toptech_BS1078_V2_defconfig | 2 +-
> configs/colorfly_e708_q1_defconfig | 2 +-
> configs/ga10h_v1_1_defconfig | 2 +-
> configs/gt90h_v4_defconfig | 2 +-
> configs/iNet_D978_rev2_defconfig | 2 +-
> configs/inet86dz_defconfig | 2 +-
> configs/inet_q972_defconfig | 2 +-
> configs/polaroid_mid2407pxe03_defconfig | 2 +-
> configs/polaroid_mid2809pxe04_defconfig | 2 +-
> configs/q8_a23_tablet_800x480_defconfig | 2 +-
> configs/q8_a33_tablet_1024x600_defconfig | 2 +-
> configs/q8_a33_tablet_800x480_defconfig | 2 +-
> configs/tbs_a711_defconfig | 2 +-
> 23 files changed, 25 insertions(+), 23 deletions(-)
>
> diff --git a/configs/A33-OLinuXino_defconfig b/configs/A33-OLinuXino_defconfig
> index 351a454339..896ddbb95f 100644
> --- a/configs/A33-OLinuXino_defconfig
> +++ b/configs/A33-OLinuXino_defconfig
> @@ -8,7 +8,6 @@ CONFIG_DRAM_ZQ=15291
> CONFIG_DRAM_ODT_EN=y
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PB3"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
> @@ -16,5 +15,6 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
> CONFIG_VIDEO_LCD_BL_EN="PB2"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DCDC1_VOLT=3300
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/Ainol_AW1_defconfig b/configs/Ainol_AW1_defconfig
> index 9a18af8c6e..ec0c216413 100644
> --- a/configs/Ainol_AW1_defconfig
> +++ b/configs/Ainol_AW1_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=123
> CONFIG_MMC0_CD_PIN="PH1"
> CONFIG_USB0_VBUS_PIN="PB9"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:40000,le:87,ri:112,up:38,lo:141,hs:1,vs:1,sync:3,vmode:0"
> CONFIG_VIDEO_LCD_POWER="PH8"
> @@ -18,4 +17,5 @@ CONFIG_SPL_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
> CONFIG_SYS_I2C_SLAVE=0x7f
> CONFIG_SYS_I2C_SPEED=400000
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/Cubieboard4_defconfig b/configs/Cubieboard4_defconfig
> index 04ed79afb6..82a8deac77 100644
> --- a/configs/Cubieboard4_defconfig
> +++ b/configs/Cubieboard4_defconfig
> @@ -7,10 +7,11 @@ CONFIG_DRAM_CLK=672
> CONFIG_MMC0_CD_PIN="PH18"
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH16"
> CONFIG_USB1_VBUS_PIN="PH14"
> CONFIG_USB3_VBUS_PIN="PH15"
> CONFIG_AXP_GPIO=y
> CONFIG_SYS_I2C_SUN8I_RSB=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP809_POWER=y
> diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
> index 13f958977b..29f4df2b81 100644
> --- a/configs/Cubietruck_plus_defconfig
> +++ b/configs/Cubietruck_plus_defconfig
> @@ -8,7 +8,6 @@ CONFIG_DRAM_ZQ=15355
> CONFIG_DRAM_ODT_EN=y
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH11"
> CONFIG_USB1_VBUS_PIN="PD29"
> CONFIG_USB2_VBUS_PIN="PL6"
> @@ -22,6 +21,7 @@ CONFIG_SYS_I2C_SLAVE=0x7f
> CONFIG_SYS_I2C_SPEED=400000
> CONFIG_PHY_REALTEK=y
> CONFIG_SUN8I_EMAC=y
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO3_VOLT=2500
> CONFIG_AXP_DLDO4_VOLT=3300
> CONFIG_AXP_FLDO1_VOLT=1200
> diff --git a/configs/MSI_Primo81_defconfig b/configs/MSI_Primo81_defconfig
> index e77b007292..d60eedb482 100644
> --- a/configs/MSI_Primo81_defconfig
> +++ b/configs/MSI_Primo81_defconfig
> @@ -6,13 +6,13 @@ CONFIG_MACH_SUN6I=y
> CONFIG_DRAM_CLK=360
> CONFIG_DRAM_ZQ=122
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:768,y:1024,depth:18,pclk_khz:66000,le:56,ri:60,up:30,lo:36,hs:64,vs:50,sync:3,vmode:0"
> CONFIG_VIDEO_LCD_BL_EN="PA25"
> CONFIG_VIDEO_LCD_BL_PWM="PH13"
> CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/Merrii_A80_Optimus_defconfig b/configs/Merrii_A80_Optimus_defconfig
> index c5d1f40df3..e772634064 100644
> --- a/configs/Merrii_A80_Optimus_defconfig
> +++ b/configs/Merrii_A80_Optimus_defconfig
> @@ -7,10 +7,11 @@ CONFIG_DRAM_CLK=672
> CONFIG_MMC0_CD_PIN="PH18"
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH3"
> CONFIG_USB1_VBUS_PIN="PH4"
> CONFIG_USB3_VBUS_PIN="PH5"
> CONFIG_AXP_GPIO=y
> CONFIG_SYS_I2C_SUN8I_RSB=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP809_POWER=y
> diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig b/configs/Nintendo_NES_Classic_Edition_defconfig
> index 18fa3779d4..3046f45012 100644
> --- a/configs/Nintendo_NES_Classic_Edition_defconfig
> +++ b/configs/Nintendo_NES_Classic_Edition_defconfig
> @@ -6,7 +6,6 @@ CONFIG_MACH_SUN8I_A33=y
> CONFIG_DRAM_CLK=600
> CONFIG_DRAM_ZQ=15291
> CONFIG_DRAM_ODT_EN=y
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_AXP_GPIO=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> # CONFIG_CMD_FLASH is not set
> @@ -20,6 +19,7 @@ CONFIG_SYS_NAND_ONFI_DETECTION=y
> CONFIG_SYS_NAND_PAGE_SIZE=0x800
> CONFIG_SYS_NAND_OOBSIZE=0x40
> CONFIG_SYS_NAND_MAX_ECCPOS=1664
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_AXP_ELDO2_VOLT=1800
> CONFIG_CONS_INDEX=5
> diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
> index 5116fab52d..5642e52ec5 100644
> --- a/configs/Sinovoip_BPI_M3_defconfig
> +++ b/configs/Sinovoip_BPI_M3_defconfig
> @@ -9,7 +9,6 @@ CONFIG_DRAM_ZQ=15355
> CONFIG_DRAM_ODT_EN=y
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH11"
> CONFIG_USB1_VBUS_PIN="PD24"
> CONFIG_AXP_GPIO=y
> @@ -19,6 +18,7 @@ CONFIG_CONSOLE_MUX=y
> CONFIG_PHY_REALTEK=y
> CONFIG_SUN8I_EMAC=y
> CONFIG_INITIAL_USB_SCAN_DELAY=500
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DCDC5_VOLT=1200
> CONFIG_AXP_DLDO3_VOLT=3300
> CONFIG_AXP_SW_ON=y
> diff --git a/configs/Wexler_TAB7200_defconfig b/configs/Wexler_TAB7200_defconfig
> index 101ce57aa4..40aeb6680c 100644
> --- a/configs/Wexler_TAB7200_defconfig
> +++ b/configs/Wexler_TAB7200_defconfig
> @@ -5,7 +5,6 @@ CONFIG_SPL=y
> CONFIG_MACH_SUN7I=y
> CONFIG_DRAM_CLK=384
> CONFIG_USB0_VBUS_PIN="PB9"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH4"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:24,pclk_khz:33000,le:45,ri:210,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
> @@ -17,6 +16,7 @@ CONFIG_SPL_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
> CONFIG_SYS_I2C_SLAVE=0x7f
> CONFIG_SYS_I2C_SPEED=400000
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_USB_EHCI_HCD=y
> CONFIG_USB_OHCI_HCD=y
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/Yones_Toptech_BD1078_defconfig b/configs/Yones_Toptech_BD1078_defconfig
> index f1ceb8b552..f64b29819c 100644
> --- a/configs/Yones_Toptech_BD1078_defconfig
> +++ b/configs/Yones_Toptech_BD1078_defconfig
> @@ -9,7 +9,6 @@ CONFIG_MMC1_CD_PIN="PH2"
> CONFIG_MMC1_PINS_PH=y
> CONFIG_MMC_SUNXI_SLOT_EXTRA=1
> CONFIG_USB0_VBUS_PIN="PB9"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:63000,le:32,ri:287,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
> CONFIG_VIDEO_LCD_DCLK_PHASE=0
> @@ -23,4 +22,5 @@ CONFIG_SPL_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
> CONFIG_SYS_I2C_SLAVE=0x7f
> CONFIG_SYS_I2C_SPEED=400000
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/Yones_Toptech_BS1078_V2_defconfig b/configs/Yones_Toptech_BS1078_V2_defconfig
> index 6701ecce2f..e54dbeddf5 100644
> --- a/configs/Yones_Toptech_BS1078_V2_defconfig
> +++ b/configs/Yones_Toptech_BS1078_V2_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=420
> CONFIG_DRAM_ZQ=251
> CONFIG_MMC0_CD_PIN="PA8"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PA15"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:70000,le:120,ri:180,up:17,lo:15,hs:20,vs:3,sync:3,vmode:0"
> @@ -16,5 +15,6 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
> CONFIG_VIDEO_LCD_BL_PWM="PH13"
> CONFIG_VIDEO_LCD_PANEL_LVDS=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/colorfly_e708_q1_defconfig b/configs/colorfly_e708_q1_defconfig
> index 5d3636e34e..5a77ec11e8 100644
> --- a/configs/colorfly_e708_q1_defconfig
> +++ b/configs/colorfly_e708_q1_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=251
> CONFIG_MMC0_CD_PIN="PA8"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PA15"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:1280,depth:24,pclk_khz:64000,le:20,ri:34,up:1,lo:16,hs:10,vs:1,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
> CONFIG_VIDEO_LCD_BL_PWM="PH13"
> CONFIG_VIDEO_LCD_PANEL_LVDS=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_AXP_DLDO2_VOLT=1800
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/ga10h_v1_1_defconfig b/configs/ga10h_v1_1_defconfig
> index 599eeb96b4..935071d61a 100644
> --- a/configs/ga10h_v1_1_defconfig
> +++ b/configs/ga10h_v1_1_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=15291
> CONFIG_DRAM_ODT_EN=y
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:52000,le:138,ri:162,up:22,lo:10,hs:20,vs:3,sync:3,vmode:0"
> @@ -17,6 +16,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> CONFIG_VIDEO_LCD_PANEL_LVDS=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_EHCI_HCD=y
> diff --git a/configs/gt90h_v4_defconfig b/configs/gt90h_v4_defconfig
> index 1a5fe06bbe..85185930db 100644
> --- a/configs/gt90h_v4_defconfig
> +++ b/configs/gt90h_v4_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=480
> CONFIG_DRAM_ZQ=32767
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:55000,le:159,ri:160,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/iNet_D978_rev2_defconfig b/configs/iNet_D978_rev2_defconfig
> index 9a90252dbd..f9d0f88e67 100644
> --- a/configs/iNet_D978_rev2_defconfig
> +++ b/configs/iNet_D978_rev2_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
> CONFIG_DRAM_ZQ=15291
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:18,pclk_khz:65000,le:120,ri:180,up:22,lo:13,hs:20,vs:3,sync:3,vmode:0"
> @@ -17,6 +16,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> CONFIG_VIDEO_LCD_PANEL_LVDS=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
> CONFIG_CONS_INDEX=5
> diff --git a/configs/inet86dz_defconfig b/configs/inet86dz_defconfig
> index 3ade9fea82..7f8651d898 100644
> --- a/configs/inet86dz_defconfig
> +++ b/configs/inet86dz_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=552
> CONFIG_DRAM_ZQ=63351
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:138,ri:162,up:22,lo:10,hs:20,vs:3,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/inet_q972_defconfig b/configs/inet_q972_defconfig
> index 1769256b7d..408c9ccac9 100644
> --- a/configs/inet_q972_defconfig
> +++ b/configs/inet_q972_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=384
> CONFIG_DRAM_ZQ=251
> CONFIG_MMC0_CD_PIN="PA8"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PA15"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:768,depth:18,pclk_khz:65000,le:280,ri:20,up:22,lo:8,hs:20,vs:8,sync:3,vmode:0"
> @@ -15,6 +14,7 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
> CONFIG_VIDEO_LCD_BL_EN="PA25"
> CONFIG_VIDEO_LCD_BL_PWM="PH13"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_USB_EHCI_HCD=y
> CONFIG_USB_OHCI_HCD=y
> diff --git a/configs/polaroid_mid2407pxe03_defconfig b/configs/polaroid_mid2407pxe03_defconfig
> index 17fffeb1e2..d11d72ba99 100644
> --- a/configs/polaroid_mid2407pxe03_defconfig
> +++ b/configs/polaroid_mid2407pxe03_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=63351
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/polaroid_mid2809pxe04_defconfig b/configs/polaroid_mid2809pxe04_defconfig
> index e542b71113..68e2392643 100644
> --- a/configs/polaroid_mid2809pxe04_defconfig
> +++ b/configs/polaroid_mid2809pxe04_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=63351
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:36,ri:210,up:18,lo:22,hs:10,vs:5,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/q8_a23_tablet_800x480_defconfig b/configs/q8_a23_tablet_800x480_defconfig
> index dda1a0c51f..dcf23e90d2 100644
> --- a/configs/q8_a23_tablet_800x480_defconfig
> +++ b/configs/q8_a23_tablet_800x480_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=432
> CONFIG_DRAM_ZQ=63306
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:36,ri:210,up:18,lo:22,hs:10,vs:5,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/q8_a33_tablet_1024x600_defconfig b/configs/q8_a33_tablet_1024x600_defconfig
> index 7925677d30..74635985a0 100644
> --- a/configs/q8_a33_tablet_1024x600_defconfig
> +++ b/configs/q8_a33_tablet_1024x600_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
> CONFIG_DRAM_ZQ=15291
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:159,ri:160,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/q8_a33_tablet_800x480_defconfig b/configs/q8_a33_tablet_800x480_defconfig
> index f3335f9d23..770acc840d 100644
> --- a/configs/q8_a33_tablet_800x480_defconfig
> +++ b/configs/q8_a33_tablet_800x480_defconfig
> @@ -7,7 +7,6 @@ CONFIG_DRAM_CLK=456
> CONFIG_DRAM_ZQ=15291
> CONFIG_MMC0_CD_PIN="PB4"
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH8"
> CONFIG_AXP_GPIO=y
> CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
> @@ -16,6 +15,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
> CONFIG_VIDEO_LCD_BL_EN="PH6"
> CONFIG_VIDEO_LCD_BL_PWM="PH0"
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DLDO1_VOLT=3300
> CONFIG_CONS_INDEX=5
> CONFIG_USB_MUSB_HOST=y
> diff --git a/configs/tbs_a711_defconfig b/configs/tbs_a711_defconfig
> index b3c2e69d6c..9a70b6bee5 100644
> --- a/configs/tbs_a711_defconfig
> +++ b/configs/tbs_a711_defconfig
> @@ -9,11 +9,11 @@ CONFIG_DRAM_ZQ=15355
> CONFIG_DRAM_ODT_EN=y
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
> -CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
> CONFIG_USB0_ID_DET="PH11"
> CONFIG_AXP_GPIO=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
> +CONFIG_REGULATOR_AXP_USB_POWER=y
> CONFIG_AXP_DCDC5_VOLT=1200
> CONFIG_USB_EHCI_HCD=y
> CONFIG_USB_OHCI_HCD=y
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO
2023-01-22 23:46 ` [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO Samuel Holland
@ 2023-04-28 0:26 ` Andre Przywara
0 siblings, 0 replies; 7+ messages in thread
From: Andre Przywara @ 2023-04-28 0:26 UTC (permalink / raw)
To: Samuel Holland; +Cc: Jagan Teki, Jaehoon Chung, u-boot
On Sun, 22 Jan 2023 17:46:22 -0600
Samuel Holland <samuel@sholland.org> wrote:
> 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>
There is indeed no config left that would set AXP0-VBUS-DETECT, so this
code is indeed no longer needed:
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Queued for sunxi/master.
Cheers,
Andre
> ---
>
> arch/arm/include/asm/arch-sunxi/gpio.h | 1 -
> drivers/gpio/axp_gpio.c | 21 ++++-----------------
> drivers/gpio/sunxi_gpio.c | 6 +-----
> include/axp209.h | 1 -
> include/axp221.h | 1 -
> include/axp809.h | 1 -
> include/axp818.h | 1 -
> 7 files changed, 5 insertions(+), 27 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
> index 437e86479c..6eaeece4e2 100644
> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
> @@ -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
>
> diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
> index 35585dc8ac..49672193ff 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 1e85db179a..f0b42e4fdb 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;
> diff --git a/include/axp209.h b/include/axp209.h
> index 414f88a32c..d8bf44f1fa 100644
> --- a/include/axp209.h
> +++ b/include/axp209.h
> @@ -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
> diff --git a/include/axp221.h b/include/axp221.h
> index 8dfcc5b5a2..32b988f3a9 100644
> --- a/include/axp221.h
> +++ b/include/axp221.h
> @@ -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
> diff --git a/include/axp809.h b/include/axp809.h
> index 8082e402e2..71a7cb2aaa 100644
> --- a/include/axp809.h
> +++ b/include/axp809.h
> @@ -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
> diff --git a/include/axp818.h b/include/axp818.h
> index 8ac517a2bf..08ac35d15f 100644
> --- a/include/axp818.h
> +++ b/include/axp818.h
> @@ -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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-04-28 0:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-22 23:46 [PATCH 0/3] power: Model X-Powers PMIC VBUS detection using the driver model Samuel Holland
2023-01-22 23:46 ` [PATCH 1/3] power: regulator: Add a driver for the AXP USB power supply Samuel Holland
2023-04-28 0:15 ` Andre Przywara
2023-01-22 23:46 ` [PATCH 2/3] sunxi: Switch to PMIC USB power supply VBUS detection Samuel Holland
2023-04-28 0:24 ` Andre Przywara
2023-01-22 23:46 ` [PATCH 3/3] gpio: axp/sunxi: Remove virtual VBUS detection GPIO Samuel Holland
2023-04-28 0:26 ` Andre Przywara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox