1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
#ifndef _LINUX_PCF50606_H
#define _LINUX_PCF50606_H
/* public in-kernel pcf50606 api */
enum pcf50606_regulator_id {
PCF50606_REGULATOR_DCD,
PCF50606_REGULATOR_DCDE,
PCF50606_REGULATOR_DCUD,
PCF50606_REGULATOR_D1REG,
PCF50606_REGULATOR_D2REG,
PCF50606_REGULATOR_D3REG,
PCF50606_REGULATOR_LPREG,
PCF50606_REGULATOR_IOREG,
__NUM_PCF50606_REGULATORS
};
struct pcf50606_data;
/* This is an ugly construct on how to access the (currently single/global)
* pcf50606 handle from other code in the kernel. I didn't really come up with
* a more decent method of dynamically resolving this */
extern struct pcf50606_data *pcf50606_global;
extern void
pcf50606_go_standby(void);
extern void
pcf50606_gpo0_set(struct pcf50606_data *pcf, int on);
extern int
pcf50606_gpo0_get(struct pcf50606_data *pcf);
extern int
pcf50606_voltage_set(struct pcf50606_data *pcf,
enum pcf50606_regulator_id reg,
unsigned int millivolts);
extern unsigned int
pcf50606_voltage_get(struct pcf50606_data *pcf,
enum pcf50606_regulator_id reg);
extern int
pcf50606_onoff_get(struct pcf50606_data *pcf,
enum pcf50606_regulator_id reg);
extern int
pcf50606_onoff_set(struct pcf50606_data *pcf,
enum pcf50606_regulator_id reg, int on);
extern void
pcf50606_charge_fast(struct pcf50606_data *pcf, int on);
#define PMU_VRAIL_F_SUSPEND_ON 0x00000001 /* Remains on during suspend */
#define PMU_VRAIL_F_UNUSED 0x00000002 /* This rail is not used */
struct pmu_voltage_rail {
char *name;
unsigned int flags;
struct {
unsigned int init;
unsigned int max;
} voltage;
};
enum pmu_event {
PMU_EVT_NONE,
PMU_EVT_INSERT,
PMU_EVT_REMOVE,
__NUM_PMU_EVTS
};
typedef int pmu_cb(struct device *dev, unsigned int feature,
enum pmu_event event);
#define PCF50606_FEAT_EXTON 0x00000001 /* not yet supported */
#define PCF50606_FEAT_MBC 0x00000002
#define PCF50606_FEAT_BBC 0x00000004 /* not yet supported */
#define PCF50606_FEAT_TSC 0x00000008 /* not yet supported */
#define PCF50606_FEAT_WDT 0x00000010
#define PCF50606_FEAT_ACD 0x00000020
#define PCF50606_FEAT_RTC 0x00000040
#define PCF50606_FEAT_PWM 0x00000080
#define PCF50606_FEAT_CHGCUR 0x00000100
#define PCF50606_FEAT_BATVOLT 0x00000200
#define PCF50606_FEAT_BATTEMP 0x00000400
#define PCF50606_FEAT_PWM_BL 0x00000800
struct pcf50606_platform_data {
/* general */
unsigned int used_features;
unsigned int onkey_seconds_required;
/* voltage regulator related */
struct pmu_voltage_rail rails[__NUM_PCF50606_REGULATORS];
unsigned int used_regulators;
/* charger related */
unsigned int r_fix_batt;
unsigned int r_fix_batt_par;
unsigned int r_sense_milli;
/* backlight related */
unsigned int init_brightness;
struct {
u_int8_t mbcc3; /* charger voltage / current */
} charger;
pmu_cb *cb;
};
#endif
|