diff options
Diffstat (limited to 'include/linux/mfd/abx500/ab8500-bm.h')
-rw-r--r-- | include/linux/mfd/abx500/ab8500-bm.h | 61 |
1 files changed, 56 insertions, 5 deletions
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index 8d35bfe164c8..cc892a8d8d6e 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
@@ -23,6 +23,7 @@ | |||
23 | * Bank : 0x5 | 23 | * Bank : 0x5 |
24 | */ | 24 | */ |
25 | #define AB8500_USB_LINE_STAT_REG 0x80 | 25 | #define AB8500_USB_LINE_STAT_REG 0x80 |
26 | #define AB8500_USB_LINE_CTRL2_REG 0x82 | ||
26 | #define AB8500_USB_LINK1_STAT_REG 0x94 | 27 | #define AB8500_USB_LINK1_STAT_REG 0x94 |
27 | 28 | ||
28 | /* | 29 | /* |
@@ -33,7 +34,7 @@ | |||
33 | #define AB8500_CH_STATUS2_REG 0x01 | 34 | #define AB8500_CH_STATUS2_REG 0x01 |
34 | #define AB8500_CH_USBCH_STAT1_REG 0x02 | 35 | #define AB8500_CH_USBCH_STAT1_REG 0x02 |
35 | #define AB8500_CH_USBCH_STAT2_REG 0x03 | 36 | #define AB8500_CH_USBCH_STAT2_REG 0x03 |
36 | #define AB8500_CH_FSM_STAT_REG 0x04 | 37 | #define AB8540_CH_USBCH_STAT3_REG 0x04 |
37 | #define AB8500_CH_STAT_REG 0x05 | 38 | #define AB8500_CH_STAT_REG 0x05 |
38 | 39 | ||
39 | /* | 40 | /* |
@@ -69,6 +70,8 @@ | |||
69 | #define AB8500_USBCH_CTRL1_REG 0xC0 | 70 | #define AB8500_USBCH_CTRL1_REG 0xC0 |
70 | #define AB8500_USBCH_CTRL2_REG 0xC1 | 71 | #define AB8500_USBCH_CTRL2_REG 0xC1 |
71 | #define AB8500_USBCH_IPT_CRNTLVL_REG 0xC2 | 72 | #define AB8500_USBCH_IPT_CRNTLVL_REG 0xC2 |
73 | #define AB8540_USB_PP_MODE_REG 0xC5 | ||
74 | #define AB8540_USB_PP_CHR_REG 0xC6 | ||
72 | 75 | ||
73 | /* | 76 | /* |
74 | * Gas Gauge register offsets | 77 | * Gas Gauge register offsets |
@@ -105,6 +108,7 @@ | |||
105 | #define AB8500_RTC_BACKUP_CHG_REG 0x0C | 108 | #define AB8500_RTC_BACKUP_CHG_REG 0x0C |
106 | #define AB8500_RTC_CC_CONF_REG 0x01 | 109 | #define AB8500_RTC_CC_CONF_REG 0x01 |
107 | #define AB8500_RTC_CTRL_REG 0x0B | 110 | #define AB8500_RTC_CTRL_REG 0x0B |
111 | #define AB8500_RTC_CTRL1_REG 0x11 | ||
108 | 112 | ||
109 | /* | 113 | /* |
110 | * OTP register offsets | 114 | * OTP register offsets |
@@ -154,6 +158,7 @@ | |||
154 | #define CH_OP_CUR_LVL_1P4 0x0D | 158 | #define CH_OP_CUR_LVL_1P4 0x0D |
155 | #define CH_OP_CUR_LVL_1P5 0x0E | 159 | #define CH_OP_CUR_LVL_1P5 0x0E |
156 | #define CH_OP_CUR_LVL_1P6 0x0F | 160 | #define CH_OP_CUR_LVL_1P6 0x0F |
161 | #define CH_OP_CUR_LVL_2P 0x3F | ||
157 | 162 | ||
158 | /* BTEMP High thermal limits */ | 163 | /* BTEMP High thermal limits */ |
159 | #define BTEMP_HIGH_TH_57_0 0x00 | 164 | #define BTEMP_HIGH_TH_57_0 0x00 |
@@ -179,10 +184,25 @@ | |||
179 | #define BUP_ICH_SEL_300UA 0x08 | 184 | #define BUP_ICH_SEL_300UA 0x08 |
180 | #define BUP_ICH_SEL_700UA 0x0C | 185 | #define BUP_ICH_SEL_700UA 0x0C |
181 | 186 | ||
182 | #define BUP_VCH_SEL_2P5V 0x00 | 187 | enum bup_vch_sel { |
183 | #define BUP_VCH_SEL_2P6V 0x01 | 188 | BUP_VCH_SEL_2P5V, |
184 | #define BUP_VCH_SEL_2P8V 0x02 | 189 | BUP_VCH_SEL_2P6V, |
185 | #define BUP_VCH_SEL_3P1V 0x03 | 190 | BUP_VCH_SEL_2P8V, |
191 | BUP_VCH_SEL_3P1V, | ||
192 | /* | ||
193 | * Note that the following 5 values 2.7v, 2.9v, 3.0v, 3.2v, 3.3v | ||
194 | * are only available on ab8540. You can't choose these 5 | ||
195 | * voltage on ab8500/ab8505/ab9540. | ||
196 | */ | ||
197 | BUP_VCH_SEL_2P7V, | ||
198 | BUP_VCH_SEL_2P9V, | ||
199 | BUP_VCH_SEL_3P0V, | ||
200 | BUP_VCH_SEL_3P2V, | ||
201 | BUP_VCH_SEL_3P3V, | ||
202 | }; | ||
203 | |||
204 | #define BUP_VCH_RANGE 0x02 | ||
205 | #define VBUP33_VRTCN 0x01 | ||
186 | 206 | ||
187 | /* Battery OVV constants */ | 207 | /* Battery OVV constants */ |
188 | #define BATT_OVV_ENA 0x02 | 208 | #define BATT_OVV_ENA 0x02 |
@@ -228,6 +248,8 @@ | |||
228 | #define BAT_CTRL_20U_ENA 0x02 | 248 | #define BAT_CTRL_20U_ENA 0x02 |
229 | #define BAT_CTRL_18U_ENA 0x01 | 249 | #define BAT_CTRL_18U_ENA 0x01 |
230 | #define BAT_CTRL_16U_ENA 0x02 | 250 | #define BAT_CTRL_16U_ENA 0x02 |
251 | #define BAT_CTRL_60U_ENA 0x01 | ||
252 | #define BAT_CTRL_120U_ENA 0x02 | ||
231 | #define BAT_CTRL_CMP_ENA 0x04 | 253 | #define BAT_CTRL_CMP_ENA 0x04 |
232 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 | 254 | #define FORCE_BAT_CTRL_CMP_HIGH 0x08 |
233 | #define BAT_CTRL_PULL_UP_ENA 0x10 | 255 | #define BAT_CTRL_PULL_UP_ENA 0x10 |
@@ -235,6 +257,24 @@ | |||
235 | /* Battery type */ | 257 | /* Battery type */ |
236 | #define BATTERY_UNKNOWN 00 | 258 | #define BATTERY_UNKNOWN 00 |
237 | 259 | ||
260 | /* Registers for pcut feature in ab8505 and ab9540 */ | ||
261 | #define AB8505_RTC_PCUT_CTL_STATUS_REG 0x12 | ||
262 | #define AB8505_RTC_PCUT_TIME_REG 0x13 | ||
263 | #define AB8505_RTC_PCUT_MAX_TIME_REG 0x14 | ||
264 | #define AB8505_RTC_PCUT_FLAG_TIME_REG 0x15 | ||
265 | #define AB8505_RTC_PCUT_RESTART_REG 0x16 | ||
266 | #define AB8505_RTC_PCUT_DEBOUNCE_REG 0x17 | ||
267 | |||
268 | /* USB Power Path constants for ab8540 */ | ||
269 | #define BUS_VSYS_VOL_SELECT_MASK 0x06 | ||
270 | #define BUS_VSYS_VOL_SELECT_3P6V 0x00 | ||
271 | #define BUS_VSYS_VOL_SELECT_3P325V 0x02 | ||
272 | #define BUS_VSYS_VOL_SELECT_3P9V 0x04 | ||
273 | #define BUS_VSYS_VOL_SELECT_4P3V 0x06 | ||
274 | #define BUS_POWER_PATH_MODE_ENA 0x01 | ||
275 | #define BUS_PP_PRECHG_CURRENT_MASK 0x0E | ||
276 | #define BUS_POWER_PATH_PRECHG_ENA 0x01 | ||
277 | |||
238 | /** | 278 | /** |
239 | * struct res_to_temp - defines one point in a temp to res curve. To | 279 | * struct res_to_temp - defines one point in a temp to res curve. To |
240 | * be used in battery packs that combines the identification resistor with a | 280 | * be used in battery packs that combines the identification resistor with a |
@@ -283,6 +323,11 @@ struct ab8500_fg; | |||
283 | * points. | 323 | * points. |
284 | * @maint_thres This is the threshold where we stop reporting | 324 | * @maint_thres This is the threshold where we stop reporting |
285 | * battery full while in maintenance, in per cent | 325 | * battery full while in maintenance, in per cent |
326 | * @pcut_enable: Enable power cut feature in ab8505 | ||
327 | * @pcut_max_time: Max time threshold | ||
328 | * @pcut_flag_time: Flagtime threshold | ||
329 | * @pcut_max_restart: Max number of restarts | ||
330 | * @pcut_debunce_time: Sets battery debounce time | ||
286 | */ | 331 | */ |
287 | struct ab8500_fg_parameters { | 332 | struct ab8500_fg_parameters { |
288 | int recovery_sleep_timer; | 333 | int recovery_sleep_timer; |
@@ -299,6 +344,11 @@ struct ab8500_fg_parameters { | |||
299 | int battok_raising_th_sel1; | 344 | int battok_raising_th_sel1; |
300 | int user_cap_limit; | 345 | int user_cap_limit; |
301 | int maint_thres; | 346 | int maint_thres; |
347 | bool pcut_enable; | ||
348 | u8 pcut_max_time; | ||
349 | u8 pcut_flag_time; | ||
350 | u8 pcut_max_restart; | ||
351 | u8 pcut_debunce_time; | ||
302 | }; | 352 | }; |
303 | 353 | ||
304 | /** | 354 | /** |
@@ -415,6 +465,7 @@ void ab8500_fg_reinit(void); | |||
415 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); | 465 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); |
416 | struct ab8500_btemp *ab8500_btemp_get(void); | 466 | struct ab8500_btemp *ab8500_btemp_get(void); |
417 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); | 467 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); |
468 | int ab8500_btemp_get_temp(struct ab8500_btemp *btemp); | ||
418 | struct ab8500_fg *ab8500_fg_get(void); | 469 | struct ab8500_fg *ab8500_fg_get(void); |
419 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); | 470 | int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev); |
420 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); | 471 | int ab8500_fg_inst_curr_start(struct ab8500_fg *di); |