#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
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x97
#define AXP_GPIO_STATE_OFFSET 0
+#endif
#define AXP209_POWEROFF BIT(7)
/* For axp_gpio.c */
+#ifdef CONFIG_AXP209_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
#define AXP_GPIO0_CTRL 0x90
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x94
#define AXP_GPIO_STATE_OFFSET 4
+#endif
#define AXP221_SID 0x20
/* For axp_gpio.c */
+#ifdef CONFIG_AXP221_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x94
#define AXP_GPIO_STATE_OFFSET 0
+#endif
#define AXP809_SHUTDOWN_POWEROFF (1 << 7)
/* For axp_gpio.c */
+#ifdef CONFIG_AXP809_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x94
#define AXP_GPIO_STATE_OFFSET 0
+#endif
#define AXP818_SHUTDOWN_POWEROFF (1 << 7)
/* For axp_gpio.c */
+#ifdef CONFIG_AXP818_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
#define AXP_GPIO_STATE 0x94
#define AXP_GPIO_STATE_OFFSET 0
+#endif
#include <stdbool.h>
-#ifdef CONFIG_AXP152_POWER
#include <axp152.h>
-#endif
-#ifdef CONFIG_AXP209_POWER
#include <axp209.h>
-#endif
-#ifdef CONFIG_AXP221_POWER
#include <axp221.h>
-#endif
-#ifdef CONFIG_AXP305_POWER
#include <axp305.h>
-#endif
-#ifdef CONFIG_AXP809_POWER
#include <axp809.h>
-#endif
-#ifdef CONFIG_AXP818_POWER
#include <axp818.h>
-#endif
#define AXP_PMIC_MODE_REG 0x3e
#define AXP_PMIC_MODE_I2C 0x00