pfuze100.c 15 KB

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