[U-Boot] [PATCH v2 3/6] sunxi: add AXP_PMIC_BUS invisible options for AXP PMICs access

Icenowy Zheng icenowy at aosc.xyz
Sat Feb 25 23:52:05 UTC 2017


For AXP PMICs' drivers some functions are needed to provide I/O access
for the PMIC.

The source file used to be controlled by different AXPxxx_POWER config
option.

Control the file's compliation via a generic AXP_PMIC_BUS option, and
make all AXPxxx_POWER select this option, to prevent furtherly more and
more AXP PMIC names are added to the Makefile of mach-sunxi.

Signed-off-by: Icenowy Zheng <icenowy at aosc.xyz>
---
 arch/arm/mach-sunxi/Makefile |  6 +-----
 drivers/power/Kconfig        | 10 ++++++++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-sunxi/Makefile b/arch/arm/mach-sunxi/Makefile
index a8bf3a6c64..5767f7643f 100644
--- a/arch/arm/mach-sunxi/Makefile
+++ b/arch/arm/mach-sunxi/Makefile
@@ -31,11 +31,7 @@ obj-$(CONFIG_MACH_SUN8I)	+= clock_sun6i.o
 endif
 obj-$(CONFIG_MACH_SUN9I)	+= clock_sun9i.o gtbus_sun9i.o
 
-obj-$(CONFIG_AXP152_POWER)	+= pmic_bus.o
-obj-$(CONFIG_AXP209_POWER)	+= pmic_bus.o
-obj-$(CONFIG_AXP221_POWER)	+= pmic_bus.o
-obj-$(CONFIG_AXP809_POWER)	+= pmic_bus.o
-obj-$(CONFIG_AXP818_POWER)	+= pmic_bus.o
+obj-$(CONFIG_AXP_PMIC_BUS)	+= pmic_bus.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_MACH_SUN4I)	+= dram_sun4i.o
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index f2c5629be2..442e33ea30 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -6,6 +6,11 @@ source "drivers/power/pmic/Kconfig"
 
 source "drivers/power/regulator/Kconfig"
 
+config AXP_PMIC_BUS
+	bool
+	---help---
+	Select this for code providing PMIC access code for AXP PMICs.
+
 choice
 	prompt "Select Sunxi PMIC Variant"
 	depends on ARCH_SUNXI
@@ -23,6 +28,7 @@ config AXP152_POWER
 	bool "axp152 pmic support"
 	depends on MACH_SUN5I
 	select CMD_POWEROFF
+	select AXP_PMIC_BUS
 	---help---
 	Select this to enable support for the axp152 pmic found on most
 	A10s boards.
@@ -31,6 +37,7 @@ config AXP209_POWER
 	bool "axp209 pmic support"
 	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
 	select CMD_POWEROFF
+	select AXP_PMIC_BUS
 	---help---
 	Select this to enable support for the axp209 pmic found on most
 	A10, A13 and A20 boards.
@@ -39,6 +46,7 @@ config AXP221_POWER
 	bool "axp221 / axp223 pmic support"
 	depends on MACH_SUN6I || MACH_SUN8I_A23 || MACH_SUN8I_A33
 	select CMD_POWEROFF
+	select AXP_PMIC_BUS
 	---help---
 	Select this to enable support for the axp221/axp223 pmic found on most
 	A23 and A31 boards.
@@ -47,6 +55,7 @@ config AXP809_POWER
 	bool "axp809 pmic support"
 	depends on MACH_SUN9I
 	select CMD_POWEROFF
+	select AXP_PMIC_BUS
 	---help---
 	Say y here to enable support for the axp809 pmic found on A80 boards.
 
@@ -54,6 +63,7 @@ config AXP818_POWER
 	bool "axp818 pmic support"
 	depends on MACH_SUN8I_A83T
 	select CMD_POWEROFF
+	select AXP_PMIC_BUS
 	---help---
 	Say y here to enable support for the axp818 pmic found on
 	A83T dev board.
-- 
2.11.1



More information about the U-Boot mailing list