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