aboutsummaryrefslogtreecommitdiff
path: root/include/axp152.h
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2021-08-22 18:18:04 -0500
committerAndre Przywara <andre.przywara@arm.com>2021-10-25 14:50:42 +0100
commit344df3ca2c3c2e98c9ab4112e8ebd660ad2be6ea (patch)
treed13b81f7abe9b1733675b3ec16d80b6f813f65a7 /include/axp152.h
parent5b4afbd40c9bc1cac6705e27e9ec0683622ca86a (diff)
downloadu-boot-344df3ca2c3c2e98c9ab4112e8ebd660ad2be6ea.zip
u-boot-344df3ca2c3c2e98c9ab4112e8ebd660ad2be6ea.tar.gz
u-boot-344df3ca2c3c2e98c9ab4112e8ebd660ad2be6ea.tar.bz2
include: axp_pmic: Include headers for all variants
A single DM-based driver should be able to support some feature for several PMIC variants where the interface is the same. For example, all PMIC variants use the same register bit to trigger poweroff. However, currently only definitions for a single PMIC are available at a time. This requires drivers to use #ifdefs and different indentifiers for each variant they support. Let's simplify this by making register definitions for all variants available from the header. Then no preprocessor conditions are needed; the driver can use the register definition from any variant that supports the relevant feature. An exception is the GPIO-related definitions, which do not use unique identifiers. So for now, keep them like before. They will be cleaned up along with the GPIO driver. 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>
Diffstat (limited to 'include/axp152.h')
-rw-r--r--include/axp152.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/axp152.h b/include/axp152.h
index c81f172..10d845f 100644
--- a/include/axp152.h
+++ b/include/axp152.h
@@ -15,6 +15,7 @@ enum axp152_reg {
#define AXP152_POWEROFF (1 << 7)
/* For axp_gpio.c */
+#ifdef CONFIG_AXP152_POWER
#define AXP_GPIO0_CTRL 0x90
#define AXP_GPIO1_CTRL 0x91
#define AXP_GPIO2_CTRL 0x92
@@ -24,3 +25,4 @@ enum axp152_reg {
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x97
#define AXP_GPIO_STATE_OFFSET 0
+#endif