1
2
3
4
5
6
7
8
9
10 #ifndef __MFD_WM831X_PDATA_H__
11 #define __MFD_WM831X_PDATA_H__
12
13 struct wm831x;
14 struct regulator_init_data;
15
16 struct wm831x_backlight_pdata {
17 int isink;
18 int max_uA;
19 };
20
21 struct wm831x_backup_pdata {
22 int charger_enable;
23 int no_constant_voltage;
24 int vlim;
25 int ilim;
26 };
27
28 struct wm831x_battery_pdata {
29 int enable;
30 int fast_enable;
31 int off_mask;
32 int trickle_ilim;
33 int vsel;
34 int eoc_iterm;
35 int fast_ilim;
36 int timeout;
37 };
38
39
40
41
42
43
44
45
46
47
48
49 struct wm831x_buckv_pdata {
50 int dvs_control_src;
51 int dvs_init_state;
52 int dvs_state_gpio;
53 };
54
55
56
57
58 enum wm831x_status_src {
59 WM831X_STATUS_PRESERVE = 0,
60 WM831X_STATUS_OTP = 1,
61 WM831X_STATUS_POWER = 2,
62 WM831X_STATUS_CHARGER = 3,
63 WM831X_STATUS_MANUAL = 4,
64 };
65
66 struct wm831x_status_pdata {
67 enum wm831x_status_src default_src;
68 const char *name;
69 const char *default_trigger;
70 };
71
72 struct wm831x_touch_pdata {
73 int fivewire;
74 int isel;
75 int rpu;
76 int pressure;
77 unsigned int data_irq;
78 int data_irqf;
79 unsigned int pd_irq;
80 int pd_irqf;
81 };
82
83 enum wm831x_watchdog_action {
84 WM831X_WDOG_NONE = 0,
85 WM831X_WDOG_INTERRUPT = 1,
86 WM831X_WDOG_RESET = 2,
87 WM831X_WDOG_WAKE = 3,
88 };
89
90 struct wm831x_watchdog_pdata {
91 enum wm831x_watchdog_action primary, secondary;
92 int update_gpio;
93 unsigned int software:1;
94 };
95
96 #define WM831X_MAX_STATUS 2
97 #define WM831X_MAX_DCDC 4
98 #define WM831X_MAX_EPE 2
99 #define WM831X_MAX_LDO 11
100 #define WM831X_MAX_ISINK 2
101
102 #define WM831X_GPIO_CONFIGURE 0x10000
103 #define WM831X_GPIO_NUM 16
104
105 struct wm831x_pdata {
106
107 int wm831x_num;
108
109
110 int (*pre_init)(struct wm831x *wm831x);
111
112 int (*post_init)(struct wm831x *wm831x);
113
114
115 bool irq_cmos;
116
117
118 bool disable_touch;
119
120
121 bool soft_shutdown;
122
123 int irq_base;
124 int gpio_base;
125 int gpio_defaults[WM831X_GPIO_NUM];
126 struct wm831x_backlight_pdata *backlight;
127 struct wm831x_backup_pdata *backup;
128 struct wm831x_battery_pdata *battery;
129 struct wm831x_touch_pdata *touch;
130 struct wm831x_watchdog_pdata *watchdog;
131
132
133 struct wm831x_status_pdata *status[WM831X_MAX_STATUS];
134
135 struct regulator_init_data *dcdc[WM831X_MAX_DCDC];
136
137 struct regulator_init_data *epe[WM831X_MAX_EPE];
138
139 struct regulator_init_data *ldo[WM831X_MAX_LDO];
140
141 struct regulator_init_data *isink[WM831X_MAX_ISINK];
142 };
143
144 #endif