blob: bf3a7019411e764a19b5ceb0dc259dfd76152369 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peng Fan78f22a52017-05-11 10:35:00 +08002/*
3 * Copyright 2017 NXP
4 *
5 * Peng Fan <peng.fan@nxp.com>
Peng Fan78f22a52017-05-11 10:35:00 +08006 */
7
Peng Fan54ee6a42015-08-07 16:43:45 +08008#include <fdtdec.h>
9#include <errno.h>
10#include <dm.h>
Simon Glass0f2af882020-05-10 11:40:05 -060011#include <log.h>
Peng Fan54ee6a42015-08-07 16:43:45 +080012#include <power/pmic.h>
13#include <power/regulator.h>
14#include <power/pfuze100_pmic.h>
15
16/**
17 * struct pfuze100_regulator_desc - regulator descriptor
18 *
19 * @name: Identify name for the regulator.
20 * @type: Indicates the regulator type.
21 * @uV_step: Voltage increase for each selector.
22 * @vsel_reg: Register for adjust regulator voltage for normal.
23 * @vsel_mask: Mask bit for setting regulator voltage for normal.
24 * @stby_reg: Register for adjust regulator voltage for standby.
25 * @stby_mask: Mask bit for setting regulator voltage for standby.
26 * @volt_table: Voltage mapping table (if table based mapping).
27 * @voltage: Current voltage for REGULATOR_TYPE_FIXED type regulator.
28 */
29struct pfuze100_regulator_desc {
30 char *name;
31 enum regulator_type type;
32 unsigned int uV_step;
33 unsigned int vsel_reg;
34 unsigned int vsel_mask;
35 unsigned int stby_reg;
36 unsigned int stby_mask;
37 unsigned int *volt_table;
38 unsigned int voltage;
39};
40
41/**
Simon Glassb75b15b2020-12-03 16:55:23 -070042 * struct pfuze100_regulator_plat - platform data for pfuze100
Peng Fan54ee6a42015-08-07 16:43:45 +080043 *
44 * @desc: Points the description entry of one regulator of pfuze100
45 */
Simon Glassb75b15b2020-12-03 16:55:23 -070046struct pfuze100_regulator_plat {
Peng Fan54ee6a42015-08-07 16:43:45 +080047 struct pfuze100_regulator_desc *desc;
48};
49
50#define PFUZE100_FIXED_REG(_name, base, vol) \
51 { \
52 .name = #_name, \
53 .type = REGULATOR_TYPE_FIXED, \
54 .voltage = (vol), \
55 }
56
57#define PFUZE100_SW_REG(_name, base, step) \
58 { \
59 .name = #_name, \
60 .type = REGULATOR_TYPE_BUCK, \
61 .uV_step = (step), \
62 .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
63 .vsel_mask = 0x3F, \
64 .stby_reg = (base) + PFUZE100_STBY_OFFSET, \
65 .stby_mask = 0x3F, \
66 }
67
68#define PFUZE100_SWB_REG(_name, base, mask, step, voltages) \
69 { \
70 .name = #_name, \
71 .type = REGULATOR_TYPE_BUCK, \
72 .uV_step = (step), \
73 .vsel_reg = (base), \
74 .vsel_mask = (mask), \
75 .volt_table = (voltages), \
76 }
77
78#define PFUZE100_SNVS_REG(_name, base, mask, voltages) \
79 { \
80 .name = #_name, \
81 .type = REGULATOR_TYPE_OTHER, \
82 .vsel_reg = (base), \
83 .vsel_mask = (mask), \
84 .volt_table = (voltages), \
85 }
86
87#define PFUZE100_VGEN_REG(_name, base, step) \
88 { \
89 .name = #_name, \
90 .type = REGULATOR_TYPE_LDO, \
91 .uV_step = (step), \
92 .vsel_reg = (base), \
93 .vsel_mask = 0xF, \
94 .stby_reg = (base), \
95 .stby_mask = 0x20, \
96 }
97
98#define PFUZE3000_VCC_REG(_name, base, step) \
99 { \
100 .name = #_name, \
101 .type = REGULATOR_TYPE_LDO, \
102 .uV_step = (step), \
103 .vsel_reg = (base), \
104 .vsel_mask = 0x3, \
105 .stby_reg = (base), \
106 .stby_mask = 0x20, \
107}
108
109#define PFUZE3000_SW1_REG(_name, base, step) \
110 { \
111 .name = #_name, \
112 .type = REGULATOR_TYPE_BUCK, \
113 .uV_step = (step), \
114 .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
115 .vsel_mask = 0x1F, \
116 .stby_reg = (base) + PFUZE100_STBY_OFFSET, \
117 .stby_mask = 0x1F, \
118 }
119
120#define PFUZE3000_SW2_REG(_name, base, step) \
121 { \
122 .name = #_name, \
123 .type = REGULATOR_TYPE_BUCK, \
124 .uV_step = (step), \
125 .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
126 .vsel_mask = 0x7, \
127 .stby_reg = (base) + PFUZE100_STBY_OFFSET, \
128 .stby_mask = 0x7, \
129 }
130
131#define PFUZE3000_SW3_REG(_name, base, step) \
132 { \
133 .name = #_name, \
134 .type = REGULATOR_TYPE_BUCK, \
135 .uV_step = (step), \
136 .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
137 .vsel_mask = 0xF, \
138 .stby_reg = (base) + PFUZE100_STBY_OFFSET, \
139 .stby_mask = 0xF, \
140 }
141
142static unsigned int pfuze100_swbst[] = {
143 5000000, 5050000, 5100000, 5150000
144};
145
146static unsigned int pfuze100_vsnvs[] = {
147 1000000, 1100000, 1200000, 1300000, 1500000, 1800000, 3000000, -1
148};
149
150static unsigned int pfuze3000_vsnvs[] = {
151 -1, -1, -1, -1, -1, -1, 3000000, -1
152};
153
154static unsigned int pfuze3000_sw2lo[] = {
155 1500000, 1550000, 1600000, 1650000, 1700000, 1750000, 1800000, 1850000
156};
157
158/* PFUZE100 */
159static struct pfuze100_regulator_desc pfuze100_regulators[] = {
160 PFUZE100_SW_REG(sw1ab, PFUZE100_SW1ABVOL, 25000),
161 PFUZE100_SW_REG(sw1c, PFUZE100_SW1CVOL, 25000),
162 PFUZE100_SW_REG(sw2, PFUZE100_SW2VOL, 25000),
163 PFUZE100_SW_REG(sw3a, PFUZE100_SW3AVOL, 25000),
164 PFUZE100_SW_REG(sw3b, PFUZE100_SW3BVOL, 25000),
165 PFUZE100_SW_REG(sw4, PFUZE100_SW4VOL, 25000),
166 PFUZE100_SWB_REG(swbst, PFUZE100_SWBSTCON1, 0x3, 50000, pfuze100_swbst),
167 PFUZE100_SNVS_REG(vsnvs, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
168 PFUZE100_FIXED_REG(vrefddr, PFUZE100_VREFDDRCON, 750000),
169 PFUZE100_VGEN_REG(vgen1, PFUZE100_VGEN1VOL, 50000),
170 PFUZE100_VGEN_REG(vgen2, PFUZE100_VGEN2VOL, 50000),
171 PFUZE100_VGEN_REG(vgen3, PFUZE100_VGEN3VOL, 100000),
172 PFUZE100_VGEN_REG(vgen4, PFUZE100_VGEN4VOL, 100000),
173 PFUZE100_VGEN_REG(vgen5, PFUZE100_VGEN5VOL, 100000),
174 PFUZE100_VGEN_REG(vgen6, PFUZE100_VGEN6VOL, 100000),
175};
176
177/* PFUZE200 */
178static struct pfuze100_regulator_desc pfuze200_regulators[] = {
179 PFUZE100_SW_REG(sw1ab, PFUZE100_SW1ABVOL, 25000),
180 PFUZE100_SW_REG(sw2, PFUZE100_SW2VOL, 25000),
181 PFUZE100_SW_REG(sw3a, PFUZE100_SW3AVOL, 25000),
182 PFUZE100_SW_REG(sw3b, PFUZE100_SW3BVOL, 25000),
183 PFUZE100_SWB_REG(swbst, PFUZE100_SWBSTCON1, 0x3, 50000, pfuze100_swbst),
184 PFUZE100_SNVS_REG(vsnvs, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
185 PFUZE100_FIXED_REG(vrefddr, PFUZE100_VREFDDRCON, 750000),
186 PFUZE100_VGEN_REG(vgen1, PFUZE100_VGEN1VOL, 50000),
187 PFUZE100_VGEN_REG(vgen2, PFUZE100_VGEN2VOL, 50000),
188 PFUZE100_VGEN_REG(vgen3, PFUZE100_VGEN3VOL, 100000),
189 PFUZE100_VGEN_REG(vgen4, PFUZE100_VGEN4VOL, 100000),
190 PFUZE100_VGEN_REG(vgen5, PFUZE100_VGEN5VOL, 100000),
191 PFUZE100_VGEN_REG(vgen6, PFUZE100_VGEN6VOL, 100000),
192};
193
194/* PFUZE3000 */
195static struct pfuze100_regulator_desc pfuze3000_regulators[] = {
196 PFUZE3000_SW1_REG(sw1a, PFUZE100_SW1ABVOL, 25000),
197 PFUZE3000_SW1_REG(sw1b, PFUZE100_SW1CVOL, 25000),
198 PFUZE100_SWB_REG(sw2, PFUZE100_SW2VOL, 0x7, 50000, pfuze3000_sw2lo),
199 PFUZE3000_SW3_REG(sw3, PFUZE100_SW3AVOL, 50000),
200 PFUZE100_SWB_REG(swbst, PFUZE100_SWBSTCON1, 0x3, 50000, pfuze100_swbst),
201 PFUZE100_SNVS_REG(vsnvs, PFUZE100_VSNVSVOL, 0x7, pfuze3000_vsnvs),
202 PFUZE100_FIXED_REG(vrefddr, PFUZE100_VREFDDRCON, 750000),
203 PFUZE100_VGEN_REG(vldo1, PFUZE100_VGEN1VOL, 100000),
204 PFUZE100_VGEN_REG(vldo2, PFUZE100_VGEN2VOL, 50000),
205 PFUZE3000_VCC_REG(vccsd, PFUZE100_VGEN3VOL, 150000),
206 PFUZE3000_VCC_REG(v33, PFUZE100_VGEN4VOL, 150000),
207 PFUZE100_VGEN_REG(vldo3, PFUZE100_VGEN5VOL, 100000),
208 PFUZE100_VGEN_REG(vldo4, PFUZE100_VGEN6VOL, 100000),
209};
210
211#define MODE(_id, _val, _name) { \
212 .id = _id, \
213 .register_value = _val, \
214 .name = _name, \
215}
216
217/* SWx Buck regulator mode */
218static struct dm_regulator_mode pfuze_sw_modes[] = {
219 MODE(OFF_OFF, OFF_OFF, "OFF_OFF"),
220 MODE(PWM_OFF, PWM_OFF, "PWM_OFF"),
221 MODE(PFM_OFF, PFM_OFF, "PFM_OFF"),
222 MODE(APS_OFF, APS_OFF, "APS_OFF"),
223 MODE(PWM_PWM, PWM_PWM, "PWM_PWM"),
224 MODE(PWM_APS, PWM_APS, "PWM_APS"),
225 MODE(APS_APS, APS_APS, "APS_APS"),
226 MODE(APS_PFM, APS_PFM, "APS_PFM"),
227 MODE(PWM_PFM, PWM_PFM, "PWM_PFM"),
228};
229
230/* Boost Buck regulator mode for normal operation */
231static struct dm_regulator_mode pfuze_swbst_modes[] = {
232 MODE(SWBST_MODE_OFF, SWBST_MODE_OFF , "SWBST_MODE_OFF"),
233 MODE(SWBST_MODE_PFM, SWBST_MODE_PFM, "SWBST_MODE_PFM"),
234 MODE(SWBST_MODE_AUTO, SWBST_MODE_AUTO, "SWBST_MODE_AUTO"),
235 MODE(SWBST_MODE_APS, SWBST_MODE_APS, "SWBST_MODE_APS"),
236};
237
238/* VGENx LDO regulator mode for normal operation */
239static struct dm_regulator_mode pfuze_ldo_modes[] = {
240 MODE(LDO_MODE_OFF, LDO_MODE_OFF, "LDO_MODE_OFF"),
241 MODE(LDO_MODE_ON, LDO_MODE_ON, "LDO_MODE_ON"),
242};
243
244static struct pfuze100_regulator_desc *se_desc(struct pfuze100_regulator_desc *desc,
245 int size,
246 const char *name)
247{
248 int i;
249
250 for (i = 0; i < size; desc++) {
251 if (!strcmp(desc->name, name))
252 return desc;
253 continue;
254 }
255
256 return NULL;
257}
258
259static int pfuze100_regulator_probe(struct udevice *dev)
260{
Simon Glass71fa5b42020-12-03 16:55:18 -0700261 struct dm_regulator_uclass_plat *uc_pdata;
Simon Glassb75b15b2020-12-03 16:55:23 -0700262 struct pfuze100_regulator_plat *plat = dev_get_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800263 struct pfuze100_regulator_desc *desc;
264
265 switch (dev_get_driver_data(dev_get_parent(dev))) {
266 case PFUZE100:
267 desc = se_desc(pfuze100_regulators,
268 ARRAY_SIZE(pfuze100_regulators),
269 dev->name);
270 break;
271 case PFUZE200:
272 desc = se_desc(pfuze200_regulators,
273 ARRAY_SIZE(pfuze200_regulators),
274 dev->name);
275 break;
276 case PFUZE3000:
277 desc = se_desc(pfuze3000_regulators,
278 ARRAY_SIZE(pfuze3000_regulators),
279 dev->name);
280 break;
281 default:
282 debug("Unsupported PFUZE\n");
283 return -EINVAL;
284 }
285 if (!desc) {
286 debug("Do not support regulator %s\n", dev->name);
287 return -EINVAL;
288 }
289
290 plat->desc = desc;
Simon Glass71fa5b42020-12-03 16:55:18 -0700291 uc_pdata = dev_get_uclass_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800292
293 uc_pdata->type = desc->type;
294 if (uc_pdata->type == REGULATOR_TYPE_BUCK) {
295 if (!strcmp(dev->name, "swbst")) {
296 uc_pdata->mode = pfuze_swbst_modes;
297 uc_pdata->mode_count = ARRAY_SIZE(pfuze_swbst_modes);
298 } else {
299 uc_pdata->mode = pfuze_sw_modes;
300 uc_pdata->mode_count = ARRAY_SIZE(pfuze_sw_modes);
301 }
302 } else if (uc_pdata->type == REGULATOR_TYPE_LDO) {
303 uc_pdata->mode = pfuze_ldo_modes;
304 uc_pdata->mode_count = ARRAY_SIZE(pfuze_ldo_modes);
305 } else {
306 uc_pdata->mode = NULL;
307 uc_pdata->mode_count = 0;
308 }
309
310 return 0;
311}
312
313static int pfuze100_regulator_mode(struct udevice *dev, int op, int *opmode)
314{
Peng Fandfaf3742017-05-11 10:35:01 +0800315 int val;
Simon Glassb75b15b2020-12-03 16:55:23 -0700316 struct pfuze100_regulator_plat *plat = dev_get_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800317 struct pfuze100_regulator_desc *desc = plat->desc;
318
319 if (op == PMIC_OP_GET) {
320 if (desc->type == REGULATOR_TYPE_BUCK) {
321 if (!strcmp(dev->name, "swbst")) {
322 val = pmic_reg_read(dev->parent,
323 desc->vsel_reg);
324 if (val < 0)
325 return val;
326
327 val &= SWBST_MODE_MASK;
328 val >>= SWBST_MODE_SHIFT;
329 *opmode = val;
330
331 return 0;
332 }
333 val = pmic_reg_read(dev->parent,
334 desc->vsel_reg +
335 PFUZE100_MODE_OFFSET);
336 if (val < 0)
337 return val;
338
339 val &= SW_MODE_MASK;
340 val >>= SW_MODE_SHIFT;
341 *opmode = val;
342
343 return 0;
344
345 } else if (desc->type == REGULATOR_TYPE_LDO) {
346 val = pmic_reg_read(dev->parent, desc->vsel_reg);
347 if (val < 0)
348 return val;
349
350 val &= LDO_MODE_MASK;
351 val >>= LDO_MODE_SHIFT;
352 *opmode = val;
353
354 return 0;
355 } else {
356 return -EINVAL;
357 }
358 }
359
360 if (desc->type == REGULATOR_TYPE_BUCK) {
361 if (!strcmp(dev->name, "swbst"))
362 return pmic_clrsetbits(dev->parent, desc->vsel_reg,
363 SWBST_MODE_MASK,
364 *opmode << SWBST_MODE_SHIFT);
365
366 val = pmic_clrsetbits(dev->parent,
367 desc->vsel_reg + PFUZE100_MODE_OFFSET,
368 SW_MODE_MASK,
369 *opmode << SW_MODE_SHIFT);
370
371 } else if (desc->type == REGULATOR_TYPE_LDO) {
372 val = pmic_clrsetbits(dev->parent, desc->vsel_reg,
373 LDO_MODE_MASK,
374 *opmode << LDO_MODE_SHIFT);
375 return val;
376 } else {
377 return -EINVAL;
378 }
379
380 return 0;
381}
382
383static int pfuze100_regulator_enable(struct udevice *dev, int op, bool *enable)
384{
Peng Fandfaf3742017-05-11 10:35:01 +0800385 int val;
Peng Fan54ee6a42015-08-07 16:43:45 +0800386 int ret, on_off;
Simon Glass71fa5b42020-12-03 16:55:18 -0700387 struct dm_regulator_uclass_plat *uc_pdata =
388 dev_get_uclass_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800389
390 if (op == PMIC_OP_GET) {
391 if (!strcmp(dev->name, "vrefddr")) {
392 val = pmic_reg_read(dev->parent, PFUZE100_VREFDDRCON);
393 if (val < 0)
394 return val;
395
396 if (val & VREFDDRCON_EN)
397 *enable = true;
398 else
399 *enable = false;
400 return 0;
401 }
402 ret = pfuze100_regulator_mode(dev, op, &on_off);
403 if (ret)
404 return ret;
405 switch (on_off) {
406 /* OFF_OFF, SWBST_MODE_OFF, LDO_MODE_OFF have same value */
407 case OFF_OFF:
408 *enable = false;
409 break;
410 default:
411 *enable = true;
412 break;
413 }
414 } else if (op == PMIC_OP_SET) {
415 if (!strcmp(dev->name, "vrefddr")) {
416 val = pmic_reg_read(dev->parent, PFUZE100_VREFDDRCON);
417 if (val < 0)
418 return val;
419
420 if (val & VREFDDRCON_EN)
421 return 0;
422 val |= VREFDDRCON_EN;
423
424 return pmic_reg_write(dev->parent, PFUZE100_VREFDDRCON,
425 val);
426 }
427
428 if (uc_pdata->type == REGULATOR_TYPE_LDO) {
429 on_off = *enable ? LDO_MODE_ON : LDO_MODE_OFF;
430 } else if (uc_pdata->type == REGULATOR_TYPE_BUCK) {
431 if (!strcmp(dev->name, "swbst"))
432 on_off = *enable ? SWBST_MODE_AUTO :
433 SWBST_MODE_OFF;
434 else
435 on_off = *enable ? APS_PFM : OFF_OFF;
436 } else {
437 return -EINVAL;
438 }
439
440 return pfuze100_regulator_mode(dev, op, &on_off);
441 }
442
443 return 0;
444}
445
446static int pfuze100_regulator_val(struct udevice *dev, int op, int *uV)
447{
448 int i;
Peng Fandfaf3742017-05-11 10:35:01 +0800449 int val;
Simon Glassb75b15b2020-12-03 16:55:23 -0700450 struct pfuze100_regulator_plat *plat = dev_get_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800451 struct pfuze100_regulator_desc *desc = plat->desc;
Simon Glass71fa5b42020-12-03 16:55:18 -0700452 struct dm_regulator_uclass_plat *uc_pdata =
453 dev_get_uclass_plat(dev);
Peng Fan54ee6a42015-08-07 16:43:45 +0800454
455 if (op == PMIC_OP_GET) {
456 *uV = 0;
457 if (uc_pdata->type == REGULATOR_TYPE_FIXED) {
458 *uV = desc->voltage;
459 } else if (desc->volt_table) {
460 val = pmic_reg_read(dev->parent, desc->vsel_reg);
461 if (val < 0)
462 return val;
463 val &= desc->vsel_mask;
464 *uV = desc->volt_table[val];
465 } else {
466 if (uc_pdata->min_uV < 0) {
467 debug("Need to provide min_uV in dts.\n");
468 return -EINVAL;
469 }
470 val = pmic_reg_read(dev->parent, desc->vsel_reg);
471 if (val < 0)
472 return val;
473 val &= desc->vsel_mask;
474 *uV = uc_pdata->min_uV + (int)val * desc->uV_step;
475 }
476
477 return 0;
478 }
479
480 if (uc_pdata->type == REGULATOR_TYPE_FIXED) {
481 debug("Set voltage for REGULATOR_TYPE_FIXED regulator\n");
482 return -EINVAL;
483 } else if (desc->volt_table) {
Trent Piephof2e81fa2019-04-04 21:52:04 +0000484 for (i = 0; i <= desc->vsel_mask; i++) {
Peng Fan54ee6a42015-08-07 16:43:45 +0800485 if (*uV == desc->volt_table[i])
486 break;
487 }
Trent Piephof2e81fa2019-04-04 21:52:04 +0000488 if (i == desc->vsel_mask + 1) {
Peng Fan54ee6a42015-08-07 16:43:45 +0800489 debug("Unsupported voltage %u\n", *uV);
490 return -EINVAL;
491 }
492
493 return pmic_clrsetbits(dev->parent, desc->vsel_reg,
494 desc->vsel_mask, i);
495 } else {
496 if (uc_pdata->min_uV < 0) {
497 debug("Need to provide min_uV in dts.\n");
498 return -EINVAL;
499 }
500 return pmic_clrsetbits(dev->parent, desc->vsel_reg,
501 desc->vsel_mask,
502 (*uV - uc_pdata->min_uV) / desc->uV_step);
503 }
504
505 return 0;
506}
507
508static int pfuze100_regulator_get_value(struct udevice *dev)
509{
510 int uV;
511 int ret;
512
513 ret = pfuze100_regulator_val(dev, PMIC_OP_GET, &uV);
514 if (ret)
515 return ret;
516
517 return uV;
518}
519
520static int pfuze100_regulator_set_value(struct udevice *dev, int uV)
521{
522 return pfuze100_regulator_val(dev, PMIC_OP_SET, &uV);
523}
524
Keerthyd726bb82017-06-13 09:53:50 +0530525static int pfuze100_regulator_get_enable(struct udevice *dev)
Peng Fan54ee6a42015-08-07 16:43:45 +0800526{
527 int ret;
528 bool enable = false;
529
530 ret = pfuze100_regulator_enable(dev, PMIC_OP_GET, &enable);
531 if (ret)
532 return ret;
533
534 return enable;
535}
536
537static int pfuze100_regulator_set_enable(struct udevice *dev, bool enable)
538{
539 return pfuze100_regulator_enable(dev, PMIC_OP_SET, &enable);
540}
541
542static int pfuze100_regulator_get_mode(struct udevice *dev)
543{
544 int mode;
545 int ret;
546
547 ret = pfuze100_regulator_mode(dev, PMIC_OP_GET, &mode);
548 if (ret)
549 return ret;
550
551 return mode;
552}
553
554static int pfuze100_regulator_set_mode(struct udevice *dev, int mode)
555{
556 return pfuze100_regulator_mode(dev, PMIC_OP_SET, &mode);
557}
558
559static const struct dm_regulator_ops pfuze100_regulator_ops = {
560 .get_value = pfuze100_regulator_get_value,
561 .set_value = pfuze100_regulator_set_value,
562 .get_enable = pfuze100_regulator_get_enable,
563 .set_enable = pfuze100_regulator_set_enable,
564 .get_mode = pfuze100_regulator_get_mode,
565 .set_mode = pfuze100_regulator_set_mode,
566};
567
568U_BOOT_DRIVER(pfuze100_regulator) = {
569 .name = "pfuze100_regulator",
570 .id = UCLASS_REGULATOR,
571 .ops = &pfuze100_regulator_ops,
572 .probe = pfuze100_regulator_probe,
Simon Glassb75b15b2020-12-03 16:55:23 -0700573 .plat_auto = sizeof(struct pfuze100_regulator_plat),
Peng Fan54ee6a42015-08-07 16:43:45 +0800574};