diff options
author | fang hui <hui.fang@nxp.com> | 2017-05-11 12:18:38 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-06-13 02:41:08 -0700 |
commit | 56b3054ae1f1bd4778d78054e5068ffdf143bec9 (patch) | |
tree | f853109123383c59b60714187318442ea187557a /include/axp152.h | |
parent | acdc5c297a9630a464896ba507f33f4d4e9820c4 (diff) |
MA-10052 [iot] Extensions of AXP152 to support stream812
Necessary extensions of axp152 to support stream812.
merge patches from Martin Pietryka <martin.pietryka@streamunlimited.com>
Change-Id: I7708db4e59d6403a3576f17a221b448866f469a0
Signed-off-by: fang hui <hui.fang@nxp.com>
(cherry picked from commit 6f51148d75869415bb4e9920572e8fffb1eb0099)
Diffstat (limited to 'include/axp152.h')
-rw-r--r-- | include/axp152.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/include/axp152.h b/include/axp152.h index 1643266f9a..58727ba2e9 100644 --- a/include/axp152.h +++ b/include/axp152.h @@ -6,14 +6,84 @@ enum axp152_reg { AXP152_CHIP_VERSION = 0x3, + AXP152_POWER_CONTROL = 0x12, + AXP152_LDO0_VOLTAGE = 0x15, AXP152_DCDC2_VOLTAGE = 0x23, + AXP152_DCDC1_VOLTAGE = 0x26, AXP152_DCDC3_VOLTAGE = 0x27, AXP152_DCDC4_VOLTAGE = 0x2B, + AXP152_LDO1_VOLTAGE = 0x29, AXP152_LDO2_VOLTAGE = 0x2A, + AXP152_ALDO1_ALDO2_VOLTAGE = 0x28, + AXP152_POWER_RECOVERY = 0x31, AXP152_SHUTDOWN = 0x32, + AXP152_GPIO0 = 0x90, }; +enum axp152_ldo0_volts { + AXP152_LDO0_5V = 0, + AXP152_LDO0_3V3 = 1, + AXP152_LDO0_2V8 = 2, + AXP152_LDO0_2V5 = 3, +}; + +enum axp152_ldo0_curr_limit { + AXP152_LDO0_CURR_NOLMIT = 0, + AXP152_LDO0_CURR_1500MA = 1, + AXP152_LDO0_CURR_900MA = 2, + AXP152_LDO0_CURR_500MA = 3, +}; + +enum axp152_dcdc1_voltages { + AXP152_DCDC1_1V7 = 0, + AXP152_DCDC1_1V8 = 1, + AXP152_DCDC1_1V9 = 2, + AXP152_DCDC1_2V0 = 3, + AXP152_DCDC1_2V1 = 4, + AXP152_DCDC1_2V4 = 5, + AXP152_DCDC1_2V5 = 6, + AXP152_DCDC1_2V6 = 7, + AXP152_DCDC1_2V7 = 8, + AXP152_DCDC1_2V8 = 9, + AXP152_DCDC1_3V0 = 10, + AXP152_DCDC1_3V1 = 11, + AXP152_DCDC1_3V2 = 12, + AXP152_DCDC1_3V3 = 13, + AXP152_DCDC1_3V4 = 14, + AXP152_DCDC1_3V5 = 15, +}; + +enum axp152_aldo_voltages { + AXP152_ALDO_1V2 = 0, + AXP152_ALDO_1V3 = 1, + AXP152_ALDO_1V4 = 2, + AXP152_ALDO_1V5 = 3, + AXP152_ALDO_1V6 = 4, + AXP152_ALDO_1V7 = 5, + AXP152_ALDO_1V8 = 6, + AXP152_ALDO_1V9 = 7, + AXP152_ALDO_2V0 = 8, + AXP152_ALDO_2V5 = 9, + AXP152_ALDO_2V7 = 10, + AXP152_ALDO_2V8 = 11, + AXP152_ALDO_3V0 = 12, + AXP152_ALDO_3V1 = 13, + AXP152_ALDO_3V2 = 14, + AXP152_ALDO_3V3 = 15, +}; + +#define AXP152_POWEROUT_DC_DC1 BIT(7) +#define AXP152_POWEROUT_DC_DC2 BIT(6) +#define AXP152_POWEROUT_DC_DC3 BIT(5) +#define AXP152_POWEROUT_DC_DC4 BIT(4) +#define AXP152_POWEROUT_ALDO1 BIT(3) +#define AXP152_POWEROUT_ALDO2 BIT(2) +#define AXP152_POWEROUT_DLDO1 BIT(1) +#define AXP152_POWEROUT_DLDO2 BIT(0) + #define AXP152_POWEROFF (1 << 7) +#define AXP152_POWEROFF_SEQ (1 << 2) +#define AXP152_POWER_RECOVERY_EN (1 << 3) /* For axp_gpio.c */ #define AXP_GPIO0_CTRL 0x90 @@ -25,3 +95,16 @@ enum axp152_reg { #define AXP_GPIO_CTRL_INPUT 0x02 /* Input */ #define AXP_GPIO_STATE 0x97 #define AXP_GPIO_STATE_OFFSET 0 + +int axp_set_dcdc1(enum axp152_dcdc1_voltages volt); +int axp_set_dcdc2(unsigned int mvolt); +int axp_set_dcdc3(unsigned int mvolt); +int axp_set_dcdc4(unsigned int mvolt); +int axp_set_ldo0(enum axp152_ldo0_volts volt, enum axp152_ldo0_curr_limit curr_limit); +int axp_disable_ldo0(void); +int axp_set_ldo1(unsigned int mvolt); +int axp_set_ldo2(unsigned int mvolt); +int axp_set_aldo1(enum axp152_aldo_voltages volt); +int axp_set_aldo2(enum axp152_aldo_voltages volt); +int axp_set_power_output(int val); +int axp_init(void); |