From fe4b71b2373cf0627fbd9d9767fb66059e67eea7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 20 Dec 2015 16:14:31 +0100 Subject: sunxi: Implement poweroff support for axp221 pmic Adds poweroff support for axp221 pmic. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- include/axp221.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/axp221.h b/include/axp221.h index 0ee21b6..04cd8c2 100644 --- a/include/axp221.h +++ b/include/axp221.h @@ -45,6 +45,8 @@ #define AXP221_ALDO3_CTRL 0x2a #define AXP221_VBUS_IPSOUT 0x30 #define AXP221_VBUS_IPSOUT_DRIVEBUS (1 << 2) +#define AXP221_SHUTDOWN 0x32 +#define AXP221_SHUTDOWN_POWEROFF (1 << 7) #define AXP221_MISC_CTRL 0x8f #define AXP221_MISC_CTRL_N_VBUSEN_FUNC (1 << 4) #define AXP221_PAGE 0xff -- cgit v1.1 From c2caf65da5d15f8e21a4438104360caa8fbb6b7f Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Tue, 12 Jan 2016 14:42:36 +0800 Subject: power: axp818: Remove duplicate register definition macros Some of the register definitions are duplicated. Drop them. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- include/axp818.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/axp818.h b/include/axp818.h index 1dc6456..46d05ad 100644 --- a/include/axp818.h +++ b/include/axp818.h @@ -32,13 +32,6 @@ #define AXP818_OUTPUT_CTRL3_ALDO2_EN (1 << 6) #define AXP818_OUTPUT_CTRL3_ALDO3_EN (1 << 7) -#define AXP818_DCDC1_CTRL 0x20 -#define AXP818_DCDC2_CTRL 0x21 -#define AXP818_DCDC3_CTRL 0x22 -#define AXP818_DCDC4_CTRL 0x23 -#define AXP818_DCDC5_CTRL 0x24 -#define AXP818_DCDC6_CTRL 0x25 - #define AXP818_DLDO1_CTRL 0x15 #define AXP818_DLDO2_CTRL 0x16 #define AXP818_DLDO3_CTRL 0x17 @@ -46,7 +39,6 @@ #define AXP818_ELDO1_CTRL 0x19 #define AXP818_ELDO2_CTRL 0x1a #define AXP818_ELDO3_CTRL 0x1b -#define AXP818_ELDO3_CTRL 0x1b #define AXP818_FLDO1_CTRL 0x1c #define AXP818_FLDO2_3_CTRL 0x1d #define AXP818_DCDC1_CTRL 0x20 -- cgit v1.1 From 3517a27ddb1d12154e263a4f0bf91b4b76c21536 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Tue, 12 Jan 2016 14:42:37 +0800 Subject: power: axp: merge separate DLDO functions into 1 Instead of one function for each DLDO regulator, make 1 function that takes an extra "index". Since the control bits for the DLDO regulators are contiguous, this makes the function very simple. This removes a lot of duplicate code. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- include/axp_pmic.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include') diff --git a/include/axp_pmic.h b/include/axp_pmic.h index 3b01c49..0f14683 100644 --- a/include/axp_pmic.h +++ b/include/axp_pmic.h @@ -29,10 +29,7 @@ int axp_set_aldo1(unsigned int mvolt); int axp_set_aldo2(unsigned int mvolt); int axp_set_aldo3(unsigned int mvolt); int axp_set_aldo4(unsigned int mvolt); -int axp_set_dldo1(unsigned int mvolt); -int axp_set_dldo2(unsigned int mvolt); -int axp_set_dldo3(unsigned int mvolt); -int axp_set_dldo4(unsigned int mvolt); +int axp_set_dldo(int dldo_num, unsigned int mvolt); int axp_set_eldo(int eldo_num, unsigned int mvolt); int axp_init(void); int axp_get_sid(unsigned int *sid); -- cgit v1.1