aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/88pm860x.h
diff options
context:
space:
mode:
authorJett.Zhou <jtzhou@marvell.com>2012-07-27 04:27:16 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-09-20 18:32:55 -0400
commita830d28b48bf92944e57058e87d17cee5a7cd2a1 (patch)
tree304249dfc3d1100114a88e3c01509158a52eb86e /include/linux/mfd/88pm860x.h
parent98a2766493589c18c327ae3dad5243b53fcb5f70 (diff)
power_supply: Enable battery-charger for 88pm860x
There are charger and battery measurement feature for 88pm860x PMIC. For charger, it can support pre-charge with small current when battery is nearly exausted and then changed into fast-charge with CC&CV mode. For battery monitor, it can support battery measurement such as vbat,vsys,vchg and ibat etc,it can aslo accumulating the Coulomb value charged or discharged from battery based on Conlomb Counter, we use it to estimate battery capacity. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'include/linux/mfd/88pm860x.h')
-rw-r--r--include/linux/mfd/88pm860x.h84
1 files changed, 83 insertions, 1 deletions
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 7b24943779fa..b7c5a3c27c98 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -55,6 +55,21 @@ enum {
55#define PM8606_DCM_BOOST (0x00) 55#define PM8606_DCM_BOOST (0x00)
56#define PM8606_PWM (0x01) 56#define PM8606_PWM (0x01)
57 57
58#define PM8607_MISC2 (0x42)
59
60/* Power Up Log Register */
61#define PM8607_POWER_UP_LOG (0x3F)
62
63/* Charger Control Registers */
64#define PM8607_CCNT (0x47)
65#define PM8607_CHG_CTRL1 (0x48)
66#define PM8607_CHG_CTRL2 (0x49)
67#define PM8607_CHG_CTRL3 (0x4A)
68#define PM8607_CHG_CTRL4 (0x4B)
69#define PM8607_CHG_CTRL5 (0x4C)
70#define PM8607_CHG_CTRL6 (0x4D)
71#define PM8607_CHG_CTRL7 (0x4E)
72
58/* Backlight Registers */ 73/* Backlight Registers */
59#define PM8606_WLED1A (0x02) 74#define PM8606_WLED1A (0x02)
60#define PM8606_WLED1B (0x03) 75#define PM8606_WLED1B (0x03)
@@ -205,6 +220,71 @@ enum {
205#define PM8607_PD_PREBIAS (0x56) /* prebias time */ 220#define PM8607_PD_PREBIAS (0x56) /* prebias time */
206#define PM8607_GPADC_MISC1 (0x57) 221#define PM8607_GPADC_MISC1 (0x57)
207 222
223/* bit definitions of MEAS_EN1*/
224#define PM8607_MEAS_EN1_VBAT (1 << 0)
225#define PM8607_MEAS_EN1_VCHG (1 << 1)
226#define PM8607_MEAS_EN1_VSYS (1 << 2)
227#define PM8607_MEAS_EN1_TINT (1 << 3)
228#define PM8607_MEAS_EN1_RFTMP (1 << 4)
229#define PM8607_MEAS_EN1_TBAT (1 << 5)
230#define PM8607_MEAS_EN1_GPADC2 (1 << 6)
231#define PM8607_MEAS_EN1_GPADC3 (1 << 7)
232
233/* Battery Monitor Registers */
234#define PM8607_GP_BIAS2 (0x5A)
235#define PM8607_VBAT_LOWTH (0x5B)
236#define PM8607_VCHG_LOWTH (0x5C)
237#define PM8607_VSYS_LOWTH (0x5D)
238#define PM8607_TINT_LOWTH (0x5E)
239#define PM8607_GPADC0_LOWTH (0x5F)
240#define PM8607_GPADC1_LOWTH (0x60)
241#define PM8607_GPADC2_LOWTH (0x61)
242#define PM8607_GPADC3_LOWTH (0x62)
243#define PM8607_VBAT_HIGHTH (0x63)
244#define PM8607_VCHG_HIGHTH (0x64)
245#define PM8607_VSYS_HIGHTH (0x65)
246#define PM8607_TINT_HIGHTH (0x66)
247#define PM8607_GPADC0_HIGHTH (0x67)
248#define PM8607_GPADC1_HIGHTH (0x68)
249#define PM8607_GPADC2_HIGHTH (0x69)
250#define PM8607_GPADC3_HIGHTH (0x6A)
251#define PM8607_IBAT_MEAS1 (0x6B)
252#define PM8607_IBAT_MEAS2 (0x6C)
253#define PM8607_VBAT_MEAS1 (0x6D)
254#define PM8607_VBAT_MEAS2 (0x6E)
255#define PM8607_VCHG_MEAS1 (0x6F)
256#define PM8607_VCHG_MEAS2 (0x70)
257#define PM8607_VSYS_MEAS1 (0x71)
258#define PM8607_VSYS_MEAS2 (0x72)
259#define PM8607_TINT_MEAS1 (0x73)
260#define PM8607_TINT_MEAS2 (0x74)
261#define PM8607_GPADC0_MEAS1 (0x75)
262#define PM8607_GPADC0_MEAS2 (0x76)
263#define PM8607_GPADC1_MEAS1 (0x77)
264#define PM8607_GPADC1_MEAS2 (0x78)
265#define PM8607_GPADC2_MEAS1 (0x79)
266#define PM8607_GPADC2_MEAS2 (0x7A)
267#define PM8607_GPADC3_MEAS1 (0x7B)
268#define PM8607_GPADC3_MEAS2 (0x7C)
269#define PM8607_CCNT_MEAS1 (0x95)
270#define PM8607_CCNT_MEAS2 (0x96)
271#define PM8607_VBAT_AVG (0x97)
272#define PM8607_VCHG_AVG (0x98)
273#define PM8607_VSYS_AVG (0x99)
274#define PM8607_VBAT_MIN (0x9A)
275#define PM8607_VCHG_MIN (0x9B)
276#define PM8607_VSYS_MIN (0x9C)
277#define PM8607_VBAT_MAX (0x9D)
278#define PM8607_VCHG_MAX (0x9E)
279#define PM8607_VSYS_MAX (0x9F)
280
281#define PM8607_GPADC_MISC2 (0x59)
282#define PM8607_GPADC0_GP_BIAS_A0 (1 << 0)
283#define PM8607_GPADC1_GP_BIAS_A1 (1 << 1)
284#define PM8607_GPADC2_GP_BIAS_A2 (1 << 2)
285#define PM8607_GPADC3_GP_BIAS_A3 (1 << 3)
286#define PM8607_GPADC2_GP_BIAS_OUT2 (1 << 6)
287
208/* RTC Control Registers */ 288/* RTC Control Registers */
209#define PM8607_RTC1 (0xA0) 289#define PM8607_RTC1 (0xA0)
210#define PM8607_RTC_COUNTER1 (0xA1) 290#define PM8607_RTC_COUNTER1 (0xA1)
@@ -370,7 +450,8 @@ struct pm860x_touch_pdata {
370}; 450};
371 451
372struct pm860x_power_pdata { 452struct pm860x_power_pdata {
373 unsigned fast_charge; /* charge current */ 453 int max_capacity;
454 int resistor;
374}; 455};
375 456
376struct pm860x_platform_data { 457struct pm860x_platform_data {
@@ -379,6 +460,7 @@ struct pm860x_platform_data {
379 struct pm860x_rtc_pdata *rtc; 460 struct pm860x_rtc_pdata *rtc;
380 struct pm860x_touch_pdata *touch; 461 struct pm860x_touch_pdata *touch;
381 struct pm860x_power_pdata *power; 462 struct pm860x_power_pdata *power;
463 struct charger_desc *chg_desc;
382 struct regulator_init_data *regulator; 464 struct regulator_init_data *regulator;
383 465
384 unsigned short companion_addr; /* I2C address of companion chip */ 466 unsigned short companion_addr; /* I2C address of companion chip */