aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/88pm860x.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/88pm860x.h')
-rw-r--r--include/linux/mfd/88pm860x.h132
1 files changed, 102 insertions, 30 deletions
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 7b24943779fa..cd97530205c2 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -34,27 +34,26 @@ enum {
34 PM8606_ID_MAX, 34 PM8606_ID_MAX,
35}; 35};
36 36
37enum {
38 PM8606_BACKLIGHT1 = 0,
39 PM8606_BACKLIGHT2,
40 PM8606_BACKLIGHT3,
41};
42
43enum {
44 PM8606_LED1_RED = 0,
45 PM8606_LED1_GREEN,
46 PM8606_LED1_BLUE,
47 PM8606_LED2_RED,
48 PM8606_LED2_GREEN,
49 PM8606_LED2_BLUE,
50 PM8607_LED_VIBRATOR,
51};
52
53 37
54/* 8606 Registers */ 38/* 8606 Registers */
55#define PM8606_DCM_BOOST (0x00) 39#define PM8606_DCM_BOOST (0x00)
56#define PM8606_PWM (0x01) 40#define PM8606_PWM (0x01)
57 41
42#define PM8607_MISC2 (0x42)
43
44/* Power Up Log Register */
45#define PM8607_POWER_UP_LOG (0x3F)
46
47/* Charger Control Registers */
48#define PM8607_CCNT (0x47)
49#define PM8607_CHG_CTRL1 (0x48)
50#define PM8607_CHG_CTRL2 (0x49)
51#define PM8607_CHG_CTRL3 (0x4A)
52#define PM8607_CHG_CTRL4 (0x4B)
53#define PM8607_CHG_CTRL5 (0x4C)
54#define PM8607_CHG_CTRL6 (0x4D)
55#define PM8607_CHG_CTRL7 (0x4E)
56
58/* Backlight Registers */ 57/* Backlight Registers */
59#define PM8606_WLED1A (0x02) 58#define PM8606_WLED1A (0x02)
60#define PM8606_WLED1B (0x03) 59#define PM8606_WLED1B (0x03)
@@ -205,6 +204,71 @@ enum {
205#define PM8607_PD_PREBIAS (0x56) /* prebias time */ 204#define PM8607_PD_PREBIAS (0x56) /* prebias time */
206#define PM8607_GPADC_MISC1 (0x57) 205#define PM8607_GPADC_MISC1 (0x57)
207 206
207/* bit definitions of MEAS_EN1*/
208#define PM8607_MEAS_EN1_VBAT (1 << 0)
209#define PM8607_MEAS_EN1_VCHG (1 << 1)
210#define PM8607_MEAS_EN1_VSYS (1 << 2)
211#define PM8607_MEAS_EN1_TINT (1 << 3)
212#define PM8607_MEAS_EN1_RFTMP (1 << 4)
213#define PM8607_MEAS_EN1_TBAT (1 << 5)
214#define PM8607_MEAS_EN1_GPADC2 (1 << 6)
215#define PM8607_MEAS_EN1_GPADC3 (1 << 7)
216
217/* Battery Monitor Registers */
218#define PM8607_GP_BIAS2 (0x5A)
219#define PM8607_VBAT_LOWTH (0x5B)
220#define PM8607_VCHG_LOWTH (0x5C)
221#define PM8607_VSYS_LOWTH (0x5D)
222#define PM8607_TINT_LOWTH (0x5E)
223#define PM8607_GPADC0_LOWTH (0x5F)
224#define PM8607_GPADC1_LOWTH (0x60)
225#define PM8607_GPADC2_LOWTH (0x61)
226#define PM8607_GPADC3_LOWTH (0x62)
227#define PM8607_VBAT_HIGHTH (0x63)
228#define PM8607_VCHG_HIGHTH (0x64)
229#define PM8607_VSYS_HIGHTH (0x65)
230#define PM8607_TINT_HIGHTH (0x66)
231#define PM8607_GPADC0_HIGHTH (0x67)
232#define PM8607_GPADC1_HIGHTH (0x68)
233#define PM8607_GPADC2_HIGHTH (0x69)
234#define PM8607_GPADC3_HIGHTH (0x6A)
235#define PM8607_IBAT_MEAS1 (0x6B)
236#define PM8607_IBAT_MEAS2 (0x6C)
237#define PM8607_VBAT_MEAS1 (0x6D)
238#define PM8607_VBAT_MEAS2 (0x6E)
239#define PM8607_VCHG_MEAS1 (0x6F)
240#define PM8607_VCHG_MEAS2 (0x70)
241#define PM8607_VSYS_MEAS1 (0x71)
242#define PM8607_VSYS_MEAS2 (0x72)
243#define PM8607_TINT_MEAS1 (0x73)
244#define PM8607_TINT_MEAS2 (0x74)
245#define PM8607_GPADC0_MEAS1 (0x75)
246#define PM8607_GPADC0_MEAS2 (0x76)
247#define PM8607_GPADC1_MEAS1 (0x77)
248#define PM8607_GPADC1_MEAS2 (0x78)
249#define PM8607_GPADC2_MEAS1 (0x79)
250#define PM8607_GPADC2_MEAS2 (0x7A)
251#define PM8607_GPADC3_MEAS1 (0x7B)
252#define PM8607_GPADC3_MEAS2 (0x7C)
253#define PM8607_CCNT_MEAS1 (0x95)
254#define PM8607_CCNT_MEAS2 (0x96)
255#define PM8607_VBAT_AVG (0x97)
256#define PM8607_VCHG_AVG (0x98)
257#define PM8607_VSYS_AVG (0x99)
258#define PM8607_VBAT_MIN (0x9A)
259#define PM8607_VCHG_MIN (0x9B)
260#define PM8607_VSYS_MIN (0x9C)
261#define PM8607_VBAT_MAX (0x9D)
262#define PM8607_VCHG_MAX (0x9E)
263#define PM8607_VSYS_MAX (0x9F)
264
265#define PM8607_GPADC_MISC2 (0x59)
266#define PM8607_GPADC0_GP_BIAS_A0 (1 << 0)
267#define PM8607_GPADC1_GP_BIAS_A1 (1 << 1)
268#define PM8607_GPADC2_GP_BIAS_A2 (1 << 2)
269#define PM8607_GPADC3_GP_BIAS_A3 (1 << 3)
270#define PM8607_GPADC2_GP_BIAS_OUT2 (1 << 6)
271
208/* RTC Control Registers */ 272/* RTC Control Registers */
209#define PM8607_RTC1 (0xA0) 273#define PM8607_RTC1 (0xA0)
210#define PM8607_RTC_COUNTER1 (0xA1) 274#define PM8607_RTC_COUNTER1 (0xA1)
@@ -322,7 +386,7 @@ struct pm860x_chip {
322 struct regmap *regmap_companion; 386 struct regmap *regmap_companion;
323 387
324 int buck3_double; /* DVC ramp slope double */ 388 int buck3_double; /* DVC ramp slope double */
325 unsigned short companion_addr; 389 int companion_addr;
326 unsigned short osc_vote; 390 unsigned short osc_vote;
327 int id; 391 int id;
328 int irq_mode; 392 int irq_mode;
@@ -340,16 +404,12 @@ enum {
340}; 404};
341 405
342struct pm860x_backlight_pdata { 406struct pm860x_backlight_pdata {
343 int id;
344 int pwm; 407 int pwm;
345 int iset; 408 int iset;
346 unsigned long flags;
347}; 409};
348 410
349struct pm860x_led_pdata { 411struct pm860x_led_pdata {
350 int id;
351 int iset; 412 int iset;
352 unsigned long flags;
353}; 413};
354 414
355struct pm860x_rtc_pdata { 415struct pm860x_rtc_pdata {
@@ -370,7 +430,8 @@ struct pm860x_touch_pdata {
370}; 430};
371 431
372struct pm860x_power_pdata { 432struct pm860x_power_pdata {
373 unsigned fast_charge; /* charge current */ 433 int max_capacity;
434 int resistor;
374}; 435};
375 436
376struct pm860x_platform_data { 437struct pm860x_platform_data {
@@ -379,15 +440,30 @@ struct pm860x_platform_data {
379 struct pm860x_rtc_pdata *rtc; 440 struct pm860x_rtc_pdata *rtc;
380 struct pm860x_touch_pdata *touch; 441 struct pm860x_touch_pdata *touch;
381 struct pm860x_power_pdata *power; 442 struct pm860x_power_pdata *power;
382 struct regulator_init_data *regulator; 443 struct regulator_init_data *buck1;
383 444 struct regulator_init_data *buck2;
384 unsigned short companion_addr; /* I2C address of companion chip */ 445 struct regulator_init_data *buck3;
446 struct regulator_init_data *ldo1;
447 struct regulator_init_data *ldo2;
448 struct regulator_init_data *ldo3;
449 struct regulator_init_data *ldo4;
450 struct regulator_init_data *ldo5;
451 struct regulator_init_data *ldo6;
452 struct regulator_init_data *ldo7;
453 struct regulator_init_data *ldo8;
454 struct regulator_init_data *ldo9;
455 struct regulator_init_data *ldo10;
456 struct regulator_init_data *ldo12;
457 struct regulator_init_data *ldo_vibrator;
458 struct regulator_init_data *ldo14;
459 struct charger_desc *chg_desc;
460
461 int companion_addr; /* I2C address of companion chip */
385 int i2c_port; /* Controlled by GI2C or PI2C */ 462 int i2c_port; /* Controlled by GI2C or PI2C */
386 int irq_mode; /* Clear interrupt by read/write(0/1) */ 463 int irq_mode; /* Clear interrupt by read/write(0/1) */
387 int irq_base; /* IRQ base number of 88pm860x */ 464 int irq_base; /* IRQ base number of 88pm860x */
388 int num_leds; 465 int num_leds;
389 int num_backlights; 466 int num_backlights;
390 int num_regulators;
391}; 467};
392 468
393extern int pm8606_osc_enable(struct pm860x_chip *, unsigned short); 469extern int pm8606_osc_enable(struct pm860x_chip *, unsigned short);
@@ -408,8 +484,4 @@ extern int pm860x_page_bulk_write(struct i2c_client *, int, int,
408extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char, 484extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char,
409 unsigned char); 485 unsigned char);
410 486
411extern int pm860x_device_init(struct pm860x_chip *chip,
412 struct pm860x_platform_data *pdata) __devinit ;
413extern void pm860x_device_exit(struct pm860x_chip *chip) __devexit ;
414
415#endif /* __LINUX_MFD_88PM860X_H */ 487#endif /* __LINUX_MFD_88PM860X_H */