4 * Copyright (c) 2012-2014 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #include <linux/bug.h>
20 #include <linux/err.h>
21 #include <linux/gpio.h>
22 #include <linux/slab.h>
23 #include <linux/module.h>
25 #include <linux/regmap.h>
26 #include <linux/platform_device.h>
27 #include <linux/regulator/driver.h>
28 #include <linux/regulator/machine.h>
29 #include <linux/regulator/of_regulator.h>
30 #include <linux/of_gpio.h>
31 #include <linux/mfd/samsung/core.h>
32 #include <linux/mfd/samsung/s2mps11.h>
33 #include <linux/mfd/samsung/s2mps13.h>
34 #include <linux/mfd/samsung/s2mps14.h>
35 #include <linux/mfd/samsung/s2mpu02.h>
38 unsigned int rdev_num
;
46 enum sec_device_type dev_type
;
49 * One bit for each S2MPS13/S2MPS14/S2MPU02 regulator whether
50 * the suspend mode was enabled.
52 unsigned long long s2mps14_suspend_state
:50;
54 /* Array of size rdev_num with GPIO-s for external sleep control */
55 int *ext_control_gpio
;
58 static int get_ramp_delay(int ramp_delay
)
60 unsigned char cnt
= 0;
65 ramp_delay
= ramp_delay
>> 1;
77 static int s2mps11_regulator_set_voltage_time_sel(struct regulator_dev
*rdev
,
78 unsigned int old_selector
,
79 unsigned int new_selector
)
81 struct s2mps11_info
*s2mps11
= rdev_get_drvdata(rdev
);
82 unsigned int ramp_delay
= 0;
83 int old_volt
, new_volt
;
85 switch (rdev_get_id(rdev
)) {
87 ramp_delay
= s2mps11
->ramp_delay2
;
91 ramp_delay
= s2mps11
->ramp_delay34
;
94 ramp_delay
= s2mps11
->ramp_delay5
;
98 ramp_delay
= s2mps11
->ramp_delay16
;
103 ramp_delay
= s2mps11
->ramp_delay7810
;
106 ramp_delay
= s2mps11
->ramp_delay9
;
110 ramp_delay
= rdev
->desc
->ramp_delay
;
112 old_volt
= rdev
->desc
->min_uV
+ (rdev
->desc
->uV_step
* old_selector
);
113 new_volt
= rdev
->desc
->min_uV
+ (rdev
->desc
->uV_step
* new_selector
);
115 return DIV_ROUND_UP(abs(new_volt
- old_volt
), ramp_delay
);
118 static int s2mps11_set_ramp_delay(struct regulator_dev
*rdev
, int ramp_delay
)
120 struct s2mps11_info
*s2mps11
= rdev_get_drvdata(rdev
);
121 unsigned int ramp_val
, ramp_shift
, ramp_reg
= S2MPS11_REG_RAMP_BUCK
;
122 unsigned int ramp_enable
= 1, enable_shift
= 0;
125 switch (rdev_get_id(rdev
)) {
127 if (ramp_delay
> s2mps11
->ramp_delay16
)
128 s2mps11
->ramp_delay16
= ramp_delay
;
130 ramp_delay
= s2mps11
->ramp_delay16
;
132 ramp_shift
= S2MPS11_BUCK16_RAMP_SHIFT
;
135 enable_shift
= S2MPS11_BUCK2_RAMP_EN_SHIFT
;
141 s2mps11
->ramp_delay2
= ramp_delay
;
142 ramp_shift
= S2MPS11_BUCK2_RAMP_SHIFT
;
143 ramp_reg
= S2MPS11_REG_RAMP
;
146 enable_shift
= S2MPS11_BUCK3_RAMP_EN_SHIFT
;
152 if (ramp_delay
> s2mps11
->ramp_delay34
)
153 s2mps11
->ramp_delay34
= ramp_delay
;
155 ramp_delay
= s2mps11
->ramp_delay34
;
157 ramp_shift
= S2MPS11_BUCK34_RAMP_SHIFT
;
158 ramp_reg
= S2MPS11_REG_RAMP
;
161 enable_shift
= S2MPS11_BUCK4_RAMP_EN_SHIFT
;
167 if (ramp_delay
> s2mps11
->ramp_delay34
)
168 s2mps11
->ramp_delay34
= ramp_delay
;
170 ramp_delay
= s2mps11
->ramp_delay34
;
172 ramp_shift
= S2MPS11_BUCK34_RAMP_SHIFT
;
173 ramp_reg
= S2MPS11_REG_RAMP
;
176 s2mps11
->ramp_delay5
= ramp_delay
;
177 ramp_shift
= S2MPS11_BUCK5_RAMP_SHIFT
;
180 enable_shift
= S2MPS11_BUCK6_RAMP_EN_SHIFT
;
186 if (ramp_delay
> s2mps11
->ramp_delay16
)
187 s2mps11
->ramp_delay16
= ramp_delay
;
189 ramp_delay
= s2mps11
->ramp_delay16
;
191 ramp_shift
= S2MPS11_BUCK16_RAMP_SHIFT
;
196 if (ramp_delay
> s2mps11
->ramp_delay7810
)
197 s2mps11
->ramp_delay7810
= ramp_delay
;
199 ramp_delay
= s2mps11
->ramp_delay7810
;
201 ramp_shift
= S2MPS11_BUCK7810_RAMP_SHIFT
;
204 s2mps11
->ramp_delay9
= ramp_delay
;
205 ramp_shift
= S2MPS11_BUCK9_RAMP_SHIFT
;
214 /* Ramp delay can be enabled/disabled only for buck[2346] */
215 if ((rdev_get_id(rdev
) >= S2MPS11_BUCK2
&&
216 rdev_get_id(rdev
) <= S2MPS11_BUCK4
) ||
217 rdev_get_id(rdev
) == S2MPS11_BUCK6
) {
218 ret
= regmap_update_bits(rdev
->regmap
, S2MPS11_REG_RAMP
,
219 1 << enable_shift
, 1 << enable_shift
);
221 dev_err(&rdev
->dev
, "failed to enable ramp rate\n");
226 ramp_val
= get_ramp_delay(ramp_delay
);
228 return regmap_update_bits(rdev
->regmap
, ramp_reg
, 0x3 << ramp_shift
,
229 ramp_val
<< ramp_shift
);
232 return regmap_update_bits(rdev
->regmap
, S2MPS11_REG_RAMP
,
233 1 << enable_shift
, 0);
236 static struct regulator_ops s2mps11_ldo_ops
= {
237 .list_voltage
= regulator_list_voltage_linear
,
238 .map_voltage
= regulator_map_voltage_linear
,
239 .is_enabled
= regulator_is_enabled_regmap
,
240 .enable
= regulator_enable_regmap
,
241 .disable
= regulator_disable_regmap
,
242 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
243 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
244 .set_voltage_time_sel
= regulator_set_voltage_time_sel
,
247 static struct regulator_ops s2mps11_buck_ops
= {
248 .list_voltage
= regulator_list_voltage_linear
,
249 .map_voltage
= regulator_map_voltage_linear
,
250 .is_enabled
= regulator_is_enabled_regmap
,
251 .enable
= regulator_enable_regmap
,
252 .disable
= regulator_disable_regmap
,
253 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
254 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
255 .set_voltage_time_sel
= s2mps11_regulator_set_voltage_time_sel
,
256 .set_ramp_delay
= s2mps11_set_ramp_delay
,
259 #define regulator_desc_s2mps11_ldo(num, step) { \
261 .id = S2MPS11_LDO##num, \
262 .ops = &s2mps11_ldo_ops, \
263 .type = REGULATOR_VOLTAGE, \
264 .owner = THIS_MODULE, \
265 .min_uV = MIN_800_MV, \
267 .n_voltages = S2MPS11_LDO_N_VOLTAGES, \
268 .vsel_reg = S2MPS11_REG_L1CTRL + num - 1, \
269 .vsel_mask = S2MPS11_LDO_VSEL_MASK, \
270 .enable_reg = S2MPS11_REG_L1CTRL + num - 1, \
271 .enable_mask = S2MPS11_ENABLE_MASK \
274 #define regulator_desc_s2mps11_buck1_4(num) { \
275 .name = "BUCK"#num, \
276 .id = S2MPS11_BUCK##num, \
277 .ops = &s2mps11_buck_ops, \
278 .type = REGULATOR_VOLTAGE, \
279 .owner = THIS_MODULE, \
280 .min_uV = MIN_600_MV, \
281 .uV_step = STEP_6_25_MV, \
282 .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \
283 .ramp_delay = S2MPS11_RAMP_DELAY, \
284 .vsel_reg = S2MPS11_REG_B1CTRL2 + (num - 1) * 2, \
285 .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \
286 .enable_reg = S2MPS11_REG_B1CTRL1 + (num - 1) * 2, \
287 .enable_mask = S2MPS11_ENABLE_MASK \
290 #define regulator_desc_s2mps11_buck5 { \
292 .id = S2MPS11_BUCK5, \
293 .ops = &s2mps11_buck_ops, \
294 .type = REGULATOR_VOLTAGE, \
295 .owner = THIS_MODULE, \
296 .min_uV = MIN_600_MV, \
297 .uV_step = STEP_6_25_MV, \
298 .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \
299 .ramp_delay = S2MPS11_RAMP_DELAY, \
300 .vsel_reg = S2MPS11_REG_B5CTRL2, \
301 .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \
302 .enable_reg = S2MPS11_REG_B5CTRL1, \
303 .enable_mask = S2MPS11_ENABLE_MASK \
306 #define regulator_desc_s2mps11_buck6_10(num, min, step) { \
307 .name = "BUCK"#num, \
308 .id = S2MPS11_BUCK##num, \
309 .ops = &s2mps11_buck_ops, \
310 .type = REGULATOR_VOLTAGE, \
311 .owner = THIS_MODULE, \
314 .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \
315 .ramp_delay = S2MPS11_RAMP_DELAY, \
316 .vsel_reg = S2MPS11_REG_B6CTRL2 + (num - 6) * 2, \
317 .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \
318 .enable_reg = S2MPS11_REG_B6CTRL1 + (num - 6) * 2, \
319 .enable_mask = S2MPS11_ENABLE_MASK \
322 static const struct regulator_desc s2mps11_regulators
[] = {
323 regulator_desc_s2mps11_ldo(1, STEP_25_MV
),
324 regulator_desc_s2mps11_ldo(2, STEP_50_MV
),
325 regulator_desc_s2mps11_ldo(3, STEP_50_MV
),
326 regulator_desc_s2mps11_ldo(4, STEP_50_MV
),
327 regulator_desc_s2mps11_ldo(5, STEP_50_MV
),
328 regulator_desc_s2mps11_ldo(6, STEP_25_MV
),
329 regulator_desc_s2mps11_ldo(7, STEP_50_MV
),
330 regulator_desc_s2mps11_ldo(8, STEP_50_MV
),
331 regulator_desc_s2mps11_ldo(9, STEP_50_MV
),
332 regulator_desc_s2mps11_ldo(10, STEP_50_MV
),
333 regulator_desc_s2mps11_ldo(11, STEP_25_MV
),
334 regulator_desc_s2mps11_ldo(12, STEP_50_MV
),
335 regulator_desc_s2mps11_ldo(13, STEP_50_MV
),
336 regulator_desc_s2mps11_ldo(14, STEP_50_MV
),
337 regulator_desc_s2mps11_ldo(15, STEP_50_MV
),
338 regulator_desc_s2mps11_ldo(16, STEP_50_MV
),
339 regulator_desc_s2mps11_ldo(17, STEP_50_MV
),
340 regulator_desc_s2mps11_ldo(18, STEP_50_MV
),
341 regulator_desc_s2mps11_ldo(19, STEP_50_MV
),
342 regulator_desc_s2mps11_ldo(20, STEP_50_MV
),
343 regulator_desc_s2mps11_ldo(21, STEP_50_MV
),
344 regulator_desc_s2mps11_ldo(22, STEP_25_MV
),
345 regulator_desc_s2mps11_ldo(23, STEP_25_MV
),
346 regulator_desc_s2mps11_ldo(24, STEP_50_MV
),
347 regulator_desc_s2mps11_ldo(25, STEP_50_MV
),
348 regulator_desc_s2mps11_ldo(26, STEP_50_MV
),
349 regulator_desc_s2mps11_ldo(27, STEP_25_MV
),
350 regulator_desc_s2mps11_ldo(28, STEP_50_MV
),
351 regulator_desc_s2mps11_ldo(29, STEP_50_MV
),
352 regulator_desc_s2mps11_ldo(30, STEP_50_MV
),
353 regulator_desc_s2mps11_ldo(31, STEP_50_MV
),
354 regulator_desc_s2mps11_ldo(32, STEP_50_MV
),
355 regulator_desc_s2mps11_ldo(33, STEP_50_MV
),
356 regulator_desc_s2mps11_ldo(34, STEP_50_MV
),
357 regulator_desc_s2mps11_ldo(35, STEP_50_MV
),
358 regulator_desc_s2mps11_ldo(36, STEP_50_MV
),
359 regulator_desc_s2mps11_ldo(37, STEP_50_MV
),
360 regulator_desc_s2mps11_ldo(38, STEP_50_MV
),
361 regulator_desc_s2mps11_buck1_4(1),
362 regulator_desc_s2mps11_buck1_4(2),
363 regulator_desc_s2mps11_buck1_4(3),
364 regulator_desc_s2mps11_buck1_4(4),
365 regulator_desc_s2mps11_buck5
,
366 regulator_desc_s2mps11_buck6_10(6, MIN_600_MV
, STEP_6_25_MV
),
367 regulator_desc_s2mps11_buck6_10(7, MIN_600_MV
, STEP_6_25_MV
),
368 regulator_desc_s2mps11_buck6_10(8, MIN_600_MV
, STEP_6_25_MV
),
369 regulator_desc_s2mps11_buck6_10(9, MIN_3000_MV
, STEP_25_MV
),
370 regulator_desc_s2mps11_buck6_10(10, MIN_750_MV
, STEP_12_5_MV
),
373 static struct regulator_ops s2mps14_reg_ops
;
375 #define regulator_desc_s2mps13_ldo(num, min, step, min_sel) { \
377 .id = S2MPS13_LDO##num, \
378 .ops = &s2mps14_reg_ops, \
379 .type = REGULATOR_VOLTAGE, \
380 .owner = THIS_MODULE, \
383 .linear_min_sel = min_sel, \
384 .n_voltages = S2MPS14_LDO_N_VOLTAGES, \
385 .vsel_reg = S2MPS13_REG_L1CTRL + num - 1, \
386 .vsel_mask = S2MPS14_LDO_VSEL_MASK, \
387 .enable_reg = S2MPS13_REG_L1CTRL + num - 1, \
388 .enable_mask = S2MPS14_ENABLE_MASK \
391 #define regulator_desc_s2mps13_buck(num, min, step, min_sel) { \
392 .name = "BUCK"#num, \
393 .id = S2MPS13_BUCK##num, \
394 .ops = &s2mps14_reg_ops, \
395 .type = REGULATOR_VOLTAGE, \
396 .owner = THIS_MODULE, \
399 .linear_min_sel = min_sel, \
400 .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \
401 .ramp_delay = S2MPS13_BUCK_RAMP_DELAY, \
402 .vsel_reg = S2MPS13_REG_B1OUT + (num - 1) * 2, \
403 .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \
404 .enable_reg = S2MPS13_REG_B1CTRL + (num - 1) * 2, \
405 .enable_mask = S2MPS14_ENABLE_MASK \
408 static const struct regulator_desc s2mps13_regulators
[] = {
409 regulator_desc_s2mps13_ldo(1, MIN_800_MV
, STEP_12_5_MV
, 0x00),
410 regulator_desc_s2mps13_ldo(2, MIN_1400_MV
, STEP_50_MV
, 0x0C),
411 regulator_desc_s2mps13_ldo(3, MIN_1000_MV
, STEP_25_MV
, 0x08),
412 regulator_desc_s2mps13_ldo(4, MIN_800_MV
, STEP_12_5_MV
, 0x00),
413 regulator_desc_s2mps13_ldo(5, MIN_800_MV
, STEP_12_5_MV
, 0x00),
414 regulator_desc_s2mps13_ldo(6, MIN_800_MV
, STEP_12_5_MV
, 0x00),
415 regulator_desc_s2mps13_ldo(7, MIN_1000_MV
, STEP_25_MV
, 0x08),
416 regulator_desc_s2mps13_ldo(8, MIN_1000_MV
, STEP_25_MV
, 0x08),
417 regulator_desc_s2mps13_ldo(9, MIN_1000_MV
, STEP_25_MV
, 0x08),
418 regulator_desc_s2mps13_ldo(10, MIN_1400_MV
, STEP_50_MV
, 0x0C),
419 regulator_desc_s2mps13_ldo(11, MIN_800_MV
, STEP_25_MV
, 0x10),
420 regulator_desc_s2mps13_ldo(12, MIN_800_MV
, STEP_25_MV
, 0x10),
421 regulator_desc_s2mps13_ldo(13, MIN_800_MV
, STEP_25_MV
, 0x10),
422 regulator_desc_s2mps13_ldo(14, MIN_800_MV
, STEP_12_5_MV
, 0x00),
423 regulator_desc_s2mps13_ldo(15, MIN_800_MV
, STEP_12_5_MV
, 0x00),
424 regulator_desc_s2mps13_ldo(16, MIN_1400_MV
, STEP_50_MV
, 0x0C),
425 regulator_desc_s2mps13_ldo(17, MIN_1400_MV
, STEP_50_MV
, 0x0C),
426 regulator_desc_s2mps13_ldo(18, MIN_1000_MV
, STEP_25_MV
, 0x08),
427 regulator_desc_s2mps13_ldo(19, MIN_1000_MV
, STEP_25_MV
, 0x08),
428 regulator_desc_s2mps13_ldo(20, MIN_1400_MV
, STEP_50_MV
, 0x0C),
429 regulator_desc_s2mps13_ldo(21, MIN_1000_MV
, STEP_25_MV
, 0x08),
430 regulator_desc_s2mps13_ldo(22, MIN_1000_MV
, STEP_25_MV
, 0x08),
431 regulator_desc_s2mps13_ldo(23, MIN_800_MV
, STEP_12_5_MV
, 0x00),
432 regulator_desc_s2mps13_ldo(24, MIN_800_MV
, STEP_12_5_MV
, 0x00),
433 regulator_desc_s2mps13_ldo(25, MIN_1400_MV
, STEP_50_MV
, 0x0C),
434 regulator_desc_s2mps13_ldo(26, MIN_1400_MV
, STEP_50_MV
, 0x0C),
435 regulator_desc_s2mps13_ldo(27, MIN_1400_MV
, STEP_50_MV
, 0x0C),
436 regulator_desc_s2mps13_ldo(28, MIN_1000_MV
, STEP_25_MV
, 0x08),
437 regulator_desc_s2mps13_ldo(29, MIN_1400_MV
, STEP_50_MV
, 0x0C),
438 regulator_desc_s2mps13_ldo(30, MIN_1400_MV
, STEP_50_MV
, 0x0C),
439 regulator_desc_s2mps13_ldo(31, MIN_1000_MV
, STEP_25_MV
, 0x08),
440 regulator_desc_s2mps13_ldo(32, MIN_1000_MV
, STEP_25_MV
, 0x08),
441 regulator_desc_s2mps13_ldo(33, MIN_1400_MV
, STEP_50_MV
, 0x0C),
442 regulator_desc_s2mps13_ldo(34, MIN_1000_MV
, STEP_25_MV
, 0x08),
443 regulator_desc_s2mps13_ldo(35, MIN_1400_MV
, STEP_50_MV
, 0x0C),
444 regulator_desc_s2mps13_ldo(36, MIN_800_MV
, STEP_12_5_MV
, 0x00),
445 regulator_desc_s2mps13_ldo(37, MIN_1000_MV
, STEP_25_MV
, 0x08),
446 regulator_desc_s2mps13_ldo(38, MIN_1400_MV
, STEP_50_MV
, 0x0C),
447 regulator_desc_s2mps13_ldo(39, MIN_1000_MV
, STEP_25_MV
, 0x08),
448 regulator_desc_s2mps13_ldo(40, MIN_1400_MV
, STEP_50_MV
, 0x0C),
449 regulator_desc_s2mps13_buck(1, MIN_500_MV
, STEP_6_25_MV
, 0x10),
450 regulator_desc_s2mps13_buck(2, MIN_500_MV
, STEP_6_25_MV
, 0x10),
451 regulator_desc_s2mps13_buck(3, MIN_500_MV
, STEP_6_25_MV
, 0x10),
452 regulator_desc_s2mps13_buck(4, MIN_500_MV
, STEP_6_25_MV
, 0x10),
453 regulator_desc_s2mps13_buck(5, MIN_500_MV
, STEP_6_25_MV
, 0x10),
454 regulator_desc_s2mps13_buck(6, MIN_500_MV
, STEP_6_25_MV
, 0x10),
455 regulator_desc_s2mps13_buck(7, MIN_500_MV
, STEP_6_25_MV
, 0x10),
456 regulator_desc_s2mps13_buck(8, MIN_1000_MV
, STEP_12_5_MV
, 0x20),
457 regulator_desc_s2mps13_buck(9, MIN_1000_MV
, STEP_12_5_MV
, 0x20),
458 regulator_desc_s2mps13_buck(10, MIN_500_MV
, STEP_6_25_MV
, 0x10),
461 static int s2mps14_regulator_enable(struct regulator_dev
*rdev
)
463 struct s2mps11_info
*s2mps11
= rdev_get_drvdata(rdev
);
466 switch (s2mps11
->dev_type
) {
469 if (s2mps11
->s2mps14_suspend_state
& (1 << rdev_get_id(rdev
)))
470 val
= S2MPS14_ENABLE_SUSPEND
;
471 else if (gpio_is_valid(s2mps11
->ext_control_gpio
[rdev_get_id(rdev
)]))
472 val
= S2MPS14_ENABLE_EXT_CONTROL
;
474 val
= rdev
->desc
->enable_mask
;
477 if (s2mps11
->s2mps14_suspend_state
& (1 << rdev_get_id(rdev
)))
478 val
= S2MPU02_ENABLE_SUSPEND
;
480 val
= rdev
->desc
->enable_mask
;
486 return regmap_update_bits(rdev
->regmap
, rdev
->desc
->enable_reg
,
487 rdev
->desc
->enable_mask
, val
);
490 static int s2mps14_regulator_set_suspend_disable(struct regulator_dev
*rdev
)
493 unsigned int val
, state
;
494 struct s2mps11_info
*s2mps11
= rdev_get_drvdata(rdev
);
495 int rdev_id
= rdev_get_id(rdev
);
497 /* Below LDO should be always on or does not support suspend mode. */
498 switch (s2mps11
->dev_type
) {
505 state
= S2MPS14_ENABLE_SUSPEND
;
516 state
= S2MPU02_DISABLE_SUSPEND
;
519 state
= S2MPU02_ENABLE_SUSPEND
;
527 ret
= regmap_read(rdev
->regmap
, rdev
->desc
->enable_reg
, &val
);
531 s2mps11
->s2mps14_suspend_state
|= (1 << rdev_get_id(rdev
));
533 * Don't enable suspend mode if regulator is already disabled because
534 * this would effectively for a short time turn on the regulator after
536 * However we still want to toggle the suspend_state bit for regulator
537 * in case if it got enabled before suspending the system.
539 if (!(val
& rdev
->desc
->enable_mask
))
542 return regmap_update_bits(rdev
->regmap
, rdev
->desc
->enable_reg
,
543 rdev
->desc
->enable_mask
, state
);
546 static struct regulator_ops s2mps14_reg_ops
= {
547 .list_voltage
= regulator_list_voltage_linear
,
548 .map_voltage
= regulator_map_voltage_linear
,
549 .is_enabled
= regulator_is_enabled_regmap
,
550 .enable
= s2mps14_regulator_enable
,
551 .disable
= regulator_disable_regmap
,
552 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
553 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
554 .set_voltage_time_sel
= regulator_set_voltage_time_sel
,
555 .set_suspend_disable
= s2mps14_regulator_set_suspend_disable
,
558 #define regulator_desc_s2mps14_ldo(num, min, step) { \
560 .id = S2MPS14_LDO##num, \
561 .ops = &s2mps14_reg_ops, \
562 .type = REGULATOR_VOLTAGE, \
563 .owner = THIS_MODULE, \
566 .n_voltages = S2MPS14_LDO_N_VOLTAGES, \
567 .vsel_reg = S2MPS14_REG_L1CTRL + num - 1, \
568 .vsel_mask = S2MPS14_LDO_VSEL_MASK, \
569 .enable_reg = S2MPS14_REG_L1CTRL + num - 1, \
570 .enable_mask = S2MPS14_ENABLE_MASK \
573 #define regulator_desc_s2mps14_buck(num, min, step, min_sel) { \
574 .name = "BUCK"#num, \
575 .id = S2MPS14_BUCK##num, \
576 .ops = &s2mps14_reg_ops, \
577 .type = REGULATOR_VOLTAGE, \
578 .owner = THIS_MODULE, \
581 .n_voltages = S2MPS14_BUCK_N_VOLTAGES, \
582 .linear_min_sel = min_sel, \
583 .ramp_delay = S2MPS14_BUCK_RAMP_DELAY, \
584 .vsel_reg = S2MPS14_REG_B1CTRL2 + (num - 1) * 2, \
585 .vsel_mask = S2MPS14_BUCK_VSEL_MASK, \
586 .enable_reg = S2MPS14_REG_B1CTRL1 + (num - 1) * 2, \
587 .enable_mask = S2MPS14_ENABLE_MASK \
590 static const struct regulator_desc s2mps14_regulators
[] = {
591 regulator_desc_s2mps14_ldo(1, MIN_800_MV
, STEP_12_5_MV
),
592 regulator_desc_s2mps14_ldo(2, MIN_800_MV
, STEP_12_5_MV
),
593 regulator_desc_s2mps14_ldo(3, MIN_800_MV
, STEP_25_MV
),
594 regulator_desc_s2mps14_ldo(4, MIN_800_MV
, STEP_25_MV
),
595 regulator_desc_s2mps14_ldo(5, MIN_800_MV
, STEP_12_5_MV
),
596 regulator_desc_s2mps14_ldo(6, MIN_800_MV
, STEP_12_5_MV
),
597 regulator_desc_s2mps14_ldo(7, MIN_800_MV
, STEP_25_MV
),
598 regulator_desc_s2mps14_ldo(8, MIN_1800_MV
, STEP_25_MV
),
599 regulator_desc_s2mps14_ldo(9, MIN_800_MV
, STEP_12_5_MV
),
600 regulator_desc_s2mps14_ldo(10, MIN_800_MV
, STEP_12_5_MV
),
601 regulator_desc_s2mps14_ldo(11, MIN_800_MV
, STEP_25_MV
),
602 regulator_desc_s2mps14_ldo(12, MIN_1800_MV
, STEP_25_MV
),
603 regulator_desc_s2mps14_ldo(13, MIN_1800_MV
, STEP_25_MV
),
604 regulator_desc_s2mps14_ldo(14, MIN_1800_MV
, STEP_25_MV
),
605 regulator_desc_s2mps14_ldo(15, MIN_1800_MV
, STEP_25_MV
),
606 regulator_desc_s2mps14_ldo(16, MIN_1800_MV
, STEP_25_MV
),
607 regulator_desc_s2mps14_ldo(17, MIN_1800_MV
, STEP_25_MV
),
608 regulator_desc_s2mps14_ldo(18, MIN_1800_MV
, STEP_25_MV
),
609 regulator_desc_s2mps14_ldo(19, MIN_800_MV
, STEP_25_MV
),
610 regulator_desc_s2mps14_ldo(20, MIN_800_MV
, STEP_25_MV
),
611 regulator_desc_s2mps14_ldo(21, MIN_800_MV
, STEP_25_MV
),
612 regulator_desc_s2mps14_ldo(22, MIN_800_MV
, STEP_12_5_MV
),
613 regulator_desc_s2mps14_ldo(23, MIN_800_MV
, STEP_25_MV
),
614 regulator_desc_s2mps14_ldo(24, MIN_1800_MV
, STEP_25_MV
),
615 regulator_desc_s2mps14_ldo(25, MIN_1800_MV
, STEP_25_MV
),
616 regulator_desc_s2mps14_buck(1, MIN_600_MV
, STEP_6_25_MV
,
617 S2MPS14_BUCK1235_START_SEL
),
618 regulator_desc_s2mps14_buck(2, MIN_600_MV
, STEP_6_25_MV
,
619 S2MPS14_BUCK1235_START_SEL
),
620 regulator_desc_s2mps14_buck(3, MIN_600_MV
, STEP_6_25_MV
,
621 S2MPS14_BUCK1235_START_SEL
),
622 regulator_desc_s2mps14_buck(4, MIN_1400_MV
, STEP_12_5_MV
,
623 S2MPS14_BUCK4_START_SEL
),
624 regulator_desc_s2mps14_buck(5, MIN_600_MV
, STEP_6_25_MV
,
625 S2MPS14_BUCK1235_START_SEL
),
628 static int s2mps14_pmic_enable_ext_control(struct s2mps11_info
*s2mps11
,
629 struct regulator_dev
*rdev
)
631 return regmap_update_bits(rdev
->regmap
, rdev
->desc
->enable_reg
,
632 rdev
->desc
->enable_mask
, S2MPS14_ENABLE_EXT_CONTROL
);
635 static void s2mps14_pmic_dt_parse_ext_control_gpio(struct platform_device
*pdev
,
636 struct of_regulator_match
*rdata
, struct s2mps11_info
*s2mps11
)
638 int *gpio
= s2mps11
->ext_control_gpio
;
640 unsigned int valid_regulators
[3] = { S2MPS14_LDO10
, S2MPS14_LDO11
,
643 for (i
= 0; i
< ARRAY_SIZE(valid_regulators
); i
++) {
644 unsigned int reg
= valid_regulators
[i
];
646 if (!rdata
[reg
].init_data
|| !rdata
[reg
].of_node
)
649 gpio
[reg
] = of_get_named_gpio(rdata
[reg
].of_node
,
650 "samsung,ext-control-gpios", 0);
651 if (gpio_is_valid(gpio
[reg
]))
652 dev_dbg(&pdev
->dev
, "Using GPIO %d for ext-control over %d/%s\n",
653 gpio
[reg
], reg
, rdata
[reg
].name
);
657 static int s2mps11_pmic_dt_parse(struct platform_device
*pdev
,
658 struct of_regulator_match
*rdata
, struct s2mps11_info
*s2mps11
)
660 struct device_node
*reg_np
;
662 reg_np
= of_get_child_by_name(pdev
->dev
.parent
->of_node
, "regulators");
664 dev_err(&pdev
->dev
, "could not find regulators sub-node\n");
668 of_regulator_match(&pdev
->dev
, reg_np
, rdata
, s2mps11
->rdev_num
);
669 if (s2mps11
->dev_type
== S2MPS14X
)
670 s2mps14_pmic_dt_parse_ext_control_gpio(pdev
, rdata
, s2mps11
);
677 static int s2mpu02_set_ramp_delay(struct regulator_dev
*rdev
, int ramp_delay
)
679 unsigned int ramp_val
, ramp_shift
, ramp_reg
;
681 switch (rdev_get_id(rdev
)) {
683 ramp_shift
= S2MPU02_BUCK1_RAMP_SHIFT
;
686 ramp_shift
= S2MPU02_BUCK2_RAMP_SHIFT
;
689 ramp_shift
= S2MPU02_BUCK3_RAMP_SHIFT
;
692 ramp_shift
= S2MPU02_BUCK4_RAMP_SHIFT
;
697 ramp_reg
= S2MPU02_REG_RAMP1
;
698 ramp_val
= get_ramp_delay(ramp_delay
);
700 return regmap_update_bits(rdev
->regmap
, ramp_reg
,
701 S2MPU02_BUCK1234_RAMP_MASK
<< ramp_shift
,
702 ramp_val
<< ramp_shift
);
705 static struct regulator_ops s2mpu02_ldo_ops
= {
706 .list_voltage
= regulator_list_voltage_linear
,
707 .map_voltage
= regulator_map_voltage_linear
,
708 .is_enabled
= regulator_is_enabled_regmap
,
709 .enable
= s2mps14_regulator_enable
,
710 .disable
= regulator_disable_regmap
,
711 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
712 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
713 .set_voltage_time_sel
= regulator_set_voltage_time_sel
,
714 .set_suspend_disable
= s2mps14_regulator_set_suspend_disable
,
717 static struct regulator_ops s2mpu02_buck_ops
= {
718 .list_voltage
= regulator_list_voltage_linear
,
719 .map_voltage
= regulator_map_voltage_linear
,
720 .is_enabled
= regulator_is_enabled_regmap
,
721 .enable
= s2mps14_regulator_enable
,
722 .disable
= regulator_disable_regmap
,
723 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
724 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
725 .set_voltage_time_sel
= regulator_set_voltage_time_sel
,
726 .set_suspend_disable
= s2mps14_regulator_set_suspend_disable
,
727 .set_ramp_delay
= s2mpu02_set_ramp_delay
,
730 #define regulator_desc_s2mpu02_ldo1(num) { \
732 .id = S2MPU02_LDO##num, \
733 .ops = &s2mpu02_ldo_ops, \
734 .type = REGULATOR_VOLTAGE, \
735 .owner = THIS_MODULE, \
736 .min_uV = S2MPU02_LDO_MIN_900MV, \
737 .uV_step = S2MPU02_LDO_STEP_12_5MV, \
738 .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \
739 .n_voltages = S2MPU02_LDO_N_VOLTAGES, \
740 .vsel_reg = S2MPU02_REG_L1CTRL, \
741 .vsel_mask = S2MPU02_LDO_VSEL_MASK, \
742 .enable_reg = S2MPU02_REG_L1CTRL, \
743 .enable_mask = S2MPU02_ENABLE_MASK \
745 #define regulator_desc_s2mpu02_ldo2(num) { \
747 .id = S2MPU02_LDO##num, \
748 .ops = &s2mpu02_ldo_ops, \
749 .type = REGULATOR_VOLTAGE, \
750 .owner = THIS_MODULE, \
751 .min_uV = S2MPU02_LDO_MIN_1050MV, \
752 .uV_step = S2MPU02_LDO_STEP_25MV, \
753 .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \
754 .n_voltages = S2MPU02_LDO_N_VOLTAGES, \
755 .vsel_reg = S2MPU02_REG_L2CTRL1, \
756 .vsel_mask = S2MPU02_LDO_VSEL_MASK, \
757 .enable_reg = S2MPU02_REG_L2CTRL1, \
758 .enable_mask = S2MPU02_ENABLE_MASK \
760 #define regulator_desc_s2mpu02_ldo3(num) { \
762 .id = S2MPU02_LDO##num, \
763 .ops = &s2mpu02_ldo_ops, \
764 .type = REGULATOR_VOLTAGE, \
765 .owner = THIS_MODULE, \
766 .min_uV = S2MPU02_LDO_MIN_900MV, \
767 .uV_step = S2MPU02_LDO_STEP_12_5MV, \
768 .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \
769 .n_voltages = S2MPU02_LDO_N_VOLTAGES, \
770 .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
771 .vsel_mask = S2MPU02_LDO_VSEL_MASK, \
772 .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \
773 .enable_mask = S2MPU02_ENABLE_MASK \
775 #define regulator_desc_s2mpu02_ldo4(num) { \
777 .id = S2MPU02_LDO##num, \
778 .ops = &s2mpu02_ldo_ops, \
779 .type = REGULATOR_VOLTAGE, \
780 .owner = THIS_MODULE, \
781 .min_uV = S2MPU02_LDO_MIN_1050MV, \
782 .uV_step = S2MPU02_LDO_STEP_25MV, \
783 .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \
784 .n_voltages = S2MPU02_LDO_N_VOLTAGES, \
785 .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
786 .vsel_mask = S2MPU02_LDO_VSEL_MASK, \
787 .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \
788 .enable_mask = S2MPU02_ENABLE_MASK \
790 #define regulator_desc_s2mpu02_ldo5(num) { \
792 .id = S2MPU02_LDO##num, \
793 .ops = &s2mpu02_ldo_ops, \
794 .type = REGULATOR_VOLTAGE, \
795 .owner = THIS_MODULE, \
796 .min_uV = S2MPU02_LDO_MIN_1600MV, \
797 .uV_step = S2MPU02_LDO_STEP_50MV, \
798 .linear_min_sel = S2MPU02_LDO_GROUP3_START_SEL, \
799 .n_voltages = S2MPU02_LDO_N_VOLTAGES, \
800 .vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
801 .vsel_mask = S2MPU02_LDO_VSEL_MASK, \
802 .enable_reg = S2MPU02_REG_L3CTRL + num - 3, \
803 .enable_mask = S2MPU02_ENABLE_MASK \
806 #define regulator_desc_s2mpu02_buck1234(num) { \
807 .name = "BUCK"#num, \
808 .id = S2MPU02_BUCK##num, \
809 .ops = &s2mpu02_buck_ops, \
810 .type = REGULATOR_VOLTAGE, \
811 .owner = THIS_MODULE, \
812 .min_uV = S2MPU02_BUCK1234_MIN_600MV, \
813 .uV_step = S2MPU02_BUCK1234_STEP_6_25MV, \
814 .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \
815 .linear_min_sel = S2MPU02_BUCK1234_START_SEL, \
816 .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \
817 .vsel_reg = S2MPU02_REG_B1CTRL2 + (num - 1) * 2, \
818 .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \
819 .enable_reg = S2MPU02_REG_B1CTRL1 + (num - 1) * 2, \
820 .enable_mask = S2MPU02_ENABLE_MASK \
822 #define regulator_desc_s2mpu02_buck5(num) { \
823 .name = "BUCK"#num, \
824 .id = S2MPU02_BUCK##num, \
825 .ops = &s2mpu02_ldo_ops, \
826 .type = REGULATOR_VOLTAGE, \
827 .owner = THIS_MODULE, \
828 .min_uV = S2MPU02_BUCK5_MIN_1081_25MV, \
829 .uV_step = S2MPU02_BUCK5_STEP_6_25MV, \
830 .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \
831 .linear_min_sel = S2MPU02_BUCK5_START_SEL, \
832 .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \
833 .vsel_reg = S2MPU02_REG_B5CTRL2, \
834 .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \
835 .enable_reg = S2MPU02_REG_B5CTRL1, \
836 .enable_mask = S2MPU02_ENABLE_MASK \
838 #define regulator_desc_s2mpu02_buck6(num) { \
839 .name = "BUCK"#num, \
840 .id = S2MPU02_BUCK##num, \
841 .ops = &s2mpu02_ldo_ops, \
842 .type = REGULATOR_VOLTAGE, \
843 .owner = THIS_MODULE, \
844 .min_uV = S2MPU02_BUCK6_MIN_1700MV, \
845 .uV_step = S2MPU02_BUCK6_STEP_2_50MV, \
846 .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \
847 .linear_min_sel = S2MPU02_BUCK6_START_SEL, \
848 .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \
849 .vsel_reg = S2MPU02_REG_B6CTRL2, \
850 .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \
851 .enable_reg = S2MPU02_REG_B6CTRL1, \
852 .enable_mask = S2MPU02_ENABLE_MASK \
854 #define regulator_desc_s2mpu02_buck7(num) { \
855 .name = "BUCK"#num, \
856 .id = S2MPU02_BUCK##num, \
857 .ops = &s2mpu02_ldo_ops, \
858 .type = REGULATOR_VOLTAGE, \
859 .owner = THIS_MODULE, \
860 .min_uV = S2MPU02_BUCK7_MIN_900MV, \
861 .uV_step = S2MPU02_BUCK7_STEP_6_25MV, \
862 .n_voltages = S2MPU02_BUCK_N_VOLTAGES, \
863 .linear_min_sel = S2MPU02_BUCK7_START_SEL, \
864 .ramp_delay = S2MPU02_BUCK_RAMP_DELAY, \
865 .vsel_reg = S2MPU02_REG_B7CTRL2, \
866 .vsel_mask = S2MPU02_BUCK_VSEL_MASK, \
867 .enable_reg = S2MPU02_REG_B7CTRL1, \
868 .enable_mask = S2MPU02_ENABLE_MASK \
871 static const struct regulator_desc s2mpu02_regulators
[] = {
872 regulator_desc_s2mpu02_ldo1(1),
873 regulator_desc_s2mpu02_ldo2(2),
874 regulator_desc_s2mpu02_ldo4(3),
875 regulator_desc_s2mpu02_ldo5(4),
876 regulator_desc_s2mpu02_ldo4(5),
877 regulator_desc_s2mpu02_ldo3(6),
878 regulator_desc_s2mpu02_ldo3(7),
879 regulator_desc_s2mpu02_ldo4(8),
880 regulator_desc_s2mpu02_ldo5(9),
881 regulator_desc_s2mpu02_ldo3(10),
882 regulator_desc_s2mpu02_ldo4(11),
883 regulator_desc_s2mpu02_ldo5(12),
884 regulator_desc_s2mpu02_ldo5(13),
885 regulator_desc_s2mpu02_ldo5(14),
886 regulator_desc_s2mpu02_ldo5(15),
887 regulator_desc_s2mpu02_ldo5(16),
888 regulator_desc_s2mpu02_ldo4(17),
889 regulator_desc_s2mpu02_ldo5(18),
890 regulator_desc_s2mpu02_ldo3(19),
891 regulator_desc_s2mpu02_ldo4(20),
892 regulator_desc_s2mpu02_ldo5(21),
893 regulator_desc_s2mpu02_ldo5(22),
894 regulator_desc_s2mpu02_ldo5(23),
895 regulator_desc_s2mpu02_ldo4(24),
896 regulator_desc_s2mpu02_ldo5(25),
897 regulator_desc_s2mpu02_ldo4(26),
898 regulator_desc_s2mpu02_ldo5(27),
899 regulator_desc_s2mpu02_ldo5(28),
900 regulator_desc_s2mpu02_buck1234(1),
901 regulator_desc_s2mpu02_buck1234(2),
902 regulator_desc_s2mpu02_buck1234(3),
903 regulator_desc_s2mpu02_buck1234(4),
904 regulator_desc_s2mpu02_buck5(5),
905 regulator_desc_s2mpu02_buck6(6),
906 regulator_desc_s2mpu02_buck7(7),
909 static int s2mps11_pmic_probe(struct platform_device
*pdev
)
911 struct sec_pmic_dev
*iodev
= dev_get_drvdata(pdev
->dev
.parent
);
912 struct sec_platform_data
*pdata
= NULL
;
913 struct of_regulator_match
*rdata
= NULL
;
914 struct regulator_config config
= { };
915 struct s2mps11_info
*s2mps11
;
917 const struct regulator_desc
*regulators
;
919 s2mps11
= devm_kzalloc(&pdev
->dev
, sizeof(struct s2mps11_info
),
924 s2mps11
->dev_type
= platform_get_device_id(pdev
)->driver_data
;
925 switch (s2mps11
->dev_type
) {
927 s2mps11
->rdev_num
= ARRAY_SIZE(s2mps11_regulators
);
928 regulators
= s2mps11_regulators
;
931 s2mps11
->rdev_num
= ARRAY_SIZE(s2mps13_regulators
);
932 regulators
= s2mps13_regulators
;
935 s2mps11
->rdev_num
= ARRAY_SIZE(s2mps14_regulators
);
936 regulators
= s2mps14_regulators
;
939 s2mps11
->rdev_num
= ARRAY_SIZE(s2mpu02_regulators
);
940 regulators
= s2mpu02_regulators
;
943 dev_err(&pdev
->dev
, "Invalid device type: %u\n",
948 s2mps11
->ext_control_gpio
= devm_kmalloc(&pdev
->dev
,
949 sizeof(*s2mps11
->ext_control_gpio
) * s2mps11
->rdev_num
,
951 if (!s2mps11
->ext_control_gpio
)
954 * 0 is a valid GPIO so initialize all GPIO-s to negative value
955 * to indicate that external control won't be used for this regulator.
957 for (i
= 0; i
< s2mps11
->rdev_num
; i
++)
958 s2mps11
->ext_control_gpio
[i
] = -EINVAL
;
960 if (!iodev
->dev
->of_node
) {
962 pdata
= iodev
->pdata
;
965 dev_err(pdev
->dev
.parent
,
966 "Platform data or DT node not supplied\n");
971 rdata
= kzalloc(sizeof(*rdata
) * s2mps11
->rdev_num
, GFP_KERNEL
);
975 for (i
= 0; i
< s2mps11
->rdev_num
; i
++)
976 rdata
[i
].name
= regulators
[i
].name
;
978 ret
= s2mps11_pmic_dt_parse(pdev
, rdata
, s2mps11
);
983 platform_set_drvdata(pdev
, s2mps11
);
985 config
.dev
= &pdev
->dev
;
986 config
.regmap
= iodev
->regmap_pmic
;
987 config
.driver_data
= s2mps11
;
988 config
.ena_gpio_flags
= GPIOF_OUT_INIT_HIGH
;
989 config
.ena_gpio_initialized
= true;
990 for (i
= 0; i
< s2mps11
->rdev_num
; i
++) {
991 struct regulator_dev
*regulator
;
994 config
.init_data
= pdata
->regulators
[i
].initdata
;
995 config
.of_node
= pdata
->regulators
[i
].reg_node
;
997 config
.init_data
= rdata
[i
].init_data
;
998 config
.of_node
= rdata
[i
].of_node
;
1000 config
.ena_gpio
= s2mps11
->ext_control_gpio
[i
];
1002 regulator
= devm_regulator_register(&pdev
->dev
,
1003 ®ulators
[i
], &config
);
1004 if (IS_ERR(regulator
)) {
1005 ret
= PTR_ERR(regulator
);
1006 dev_err(&pdev
->dev
, "regulator init failed for %d\n",
1011 if (gpio_is_valid(s2mps11
->ext_control_gpio
[i
])) {
1012 ret
= s2mps14_pmic_enable_ext_control(s2mps11
,
1016 "failed to enable GPIO control over %s: %d\n",
1017 regulator
->desc
->name
, ret
);
1029 static const struct platform_device_id s2mps11_pmic_id
[] = {
1030 { "s2mps11-pmic", S2MPS11X
},
1031 { "s2mps13-pmic", S2MPS13X
},
1032 { "s2mps14-pmic", S2MPS14X
},
1033 { "s2mpu02-pmic", S2MPU02
},
1036 MODULE_DEVICE_TABLE(platform
, s2mps11_pmic_id
);
1038 static struct platform_driver s2mps11_pmic_driver
= {
1040 .name
= "s2mps11-pmic",
1042 .probe
= s2mps11_pmic_probe
,
1043 .id_table
= s2mps11_pmic_id
,
1046 static int __init
s2mps11_pmic_init(void)
1048 return platform_driver_register(&s2mps11_pmic_driver
);
1050 subsys_initcall(s2mps11_pmic_init
);
1052 static void __exit
s2mps11_pmic_exit(void)
1054 platform_driver_unregister(&s2mps11_pmic_driver
);
1056 module_exit(s2mps11_pmic_exit
);
1058 /* Module information */
1059 MODULE_AUTHOR("Sangbeom Kim <sbkim73@samsung.com>");
1060 MODULE_DESCRIPTION("SAMSUNG S2MPS11/S2MPS14/S2MPU02 Regulator Driver");
1061 MODULE_LICENSE("GPL");