diff options
author | Andre Przywara <andre.przywara@arm.com> | 2021-06-27 01:13:09 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2023-11-12 12:03:42 +0000 |
commit | ffb02942fab024d4a9b6a3346b9791457e272ff4 (patch) | |
tree | 10c399636bb62f0e6d9466d64973adde6770bb17 /drivers | |
parent | da2e3196e4dc28298b58a018ace07f85eecd1652 (diff) | |
download | u-boot-ffb02942fab024d4a9b6a3346b9791457e272ff4.tar.gz u-boot-ffb02942fab024d4a9b6a3346b9791457e272ff4.tar.bz2 u-boot-ffb02942fab024d4a9b6a3346b9791457e272ff4.zip |
sunxi: board: simplify early PMIC setup conditions
So far we have a convoluted #ifdef mesh that guards the early AXP PMIC
setup in board.c. That combination of &&, || and negations is very hard
to read, maintain and especially to extend.
Fortunately we have those same conditions already modelled in the
Kconfig file, so they are actually redundant. On top of that the real
reason we have those preprocessor guards in the first place is about the
symbols that are *conditionally* defined: without #ifdefs the build
would break because of them being undefined for many boards.
To simplify this, just change the guards to actually look at the symbols
needed, so CONFIG_AXP_xxx_VOLT instead of CONFIG_AXPyyy_POWER.
This drastically improves the readability of this code, and makes adding
PMIC support a pure Kconfig matter.
Doing this revealed one bug in Kconfig: there is no axp_set_dcdc4() for
the AXP818, even though CONFIG_AXP_DCDC4_VOLT includes that PMIC.
Since the AXP818 wasn't included when calling axp_set_dcdc4() in board.c,
this wasn't an issue, but becomes one now, so also remove the AXP818 from
the DCDC4 Kconfig symbol.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/Kconfig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 7f3b990d23..83cb31c937 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -180,7 +180,7 @@ config AXP_DCDC3_VOLT config AXP_DCDC4_VOLT int "axp pmic dcdc4 voltage" - depends on AXP152_POWER || AXP221_POWER || AXP809_POWER || AXP818_POWER || AXP305_POWER + depends on AXP152_POWER || AXP221_POWER || AXP809_POWER || AXP305_POWER default 1250 if AXP152_POWER default 1200 if MACH_SUN6I default 0 if MACH_SUN8I |