1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef __LINUX_MFD_MAX8998_H
18 #define __LINUX_MFD_MAX8998_H
19
20 #include <linux/regulator/consumer.h>
21
22
23 enum max8998_regulators {
24 MAX8997_LDO1 = 0,
25 MAX8997_LDO2,
26 MAX8997_LDO3,
27 MAX8997_LDO4,
28 MAX8997_LDO5,
29 MAX8997_LDO6,
30 MAX8997_LDO7,
31 MAX8997_LDO8,
32 MAX8997_LDO9,
33 MAX8997_LDO10,
34 MAX8997_LDO11,
35 MAX8997_LDO12,
36 MAX8997_LDO13,
37 MAX8997_LDO14,
38 MAX8997_LDO15,
39 MAX8997_LDO16,
40 MAX8997_LDO17,
41 MAX8997_LDO18,
42 MAX8997_LDO21,
43 MAX8997_BUCK1,
44 MAX8997_BUCK2,
45 MAX8997_BUCK3,
46 MAX8997_BUCK4,
47 MAX8997_BUCK5,
48 MAX8997_BUCK6,
49 MAX8997_BUCK7,
50 MAX8997_EN32KHZ_AP,
51 MAX8997_EN32KHZ_CP,
52 MAX8997_ENVICHG,
53 MAX8997_ESAFEOUT1,
54 MAX8997_ESAFEOUT2,
55 MAX8997_CHARGER_CV,
56 MAX8997_CHARGER,
57 MAX8997_CHARGER_TOPOFF,
58
59 MAX8997_REG_MAX,
60 };
61
62 struct max8997_regulator_data {
63 int id;
64 struct regulator_init_data *initdata;
65 struct device_node *reg_node;
66 };
67
68 struct max8997_muic_reg_data {
69 u8 addr;
70 u8 data;
71 };
72
73
74
75
76
77
78
79 struct max8997_muic_platform_data {
80 struct max8997_muic_reg_data *init_data;
81 int num_init_data;
82
83
84 int detcable_delay_ms;
85
86
87
88
89
90 int path_usb;
91 int path_uart;
92 };
93
94 enum max8997_haptic_motor_type {
95 MAX8997_HAPTIC_ERM,
96 MAX8997_HAPTIC_LRA,
97 };
98
99 enum max8997_haptic_pulse_mode {
100 MAX8997_EXTERNAL_MODE,
101 MAX8997_INTERNAL_MODE,
102 };
103
104 enum max8997_haptic_pwm_divisor {
105 MAX8997_PWM_DIVISOR_32,
106 MAX8997_PWM_DIVISOR_64,
107 MAX8997_PWM_DIVISOR_128,
108 MAX8997_PWM_DIVISOR_256,
109 };
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 struct max8997_haptic_platform_data {
131 unsigned int pwm_channel_id;
132 unsigned int pwm_period;
133
134 enum max8997_haptic_motor_type type;
135 enum max8997_haptic_pulse_mode mode;
136 enum max8997_haptic_pwm_divisor pwm_divisor;
137
138 unsigned int internal_mode_pattern;
139 unsigned int pattern_cycle;
140 unsigned int pattern_signal_period;
141 };
142
143 enum max8997_led_mode {
144 MAX8997_NONE,
145 MAX8997_FLASH_MODE,
146 MAX8997_MOVIE_MODE,
147 MAX8997_FLASH_PIN_CONTROL_MODE,
148 MAX8997_MOVIE_PIN_CONTROL_MODE,
149 };
150
151
152
153
154
155
156
157
158
159
160 struct max8997_led_platform_data {
161 enum max8997_led_mode mode[2];
162 u8 brightness[2];
163 };
164
165 struct max8997_platform_data {
166
167 int ono;
168
169
170 struct max8997_regulator_data *regulators;
171 int num_regulators;
172
173
174
175
176
177
178
179
180
181
182
183 bool ignore_gpiodvs_side_effect;
184 int buck125_gpios[3];
185 int buck125_default_idx;
186 unsigned int buck1_voltage[8];
187 bool buck1_gpiodvs;
188 unsigned int buck2_voltage[8];
189 bool buck2_gpiodvs;
190 unsigned int buck5_voltage[8];
191 bool buck5_gpiodvs;
192
193
194
195 int eoc_mA;
196
197 int timeout;
198
199
200 struct max8997_muic_platform_data *muic_pdata;
201
202
203 struct max8997_haptic_platform_data *haptic_pdata;
204
205
206
207 struct max8997_led_platform_data *led_pdata;
208 };
209
210 #endif