ab8500.c 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) ST-Ericsson SA 2010
  4. *
  5. * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
  6. * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
  7. * Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson
  8. *
  9. * AB8500 peripheral regulators
  10. *
  11. * AB8500 supports the following regulators:
  12. * VAUX1/2/3, VINTCORE, VTVOUT, VUSB, VAUDIO, VAMIC1/2, VDMIC, VANA
  13. *
  14. * AB8505 supports the following regulators:
  15. * VAUX1/2/3/4/5/6, VINTCORE, VADC, VUSB, VAUDIO, VAMIC1/2, VDMIC, VANA
  16. */
  17. #include <linux/init.h>
  18. #include <linux/kernel.h>
  19. #include <linux/module.h>
  20. #include <linux/err.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/mfd/abx500.h>
  23. #include <linux/mfd/abx500/ab8500.h>
  24. #include <linux/of.h>
  25. #include <linux/regulator/of_regulator.h>
  26. #include <linux/regulator/driver.h>
  27. #include <linux/regulator/machine.h>
  28. #include <linux/regulator/ab8500.h>
  29. #include <linux/slab.h>
  30. /**
  31. * struct ab8500_shared_mode - is used when mode is shared between
  32. * two regulators.
  33. * @shared_regulator: pointer to the other sharing regulator
  34. * @lp_mode_req: low power mode requested by this regulator
  35. */
  36. struct ab8500_shared_mode {
  37. struct ab8500_regulator_info *shared_regulator;
  38. bool lp_mode_req;
  39. };
  40. /**
  41. * struct ab8500_regulator_info - ab8500 regulator information
  42. * @dev: device pointer
  43. * @desc: regulator description
  44. * @shared_mode: used when mode is shared between two regulators
  45. * @load_lp_uA: maximum load in idle (low power) mode
  46. * @update_bank: bank to control on/off
  47. * @update_reg: register to control on/off
  48. * @update_mask: mask to enable/disable and set mode of regulator
  49. * @update_val: bits holding the regulator current mode
  50. * @update_val_idle: bits to enable the regulator in idle (low power) mode
  51. * @update_val_normal: bits to enable the regulator in normal (high power) mode
  52. * @mode_bank: bank with location of mode register
  53. * @mode_reg: mode register
  54. * @mode_mask: mask for setting mode
  55. * @mode_val_idle: mode setting for low power
  56. * @mode_val_normal: mode setting for normal power
  57. * @voltage_bank: bank to control regulator voltage
  58. * @voltage_reg: register to control regulator voltage
  59. * @voltage_mask: mask to control regulator voltage
  60. */
  61. struct ab8500_regulator_info {
  62. struct device *dev;
  63. struct regulator_desc desc;
  64. struct ab8500_shared_mode *shared_mode;
  65. int load_lp_uA;
  66. u8 update_bank;
  67. u8 update_reg;
  68. u8 update_mask;
  69. u8 update_val;
  70. u8 update_val_idle;
  71. u8 update_val_normal;
  72. u8 mode_bank;
  73. u8 mode_reg;
  74. u8 mode_mask;
  75. u8 mode_val_idle;
  76. u8 mode_val_normal;
  77. u8 voltage_bank;
  78. u8 voltage_reg;
  79. u8 voltage_mask;
  80. struct {
  81. u8 voltage_limit;
  82. u8 voltage_bank;
  83. u8 voltage_reg;
  84. u8 voltage_mask;
  85. } expand_register;
  86. };
  87. /* voltage tables for the vauxn/vintcore supplies */
  88. static const unsigned int ldo_vauxn_voltages[] = {
  89. 1100000,
  90. 1200000,
  91. 1300000,
  92. 1400000,
  93. 1500000,
  94. 1800000,
  95. 1850000,
  96. 1900000,
  97. 2500000,
  98. 2650000,
  99. 2700000,
  100. 2750000,
  101. 2800000,
  102. 2900000,
  103. 3000000,
  104. 3300000,
  105. };
  106. static const unsigned int ldo_vaux3_voltages[] = {
  107. 1200000,
  108. 1500000,
  109. 1800000,
  110. 2100000,
  111. 2500000,
  112. 2750000,
  113. 2790000,
  114. 2910000,
  115. };
  116. static const unsigned int ldo_vaux56_voltages[] = {
  117. 1800000,
  118. 1050000,
  119. 1100000,
  120. 1200000,
  121. 1500000,
  122. 2200000,
  123. 2500000,
  124. 2790000,
  125. };
  126. static const unsigned int ldo_vintcore_voltages[] = {
  127. 1200000,
  128. 1225000,
  129. 1250000,
  130. 1275000,
  131. 1300000,
  132. 1325000,
  133. 1350000,
  134. };
  135. static const unsigned int ldo_sdio_voltages[] = {
  136. 1160000,
  137. 1050000,
  138. 1100000,
  139. 1500000,
  140. 1800000,
  141. 2200000,
  142. 2910000,
  143. 3050000,
  144. };
  145. static const unsigned int fixed_1200000_voltage[] = {
  146. 1200000,
  147. };
  148. static const unsigned int fixed_1800000_voltage[] = {
  149. 1800000,
  150. };
  151. static const unsigned int fixed_2000000_voltage[] = {
  152. 2000000,
  153. };
  154. static const unsigned int fixed_2050000_voltage[] = {
  155. 2050000,
  156. };
  157. static const unsigned int fixed_3300000_voltage[] = {
  158. 3300000,
  159. };
  160. static const unsigned int ldo_vana_voltages[] = {
  161. 1050000,
  162. 1075000,
  163. 1100000,
  164. 1125000,
  165. 1150000,
  166. 1175000,
  167. 1200000,
  168. 1225000,
  169. };
  170. static const unsigned int ldo_vaudio_voltages[] = {
  171. 2000000,
  172. 2100000,
  173. 2200000,
  174. 2300000,
  175. 2400000,
  176. 2500000,
  177. 2600000,
  178. 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */
  179. };
  180. static const unsigned int ldo_vdmic_voltages[] = {
  181. 1800000,
  182. 1900000,
  183. 2000000,
  184. 2850000,
  185. };
  186. static DEFINE_MUTEX(shared_mode_mutex);
  187. static struct ab8500_shared_mode ldo_anamic1_shared;
  188. static struct ab8500_shared_mode ldo_anamic2_shared;
  189. static int ab8500_regulator_enable(struct regulator_dev *rdev)
  190. {
  191. int ret;
  192. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  193. if (info == NULL) {
  194. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  195. return -EINVAL;
  196. }
  197. ret = abx500_mask_and_set_register_interruptible(info->dev,
  198. info->update_bank, info->update_reg,
  199. info->update_mask, info->update_val);
  200. if (ret < 0) {
  201. dev_err(rdev_get_dev(rdev),
  202. "couldn't set enable bits for regulator\n");
  203. return ret;
  204. }
  205. dev_vdbg(rdev_get_dev(rdev),
  206. "%s-enable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
  207. info->desc.name, info->update_bank, info->update_reg,
  208. info->update_mask, info->update_val);
  209. return ret;
  210. }
  211. static int ab8500_regulator_disable(struct regulator_dev *rdev)
  212. {
  213. int ret;
  214. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  215. if (info == NULL) {
  216. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  217. return -EINVAL;
  218. }
  219. ret = abx500_mask_and_set_register_interruptible(info->dev,
  220. info->update_bank, info->update_reg,
  221. info->update_mask, 0x0);
  222. if (ret < 0) {
  223. dev_err(rdev_get_dev(rdev),
  224. "couldn't set disable bits for regulator\n");
  225. return ret;
  226. }
  227. dev_vdbg(rdev_get_dev(rdev),
  228. "%s-disable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
  229. info->desc.name, info->update_bank, info->update_reg,
  230. info->update_mask, 0x0);
  231. return ret;
  232. }
  233. static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
  234. {
  235. int ret;
  236. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  237. u8 regval;
  238. if (info == NULL) {
  239. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  240. return -EINVAL;
  241. }
  242. ret = abx500_get_register_interruptible(info->dev,
  243. info->update_bank, info->update_reg, &regval);
  244. if (ret < 0) {
  245. dev_err(rdev_get_dev(rdev),
  246. "couldn't read 0x%x register\n", info->update_reg);
  247. return ret;
  248. }
  249. dev_vdbg(rdev_get_dev(rdev),
  250. "%s-is_enabled (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
  251. " 0x%x\n",
  252. info->desc.name, info->update_bank, info->update_reg,
  253. info->update_mask, regval);
  254. if (regval & info->update_mask)
  255. return 1;
  256. else
  257. return 0;
  258. }
  259. static unsigned int ab8500_regulator_get_optimum_mode(
  260. struct regulator_dev *rdev, int input_uV,
  261. int output_uV, int load_uA)
  262. {
  263. unsigned int mode;
  264. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  265. if (info == NULL) {
  266. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  267. return -EINVAL;
  268. }
  269. if (load_uA <= info->load_lp_uA)
  270. mode = REGULATOR_MODE_IDLE;
  271. else
  272. mode = REGULATOR_MODE_NORMAL;
  273. return mode;
  274. }
  275. static int ab8500_regulator_set_mode(struct regulator_dev *rdev,
  276. unsigned int mode)
  277. {
  278. int ret = 0;
  279. u8 bank, reg, mask, val;
  280. bool lp_mode_req = false;
  281. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  282. if (info == NULL) {
  283. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  284. return -EINVAL;
  285. }
  286. if (info->mode_mask) {
  287. bank = info->mode_bank;
  288. reg = info->mode_reg;
  289. mask = info->mode_mask;
  290. } else {
  291. bank = info->update_bank;
  292. reg = info->update_reg;
  293. mask = info->update_mask;
  294. }
  295. if (info->shared_mode)
  296. mutex_lock(&shared_mode_mutex);
  297. switch (mode) {
  298. case REGULATOR_MODE_NORMAL:
  299. if (info->shared_mode)
  300. lp_mode_req = false;
  301. if (info->mode_mask)
  302. val = info->mode_val_normal;
  303. else
  304. val = info->update_val_normal;
  305. break;
  306. case REGULATOR_MODE_IDLE:
  307. if (info->shared_mode) {
  308. struct ab8500_regulator_info *shared_regulator;
  309. shared_regulator = info->shared_mode->shared_regulator;
  310. if (!shared_regulator->shared_mode->lp_mode_req) {
  311. /* Other regulator prevent LP mode */
  312. info->shared_mode->lp_mode_req = true;
  313. goto out_unlock;
  314. }
  315. lp_mode_req = true;
  316. }
  317. if (info->mode_mask)
  318. val = info->mode_val_idle;
  319. else
  320. val = info->update_val_idle;
  321. break;
  322. default:
  323. ret = -EINVAL;
  324. goto out_unlock;
  325. }
  326. if (info->mode_mask || ab8500_regulator_is_enabled(rdev)) {
  327. ret = abx500_mask_and_set_register_interruptible(info->dev,
  328. bank, reg, mask, val);
  329. if (ret < 0) {
  330. dev_err(rdev_get_dev(rdev),
  331. "couldn't set regulator mode\n");
  332. goto out_unlock;
  333. }
  334. dev_vdbg(rdev_get_dev(rdev),
  335. "%s-set_mode (bank, reg, mask, value): "
  336. "0x%x, 0x%x, 0x%x, 0x%x\n",
  337. info->desc.name, bank, reg,
  338. mask, val);
  339. }
  340. if (!info->mode_mask)
  341. info->update_val = val;
  342. if (info->shared_mode)
  343. info->shared_mode->lp_mode_req = lp_mode_req;
  344. out_unlock:
  345. if (info->shared_mode)
  346. mutex_unlock(&shared_mode_mutex);
  347. return ret;
  348. }
  349. static unsigned int ab8500_regulator_get_mode(struct regulator_dev *rdev)
  350. {
  351. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  352. int ret;
  353. u8 val;
  354. u8 val_normal;
  355. u8 val_idle;
  356. if (info == NULL) {
  357. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  358. return -EINVAL;
  359. }
  360. /* Need special handling for shared mode */
  361. if (info->shared_mode) {
  362. if (info->shared_mode->lp_mode_req)
  363. return REGULATOR_MODE_IDLE;
  364. else
  365. return REGULATOR_MODE_NORMAL;
  366. }
  367. if (info->mode_mask) {
  368. /* Dedicated register for handling mode */
  369. ret = abx500_get_register_interruptible(info->dev,
  370. info->mode_bank, info->mode_reg, &val);
  371. val = val & info->mode_mask;
  372. val_normal = info->mode_val_normal;
  373. val_idle = info->mode_val_idle;
  374. } else {
  375. /* Mode register same as enable register */
  376. val = info->update_val;
  377. val_normal = info->update_val_normal;
  378. val_idle = info->update_val_idle;
  379. }
  380. if (val == val_normal)
  381. ret = REGULATOR_MODE_NORMAL;
  382. else if (val == val_idle)
  383. ret = REGULATOR_MODE_IDLE;
  384. else
  385. ret = -EINVAL;
  386. return ret;
  387. }
  388. static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
  389. {
  390. int ret, voltage_shift;
  391. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  392. u8 regval;
  393. if (info == NULL) {
  394. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  395. return -EINVAL;
  396. }
  397. voltage_shift = ffs(info->voltage_mask) - 1;
  398. ret = abx500_get_register_interruptible(info->dev,
  399. info->voltage_bank, info->voltage_reg, &regval);
  400. if (ret < 0) {
  401. dev_err(rdev_get_dev(rdev),
  402. "couldn't read voltage reg for regulator\n");
  403. return ret;
  404. }
  405. dev_vdbg(rdev_get_dev(rdev),
  406. "%s-get_voltage (bank, reg, mask, shift, value): "
  407. "0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n",
  408. info->desc.name, info->voltage_bank,
  409. info->voltage_reg, info->voltage_mask,
  410. voltage_shift, regval);
  411. return (regval & info->voltage_mask) >> voltage_shift;
  412. }
  413. static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,
  414. unsigned selector)
  415. {
  416. int ret, voltage_shift;
  417. struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
  418. u8 regval;
  419. if (info == NULL) {
  420. dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
  421. return -EINVAL;
  422. }
  423. voltage_shift = ffs(info->voltage_mask) - 1;
  424. /* set the registers for the request */
  425. regval = (u8)selector << voltage_shift;
  426. ret = abx500_mask_and_set_register_interruptible(info->dev,
  427. info->voltage_bank, info->voltage_reg,
  428. info->voltage_mask, regval);
  429. if (ret < 0)
  430. dev_err(rdev_get_dev(rdev),
  431. "couldn't set voltage reg for regulator\n");
  432. dev_vdbg(rdev_get_dev(rdev),
  433. "%s-set_voltage (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
  434. " 0x%x\n",
  435. info->desc.name, info->voltage_bank, info->voltage_reg,
  436. info->voltage_mask, regval);
  437. return ret;
  438. }
  439. static const struct regulator_ops ab8500_regulator_volt_mode_ops = {
  440. .enable = ab8500_regulator_enable,
  441. .disable = ab8500_regulator_disable,
  442. .is_enabled = ab8500_regulator_is_enabled,
  443. .get_optimum_mode = ab8500_regulator_get_optimum_mode,
  444. .set_mode = ab8500_regulator_set_mode,
  445. .get_mode = ab8500_regulator_get_mode,
  446. .get_voltage_sel = ab8500_regulator_get_voltage_sel,
  447. .set_voltage_sel = ab8500_regulator_set_voltage_sel,
  448. .list_voltage = regulator_list_voltage_table,
  449. };
  450. static const struct regulator_ops ab8500_regulator_volt_ops = {
  451. .enable = ab8500_regulator_enable,
  452. .disable = ab8500_regulator_disable,
  453. .is_enabled = ab8500_regulator_is_enabled,
  454. .get_voltage_sel = ab8500_regulator_get_voltage_sel,
  455. .set_voltage_sel = ab8500_regulator_set_voltage_sel,
  456. .list_voltage = regulator_list_voltage_table,
  457. };
  458. static const struct regulator_ops ab8500_regulator_mode_ops = {
  459. .enable = ab8500_regulator_enable,
  460. .disable = ab8500_regulator_disable,
  461. .is_enabled = ab8500_regulator_is_enabled,
  462. .get_optimum_mode = ab8500_regulator_get_optimum_mode,
  463. .set_mode = ab8500_regulator_set_mode,
  464. .get_mode = ab8500_regulator_get_mode,
  465. .list_voltage = regulator_list_voltage_table,
  466. };
  467. static const struct regulator_ops ab8500_regulator_ops = {
  468. .enable = ab8500_regulator_enable,
  469. .disable = ab8500_regulator_disable,
  470. .is_enabled = ab8500_regulator_is_enabled,
  471. .list_voltage = regulator_list_voltage_table,
  472. };
  473. static const struct regulator_ops ab8500_regulator_anamic_mode_ops = {
  474. .enable = ab8500_regulator_enable,
  475. .disable = ab8500_regulator_disable,
  476. .is_enabled = ab8500_regulator_is_enabled,
  477. .set_mode = ab8500_regulator_set_mode,
  478. .get_mode = ab8500_regulator_get_mode,
  479. .list_voltage = regulator_list_voltage_table,
  480. };
  481. /* AB8500 regulator information */
  482. static struct ab8500_regulator_info
  483. ab8500_regulator_info[AB8500_NUM_REGULATORS] = {
  484. /*
  485. * Variable Voltage Regulators
  486. * name, min mV, max mV,
  487. * update bank, reg, mask, enable val
  488. * volt bank, reg, mask
  489. */
  490. [AB8500_LDO_AUX1] = {
  491. .desc = {
  492. .name = "LDO-AUX1",
  493. .ops = &ab8500_regulator_volt_mode_ops,
  494. .type = REGULATOR_VOLTAGE,
  495. .id = AB8500_LDO_AUX1,
  496. .owner = THIS_MODULE,
  497. .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
  498. .volt_table = ldo_vauxn_voltages,
  499. .enable_time = 200,
  500. .supply_name = "vin",
  501. },
  502. .load_lp_uA = 5000,
  503. .update_bank = 0x04,
  504. .update_reg = 0x09,
  505. .update_mask = 0x03,
  506. .update_val = 0x01,
  507. .update_val_idle = 0x03,
  508. .update_val_normal = 0x01,
  509. .voltage_bank = 0x04,
  510. .voltage_reg = 0x1f,
  511. .voltage_mask = 0x0f,
  512. },
  513. [AB8500_LDO_AUX2] = {
  514. .desc = {
  515. .name = "LDO-AUX2",
  516. .ops = &ab8500_regulator_volt_mode_ops,
  517. .type = REGULATOR_VOLTAGE,
  518. .id = AB8500_LDO_AUX2,
  519. .owner = THIS_MODULE,
  520. .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
  521. .volt_table = ldo_vauxn_voltages,
  522. .enable_time = 200,
  523. .supply_name = "vin",
  524. },
  525. .load_lp_uA = 5000,
  526. .update_bank = 0x04,
  527. .update_reg = 0x09,
  528. .update_mask = 0x0c,
  529. .update_val = 0x04,
  530. .update_val_idle = 0x0c,
  531. .update_val_normal = 0x04,
  532. .voltage_bank = 0x04,
  533. .voltage_reg = 0x20,
  534. .voltage_mask = 0x0f,
  535. },
  536. [AB8500_LDO_AUX3] = {
  537. .desc = {
  538. .name = "LDO-AUX3",
  539. .ops = &ab8500_regulator_volt_mode_ops,
  540. .type = REGULATOR_VOLTAGE,
  541. .id = AB8500_LDO_AUX3,
  542. .owner = THIS_MODULE,
  543. .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
  544. .volt_table = ldo_vaux3_voltages,
  545. .enable_time = 450,
  546. .supply_name = "vin",
  547. },
  548. .load_lp_uA = 5000,
  549. .update_bank = 0x04,
  550. .update_reg = 0x0a,
  551. .update_mask = 0x03,
  552. .update_val = 0x01,
  553. .update_val_idle = 0x03,
  554. .update_val_normal = 0x01,
  555. .voltage_bank = 0x04,
  556. .voltage_reg = 0x21,
  557. .voltage_mask = 0x07,
  558. },
  559. [AB8500_LDO_INTCORE] = {
  560. .desc = {
  561. .name = "LDO-INTCORE",
  562. .ops = &ab8500_regulator_volt_mode_ops,
  563. .type = REGULATOR_VOLTAGE,
  564. .id = AB8500_LDO_INTCORE,
  565. .owner = THIS_MODULE,
  566. .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
  567. .volt_table = ldo_vintcore_voltages,
  568. .enable_time = 750,
  569. },
  570. .load_lp_uA = 5000,
  571. .update_bank = 0x03,
  572. .update_reg = 0x80,
  573. .update_mask = 0x44,
  574. .update_val = 0x44,
  575. .update_val_idle = 0x44,
  576. .update_val_normal = 0x04,
  577. .voltage_bank = 0x03,
  578. .voltage_reg = 0x80,
  579. .voltage_mask = 0x38,
  580. },
  581. /*
  582. * Fixed Voltage Regulators
  583. * name, fixed mV,
  584. * update bank, reg, mask, enable val
  585. */
  586. [AB8500_LDO_TVOUT] = {
  587. .desc = {
  588. .name = "LDO-TVOUT",
  589. .ops = &ab8500_regulator_mode_ops,
  590. .type = REGULATOR_VOLTAGE,
  591. .id = AB8500_LDO_TVOUT,
  592. .owner = THIS_MODULE,
  593. .n_voltages = 1,
  594. .volt_table = fixed_2000000_voltage,
  595. .enable_time = 500,
  596. },
  597. .load_lp_uA = 1000,
  598. .update_bank = 0x03,
  599. .update_reg = 0x80,
  600. .update_mask = 0x82,
  601. .update_val = 0x02,
  602. .update_val_idle = 0x82,
  603. .update_val_normal = 0x02,
  604. },
  605. [AB8500_LDO_AUDIO] = {
  606. .desc = {
  607. .name = "LDO-AUDIO",
  608. .ops = &ab8500_regulator_ops,
  609. .type = REGULATOR_VOLTAGE,
  610. .id = AB8500_LDO_AUDIO,
  611. .owner = THIS_MODULE,
  612. .n_voltages = 1,
  613. .enable_time = 140,
  614. .volt_table = fixed_2000000_voltage,
  615. },
  616. .update_bank = 0x03,
  617. .update_reg = 0x83,
  618. .update_mask = 0x02,
  619. .update_val = 0x02,
  620. },
  621. [AB8500_LDO_ANAMIC1] = {
  622. .desc = {
  623. .name = "LDO-ANAMIC1",
  624. .ops = &ab8500_regulator_ops,
  625. .type = REGULATOR_VOLTAGE,
  626. .id = AB8500_LDO_ANAMIC1,
  627. .owner = THIS_MODULE,
  628. .n_voltages = 1,
  629. .enable_time = 500,
  630. .volt_table = fixed_2050000_voltage,
  631. },
  632. .update_bank = 0x03,
  633. .update_reg = 0x83,
  634. .update_mask = 0x08,
  635. .update_val = 0x08,
  636. },
  637. [AB8500_LDO_ANAMIC2] = {
  638. .desc = {
  639. .name = "LDO-ANAMIC2",
  640. .ops = &ab8500_regulator_ops,
  641. .type = REGULATOR_VOLTAGE,
  642. .id = AB8500_LDO_ANAMIC2,
  643. .owner = THIS_MODULE,
  644. .n_voltages = 1,
  645. .enable_time = 500,
  646. .volt_table = fixed_2050000_voltage,
  647. },
  648. .update_bank = 0x03,
  649. .update_reg = 0x83,
  650. .update_mask = 0x10,
  651. .update_val = 0x10,
  652. },
  653. [AB8500_LDO_DMIC] = {
  654. .desc = {
  655. .name = "LDO-DMIC",
  656. .ops = &ab8500_regulator_ops,
  657. .type = REGULATOR_VOLTAGE,
  658. .id = AB8500_LDO_DMIC,
  659. .owner = THIS_MODULE,
  660. .n_voltages = 1,
  661. .enable_time = 420,
  662. .volt_table = fixed_1800000_voltage,
  663. },
  664. .update_bank = 0x03,
  665. .update_reg = 0x83,
  666. .update_mask = 0x04,
  667. .update_val = 0x04,
  668. },
  669. /*
  670. * Regulators with fixed voltage and normal/idle modes
  671. */
  672. [AB8500_LDO_ANA] = {
  673. .desc = {
  674. .name = "LDO-ANA",
  675. .ops = &ab8500_regulator_mode_ops,
  676. .type = REGULATOR_VOLTAGE,
  677. .id = AB8500_LDO_ANA,
  678. .owner = THIS_MODULE,
  679. .n_voltages = 1,
  680. .enable_time = 140,
  681. .volt_table = fixed_1200000_voltage,
  682. },
  683. .load_lp_uA = 1000,
  684. .update_bank = 0x04,
  685. .update_reg = 0x06,
  686. .update_mask = 0x0c,
  687. .update_val = 0x04,
  688. .update_val_idle = 0x0c,
  689. .update_val_normal = 0x04,
  690. },
  691. };
  692. /* AB8505 regulator information */
  693. static struct ab8500_regulator_info
  694. ab8505_regulator_info[AB8505_NUM_REGULATORS] = {
  695. /*
  696. * Variable Voltage Regulators
  697. * name, min mV, max mV,
  698. * update bank, reg, mask, enable val
  699. * volt bank, reg, mask
  700. */
  701. [AB8505_LDO_AUX1] = {
  702. .desc = {
  703. .name = "LDO-AUX1",
  704. .ops = &ab8500_regulator_volt_mode_ops,
  705. .type = REGULATOR_VOLTAGE,
  706. .id = AB8505_LDO_AUX1,
  707. .owner = THIS_MODULE,
  708. .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
  709. .volt_table = ldo_vauxn_voltages,
  710. },
  711. .load_lp_uA = 5000,
  712. .update_bank = 0x04,
  713. .update_reg = 0x09,
  714. .update_mask = 0x03,
  715. .update_val = 0x01,
  716. .update_val_idle = 0x03,
  717. .update_val_normal = 0x01,
  718. .voltage_bank = 0x04,
  719. .voltage_reg = 0x1f,
  720. .voltage_mask = 0x0f,
  721. },
  722. [AB8505_LDO_AUX2] = {
  723. .desc = {
  724. .name = "LDO-AUX2",
  725. .ops = &ab8500_regulator_volt_mode_ops,
  726. .type = REGULATOR_VOLTAGE,
  727. .id = AB8505_LDO_AUX2,
  728. .owner = THIS_MODULE,
  729. .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
  730. .volt_table = ldo_vauxn_voltages,
  731. },
  732. .load_lp_uA = 5000,
  733. .update_bank = 0x04,
  734. .update_reg = 0x09,
  735. .update_mask = 0x0c,
  736. .update_val = 0x04,
  737. .update_val_idle = 0x0c,
  738. .update_val_normal = 0x04,
  739. .voltage_bank = 0x04,
  740. .voltage_reg = 0x20,
  741. .voltage_mask = 0x0f,
  742. },
  743. [AB8505_LDO_AUX3] = {
  744. .desc = {
  745. .name = "LDO-AUX3",
  746. .ops = &ab8500_regulator_volt_mode_ops,
  747. .type = REGULATOR_VOLTAGE,
  748. .id = AB8505_LDO_AUX3,
  749. .owner = THIS_MODULE,
  750. .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
  751. .volt_table = ldo_vaux3_voltages,
  752. },
  753. .load_lp_uA = 5000,
  754. .update_bank = 0x04,
  755. .update_reg = 0x0a,
  756. .update_mask = 0x03,
  757. .update_val = 0x01,
  758. .update_val_idle = 0x03,
  759. .update_val_normal = 0x01,
  760. .voltage_bank = 0x04,
  761. .voltage_reg = 0x21,
  762. .voltage_mask = 0x07,
  763. },
  764. [AB8505_LDO_AUX4] = {
  765. .desc = {
  766. .name = "LDO-AUX4",
  767. .ops = &ab8500_regulator_volt_mode_ops,
  768. .type = REGULATOR_VOLTAGE,
  769. .id = AB8505_LDO_AUX4,
  770. .owner = THIS_MODULE,
  771. .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
  772. .volt_table = ldo_vauxn_voltages,
  773. },
  774. .load_lp_uA = 5000,
  775. /* values for Vaux4Regu register */
  776. .update_bank = 0x04,
  777. .update_reg = 0x2e,
  778. .update_mask = 0x03,
  779. .update_val = 0x01,
  780. .update_val_idle = 0x03,
  781. .update_val_normal = 0x01,
  782. /* values for Vaux4SEL register */
  783. .voltage_bank = 0x04,
  784. .voltage_reg = 0x2f,
  785. .voltage_mask = 0x0f,
  786. },
  787. [AB8505_LDO_AUX5] = {
  788. .desc = {
  789. .name = "LDO-AUX5",
  790. .ops = &ab8500_regulator_volt_mode_ops,
  791. .type = REGULATOR_VOLTAGE,
  792. .id = AB8505_LDO_AUX5,
  793. .owner = THIS_MODULE,
  794. .n_voltages = ARRAY_SIZE(ldo_vaux56_voltages),
  795. .volt_table = ldo_vaux56_voltages,
  796. },
  797. .load_lp_uA = 2000,
  798. /* values for CtrlVaux5 register */
  799. .update_bank = 0x01,
  800. .update_reg = 0x55,
  801. .update_mask = 0x18,
  802. .update_val = 0x10,
  803. .update_val_idle = 0x18,
  804. .update_val_normal = 0x10,
  805. .voltage_bank = 0x01,
  806. .voltage_reg = 0x55,
  807. .voltage_mask = 0x07,
  808. },
  809. [AB8505_LDO_AUX6] = {
  810. .desc = {
  811. .name = "LDO-AUX6",
  812. .ops = &ab8500_regulator_volt_mode_ops,
  813. .type = REGULATOR_VOLTAGE,
  814. .id = AB8505_LDO_AUX6,
  815. .owner = THIS_MODULE,
  816. .n_voltages = ARRAY_SIZE(ldo_vaux56_voltages),
  817. .volt_table = ldo_vaux56_voltages,
  818. },
  819. .load_lp_uA = 2000,
  820. /* values for CtrlVaux6 register */
  821. .update_bank = 0x01,
  822. .update_reg = 0x56,
  823. .update_mask = 0x18,
  824. .update_val = 0x10,
  825. .update_val_idle = 0x18,
  826. .update_val_normal = 0x10,
  827. .voltage_bank = 0x01,
  828. .voltage_reg = 0x56,
  829. .voltage_mask = 0x07,
  830. },
  831. [AB8505_LDO_INTCORE] = {
  832. .desc = {
  833. .name = "LDO-INTCORE",
  834. .ops = &ab8500_regulator_volt_mode_ops,
  835. .type = REGULATOR_VOLTAGE,
  836. .id = AB8505_LDO_INTCORE,
  837. .owner = THIS_MODULE,
  838. .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
  839. .volt_table = ldo_vintcore_voltages,
  840. },
  841. .load_lp_uA = 5000,
  842. .update_bank = 0x03,
  843. .update_reg = 0x80,
  844. .update_mask = 0x44,
  845. .update_val = 0x04,
  846. .update_val_idle = 0x44,
  847. .update_val_normal = 0x04,
  848. .voltage_bank = 0x03,
  849. .voltage_reg = 0x80,
  850. .voltage_mask = 0x38,
  851. },
  852. /*
  853. * Fixed Voltage Regulators
  854. * name, fixed mV,
  855. * update bank, reg, mask, enable val
  856. */
  857. [AB8505_LDO_ADC] = {
  858. .desc = {
  859. .name = "LDO-ADC",
  860. .ops = &ab8500_regulator_mode_ops,
  861. .type = REGULATOR_VOLTAGE,
  862. .id = AB8505_LDO_ADC,
  863. .owner = THIS_MODULE,
  864. .n_voltages = 1,
  865. .volt_table = fixed_2000000_voltage,
  866. .enable_time = 10000,
  867. },
  868. .load_lp_uA = 1000,
  869. .update_bank = 0x03,
  870. .update_reg = 0x80,
  871. .update_mask = 0x82,
  872. .update_val = 0x02,
  873. .update_val_idle = 0x82,
  874. .update_val_normal = 0x02,
  875. },
  876. [AB8505_LDO_AUDIO] = {
  877. .desc = {
  878. .name = "LDO-AUDIO",
  879. .ops = &ab8500_regulator_volt_ops,
  880. .type = REGULATOR_VOLTAGE,
  881. .id = AB8505_LDO_AUDIO,
  882. .owner = THIS_MODULE,
  883. .n_voltages = ARRAY_SIZE(ldo_vaudio_voltages),
  884. .volt_table = ldo_vaudio_voltages,
  885. },
  886. .update_bank = 0x03,
  887. .update_reg = 0x83,
  888. .update_mask = 0x02,
  889. .update_val = 0x02,
  890. .voltage_bank = 0x01,
  891. .voltage_reg = 0x57,
  892. .voltage_mask = 0x70,
  893. },
  894. [AB8505_LDO_ANAMIC1] = {
  895. .desc = {
  896. .name = "LDO-ANAMIC1",
  897. .ops = &ab8500_regulator_anamic_mode_ops,
  898. .type = REGULATOR_VOLTAGE,
  899. .id = AB8505_LDO_ANAMIC1,
  900. .owner = THIS_MODULE,
  901. .n_voltages = 1,
  902. .volt_table = fixed_2050000_voltage,
  903. },
  904. .shared_mode = &ldo_anamic1_shared,
  905. .update_bank = 0x03,
  906. .update_reg = 0x83,
  907. .update_mask = 0x08,
  908. .update_val = 0x08,
  909. .mode_bank = 0x01,
  910. .mode_reg = 0x54,
  911. .mode_mask = 0x04,
  912. .mode_val_idle = 0x04,
  913. .mode_val_normal = 0x00,
  914. },
  915. [AB8505_LDO_ANAMIC2] = {
  916. .desc = {
  917. .name = "LDO-ANAMIC2",
  918. .ops = &ab8500_regulator_anamic_mode_ops,
  919. .type = REGULATOR_VOLTAGE,
  920. .id = AB8505_LDO_ANAMIC2,
  921. .owner = THIS_MODULE,
  922. .n_voltages = 1,
  923. .volt_table = fixed_2050000_voltage,
  924. },
  925. .shared_mode = &ldo_anamic2_shared,
  926. .update_bank = 0x03,
  927. .update_reg = 0x83,
  928. .update_mask = 0x10,
  929. .update_val = 0x10,
  930. .mode_bank = 0x01,
  931. .mode_reg = 0x54,
  932. .mode_mask = 0x04,
  933. .mode_val_idle = 0x04,
  934. .mode_val_normal = 0x00,
  935. },
  936. [AB8505_LDO_AUX8] = {
  937. .desc = {
  938. .name = "LDO-AUX8",
  939. .ops = &ab8500_regulator_ops,
  940. .type = REGULATOR_VOLTAGE,
  941. .id = AB8505_LDO_AUX8,
  942. .owner = THIS_MODULE,
  943. .n_voltages = 1,
  944. .volt_table = fixed_1800000_voltage,
  945. },
  946. .update_bank = 0x03,
  947. .update_reg = 0x83,
  948. .update_mask = 0x04,
  949. .update_val = 0x04,
  950. },
  951. /*
  952. * Regulators with fixed voltage and normal/idle modes
  953. */
  954. [AB8505_LDO_ANA] = {
  955. .desc = {
  956. .name = "LDO-ANA",
  957. .ops = &ab8500_regulator_volt_mode_ops,
  958. .type = REGULATOR_VOLTAGE,
  959. .id = AB8505_LDO_ANA,
  960. .owner = THIS_MODULE,
  961. .n_voltages = ARRAY_SIZE(ldo_vana_voltages),
  962. .volt_table = ldo_vana_voltages,
  963. },
  964. .load_lp_uA = 1000,
  965. .update_bank = 0x04,
  966. .update_reg = 0x06,
  967. .update_mask = 0x0c,
  968. .update_val = 0x04,
  969. .update_val_idle = 0x0c,
  970. .update_val_normal = 0x04,
  971. .voltage_bank = 0x04,
  972. .voltage_reg = 0x29,
  973. .voltage_mask = 0x7,
  974. },
  975. };
  976. static struct ab8500_shared_mode ldo_anamic1_shared = {
  977. .shared_regulator = &ab8505_regulator_info[AB8505_LDO_ANAMIC2],
  978. };
  979. static struct ab8500_shared_mode ldo_anamic2_shared = {
  980. .shared_regulator = &ab8505_regulator_info[AB8505_LDO_ANAMIC1],
  981. };
  982. struct ab8500_reg_init {
  983. u8 bank;
  984. u8 addr;
  985. u8 mask;
  986. };
  987. #define REG_INIT(_id, _bank, _addr, _mask) \
  988. [_id] = { \
  989. .bank = _bank, \
  990. .addr = _addr, \
  991. .mask = _mask, \
  992. }
  993. /* AB8500 register init */
  994. static struct ab8500_reg_init ab8500_reg_init[] = {
  995. /*
  996. * 0x30, VanaRequestCtrl
  997. * 0xc0, VextSupply1RequestCtrl
  998. */
  999. REG_INIT(AB8500_REGUREQUESTCTRL2, 0x03, 0x04, 0xf0),
  1000. /*
  1001. * 0x03, VextSupply2RequestCtrl
  1002. * 0x0c, VextSupply3RequestCtrl
  1003. * 0x30, Vaux1RequestCtrl
  1004. * 0xc0, Vaux2RequestCtrl
  1005. */
  1006. REG_INIT(AB8500_REGUREQUESTCTRL3, 0x03, 0x05, 0xff),
  1007. /*
  1008. * 0x03, Vaux3RequestCtrl
  1009. * 0x04, SwHPReq
  1010. */
  1011. REG_INIT(AB8500_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
  1012. /*
  1013. * 0x08, VanaSysClkReq1HPValid
  1014. * 0x20, Vaux1SysClkReq1HPValid
  1015. * 0x40, Vaux2SysClkReq1HPValid
  1016. * 0x80, Vaux3SysClkReq1HPValid
  1017. */
  1018. REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xe8),
  1019. /*
  1020. * 0x10, VextSupply1SysClkReq1HPValid
  1021. * 0x20, VextSupply2SysClkReq1HPValid
  1022. * 0x40, VextSupply3SysClkReq1HPValid
  1023. */
  1024. REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x70),
  1025. /*
  1026. * 0x08, VanaHwHPReq1Valid
  1027. * 0x20, Vaux1HwHPReq1Valid
  1028. * 0x40, Vaux2HwHPReq1Valid
  1029. * 0x80, Vaux3HwHPReq1Valid
  1030. */
  1031. REG_INIT(AB8500_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xe8),
  1032. /*
  1033. * 0x01, VextSupply1HwHPReq1Valid
  1034. * 0x02, VextSupply2HwHPReq1Valid
  1035. * 0x04, VextSupply3HwHPReq1Valid
  1036. */
  1037. REG_INIT(AB8500_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x07),
  1038. /*
  1039. * 0x08, VanaHwHPReq2Valid
  1040. * 0x20, Vaux1HwHPReq2Valid
  1041. * 0x40, Vaux2HwHPReq2Valid
  1042. * 0x80, Vaux3HwHPReq2Valid
  1043. */
  1044. REG_INIT(AB8500_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xe8),
  1045. /*
  1046. * 0x01, VextSupply1HwHPReq2Valid
  1047. * 0x02, VextSupply2HwHPReq2Valid
  1048. * 0x04, VextSupply3HwHPReq2Valid
  1049. */
  1050. REG_INIT(AB8500_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x07),
  1051. /*
  1052. * 0x20, VanaSwHPReqValid
  1053. * 0x80, Vaux1SwHPReqValid
  1054. */
  1055. REG_INIT(AB8500_REGUSWHPREQVALID1, 0x03, 0x0d, 0xa0),
  1056. /*
  1057. * 0x01, Vaux2SwHPReqValid
  1058. * 0x02, Vaux3SwHPReqValid
  1059. * 0x04, VextSupply1SwHPReqValid
  1060. * 0x08, VextSupply2SwHPReqValid
  1061. * 0x10, VextSupply3SwHPReqValid
  1062. */
  1063. REG_INIT(AB8500_REGUSWHPREQVALID2, 0x03, 0x0e, 0x1f),
  1064. /*
  1065. * 0x02, SysClkReq2Valid1
  1066. * 0x04, SysClkReq3Valid1
  1067. * 0x08, SysClkReq4Valid1
  1068. * 0x10, SysClkReq5Valid1
  1069. * 0x20, SysClkReq6Valid1
  1070. * 0x40, SysClkReq7Valid1
  1071. * 0x80, SysClkReq8Valid1
  1072. */
  1073. REG_INIT(AB8500_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0xfe),
  1074. /*
  1075. * 0x02, SysClkReq2Valid2
  1076. * 0x04, SysClkReq3Valid2
  1077. * 0x08, SysClkReq4Valid2
  1078. * 0x10, SysClkReq5Valid2
  1079. * 0x20, SysClkReq6Valid2
  1080. * 0x40, SysClkReq7Valid2
  1081. * 0x80, SysClkReq8Valid2
  1082. */
  1083. REG_INIT(AB8500_REGUSYSCLKREQVALID2, 0x03, 0x10, 0xfe),
  1084. /*
  1085. * 0x02, VTVoutEna
  1086. * 0x04, Vintcore12Ena
  1087. * 0x38, Vintcore12Sel
  1088. * 0x40, Vintcore12LP
  1089. * 0x80, VTVoutLP
  1090. */
  1091. REG_INIT(AB8500_REGUMISC1, 0x03, 0x80, 0xfe),
  1092. /*
  1093. * 0x02, VaudioEna
  1094. * 0x04, VdmicEna
  1095. * 0x08, Vamic1Ena
  1096. * 0x10, Vamic2Ena
  1097. */
  1098. REG_INIT(AB8500_VAUDIOSUPPLY, 0x03, 0x83, 0x1e),
  1099. /*
  1100. * 0x01, Vamic1_dzout
  1101. * 0x02, Vamic2_dzout
  1102. */
  1103. REG_INIT(AB8500_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
  1104. /*
  1105. * 0x03, VpllRegu (NOTE! PRCMU register bits)
  1106. * 0x0c, VanaRegu
  1107. */
  1108. REG_INIT(AB8500_VPLLVANAREGU, 0x04, 0x06, 0x0f),
  1109. /*
  1110. * 0x01, VrefDDREna
  1111. * 0x02, VrefDDRSleepMode
  1112. */
  1113. REG_INIT(AB8500_VREFDDR, 0x04, 0x07, 0x03),
  1114. /*
  1115. * 0x03, VextSupply1Regu
  1116. * 0x0c, VextSupply2Regu
  1117. * 0x30, VextSupply3Regu
  1118. * 0x40, ExtSupply2Bypass
  1119. * 0x80, ExtSupply3Bypass
  1120. */
  1121. REG_INIT(AB8500_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
  1122. /*
  1123. * 0x03, Vaux1Regu
  1124. * 0x0c, Vaux2Regu
  1125. */
  1126. REG_INIT(AB8500_VAUX12REGU, 0x04, 0x09, 0x0f),
  1127. /*
  1128. * 0x03, Vaux3Regu
  1129. */
  1130. REG_INIT(AB8500_VRF1VAUX3REGU, 0x04, 0x0a, 0x03),
  1131. /*
  1132. * 0x0f, Vaux1Sel
  1133. */
  1134. REG_INIT(AB8500_VAUX1SEL, 0x04, 0x1f, 0x0f),
  1135. /*
  1136. * 0x0f, Vaux2Sel
  1137. */
  1138. REG_INIT(AB8500_VAUX2SEL, 0x04, 0x20, 0x0f),
  1139. /*
  1140. * 0x07, Vaux3Sel
  1141. */
  1142. REG_INIT(AB8500_VRF1VAUX3SEL, 0x04, 0x21, 0x07),
  1143. /*
  1144. * 0x01, VextSupply12LP
  1145. */
  1146. REG_INIT(AB8500_REGUCTRL2SPARE, 0x04, 0x22, 0x01),
  1147. /*
  1148. * 0x04, Vaux1Disch
  1149. * 0x08, Vaux2Disch
  1150. * 0x10, Vaux3Disch
  1151. * 0x20, Vintcore12Disch
  1152. * 0x40, VTVoutDisch
  1153. * 0x80, VaudioDisch
  1154. */
  1155. REG_INIT(AB8500_REGUCTRLDISCH, 0x04, 0x43, 0xfc),
  1156. /*
  1157. * 0x02, VanaDisch
  1158. * 0x04, VdmicPullDownEna
  1159. * 0x10, VdmicDisch
  1160. */
  1161. REG_INIT(AB8500_REGUCTRLDISCH2, 0x04, 0x44, 0x16),
  1162. };
  1163. /* AB8505 register init */
  1164. static struct ab8500_reg_init ab8505_reg_init[] = {
  1165. /*
  1166. * 0x03, VarmRequestCtrl
  1167. * 0x0c, VsmpsCRequestCtrl
  1168. * 0x30, VsmpsARequestCtrl
  1169. * 0xc0, VsmpsBRequestCtrl
  1170. */
  1171. REG_INIT(AB8505_REGUREQUESTCTRL1, 0x03, 0x03, 0xff),
  1172. /*
  1173. * 0x03, VsafeRequestCtrl
  1174. * 0x0c, VpllRequestCtrl
  1175. * 0x30, VanaRequestCtrl
  1176. */
  1177. REG_INIT(AB8505_REGUREQUESTCTRL2, 0x03, 0x04, 0x3f),
  1178. /*
  1179. * 0x30, Vaux1RequestCtrl
  1180. * 0xc0, Vaux2RequestCtrl
  1181. */
  1182. REG_INIT(AB8505_REGUREQUESTCTRL3, 0x03, 0x05, 0xf0),
  1183. /*
  1184. * 0x03, Vaux3RequestCtrl
  1185. * 0x04, SwHPReq
  1186. */
  1187. REG_INIT(AB8505_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
  1188. /*
  1189. * 0x01, VsmpsASysClkReq1HPValid
  1190. * 0x02, VsmpsBSysClkReq1HPValid
  1191. * 0x04, VsafeSysClkReq1HPValid
  1192. * 0x08, VanaSysClkReq1HPValid
  1193. * 0x10, VpllSysClkReq1HPValid
  1194. * 0x20, Vaux1SysClkReq1HPValid
  1195. * 0x40, Vaux2SysClkReq1HPValid
  1196. * 0x80, Vaux3SysClkReq1HPValid
  1197. */
  1198. REG_INIT(AB8505_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xff),
  1199. /*
  1200. * 0x01, VsmpsCSysClkReq1HPValid
  1201. * 0x02, VarmSysClkReq1HPValid
  1202. * 0x04, VbbSysClkReq1HPValid
  1203. * 0x08, VsmpsMSysClkReq1HPValid
  1204. */
  1205. REG_INIT(AB8505_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x0f),
  1206. /*
  1207. * 0x01, VsmpsAHwHPReq1Valid
  1208. * 0x02, VsmpsBHwHPReq1Valid
  1209. * 0x04, VsafeHwHPReq1Valid
  1210. * 0x08, VanaHwHPReq1Valid
  1211. * 0x10, VpllHwHPReq1Valid
  1212. * 0x20, Vaux1HwHPReq1Valid
  1213. * 0x40, Vaux2HwHPReq1Valid
  1214. * 0x80, Vaux3HwHPReq1Valid
  1215. */
  1216. REG_INIT(AB8505_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xff),
  1217. /*
  1218. * 0x08, VsmpsMHwHPReq1Valid
  1219. */
  1220. REG_INIT(AB8505_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x08),
  1221. /*
  1222. * 0x01, VsmpsAHwHPReq2Valid
  1223. * 0x02, VsmpsBHwHPReq2Valid
  1224. * 0x04, VsafeHwHPReq2Valid
  1225. * 0x08, VanaHwHPReq2Valid
  1226. * 0x10, VpllHwHPReq2Valid
  1227. * 0x20, Vaux1HwHPReq2Valid
  1228. * 0x40, Vaux2HwHPReq2Valid
  1229. * 0x80, Vaux3HwHPReq2Valid
  1230. */
  1231. REG_INIT(AB8505_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xff),
  1232. /*
  1233. * 0x08, VsmpsMHwHPReq2Valid
  1234. */
  1235. REG_INIT(AB8505_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x08),
  1236. /*
  1237. * 0x01, VsmpsCSwHPReqValid
  1238. * 0x02, VarmSwHPReqValid
  1239. * 0x04, VsmpsASwHPReqValid
  1240. * 0x08, VsmpsBSwHPReqValid
  1241. * 0x10, VsafeSwHPReqValid
  1242. * 0x20, VanaSwHPReqValid
  1243. * 0x40, VpllSwHPReqValid
  1244. * 0x80, Vaux1SwHPReqValid
  1245. */
  1246. REG_INIT(AB8505_REGUSWHPREQVALID1, 0x03, 0x0d, 0xff),
  1247. /*
  1248. * 0x01, Vaux2SwHPReqValid
  1249. * 0x02, Vaux3SwHPReqValid
  1250. * 0x20, VsmpsMSwHPReqValid
  1251. */
  1252. REG_INIT(AB8505_REGUSWHPREQVALID2, 0x03, 0x0e, 0x23),
  1253. /*
  1254. * 0x02, SysClkReq2Valid1
  1255. * 0x04, SysClkReq3Valid1
  1256. * 0x08, SysClkReq4Valid1
  1257. */
  1258. REG_INIT(AB8505_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0x0e),
  1259. /*
  1260. * 0x02, SysClkReq2Valid2
  1261. * 0x04, SysClkReq3Valid2
  1262. * 0x08, SysClkReq4Valid2
  1263. */
  1264. REG_INIT(AB8505_REGUSYSCLKREQVALID2, 0x03, 0x10, 0x0e),
  1265. /*
  1266. * 0x01, Vaux4SwHPReqValid
  1267. * 0x02, Vaux4HwHPReq2Valid
  1268. * 0x04, Vaux4HwHPReq1Valid
  1269. * 0x08, Vaux4SysClkReq1HPValid
  1270. */
  1271. REG_INIT(AB8505_REGUVAUX4REQVALID, 0x03, 0x11, 0x0f),
  1272. /*
  1273. * 0x02, VadcEna
  1274. * 0x04, VintCore12Ena
  1275. * 0x38, VintCore12Sel
  1276. * 0x40, VintCore12LP
  1277. * 0x80, VadcLP
  1278. */
  1279. REG_INIT(AB8505_REGUMISC1, 0x03, 0x80, 0xfe),
  1280. /*
  1281. * 0x02, VaudioEna
  1282. * 0x04, VdmicEna
  1283. * 0x08, Vamic1Ena
  1284. * 0x10, Vamic2Ena
  1285. */
  1286. REG_INIT(AB8505_VAUDIOSUPPLY, 0x03, 0x83, 0x1e),
  1287. /*
  1288. * 0x01, Vamic1_dzout
  1289. * 0x02, Vamic2_dzout
  1290. */
  1291. REG_INIT(AB8505_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
  1292. /*
  1293. * 0x03, VsmpsARegu
  1294. * 0x0c, VsmpsASelCtrl
  1295. * 0x10, VsmpsAAutoMode
  1296. * 0x20, VsmpsAPWMMode
  1297. */
  1298. REG_INIT(AB8505_VSMPSAREGU, 0x04, 0x03, 0x3f),
  1299. /*
  1300. * 0x03, VsmpsBRegu
  1301. * 0x0c, VsmpsBSelCtrl
  1302. * 0x10, VsmpsBAutoMode
  1303. * 0x20, VsmpsBPWMMode
  1304. */
  1305. REG_INIT(AB8505_VSMPSBREGU, 0x04, 0x04, 0x3f),
  1306. /*
  1307. * 0x03, VsafeRegu
  1308. * 0x0c, VsafeSelCtrl
  1309. * 0x10, VsafeAutoMode
  1310. * 0x20, VsafePWMMode
  1311. */
  1312. REG_INIT(AB8505_VSAFEREGU, 0x04, 0x05, 0x3f),
  1313. /*
  1314. * 0x03, VpllRegu (NOTE! PRCMU register bits)
  1315. * 0x0c, VanaRegu
  1316. */
  1317. REG_INIT(AB8505_VPLLVANAREGU, 0x04, 0x06, 0x0f),
  1318. /*
  1319. * 0x03, VextSupply1Regu
  1320. * 0x0c, VextSupply2Regu
  1321. * 0x30, VextSupply3Regu
  1322. * 0x40, ExtSupply2Bypass
  1323. * 0x80, ExtSupply3Bypass
  1324. */
  1325. REG_INIT(AB8505_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
  1326. /*
  1327. * 0x03, Vaux1Regu
  1328. * 0x0c, Vaux2Regu
  1329. */
  1330. REG_INIT(AB8505_VAUX12REGU, 0x04, 0x09, 0x0f),
  1331. /*
  1332. * 0x0f, Vaux3Regu
  1333. */
  1334. REG_INIT(AB8505_VRF1VAUX3REGU, 0x04, 0x0a, 0x0f),
  1335. /*
  1336. * 0x3f, VsmpsASel1
  1337. */
  1338. REG_INIT(AB8505_VSMPSASEL1, 0x04, 0x13, 0x3f),
  1339. /*
  1340. * 0x3f, VsmpsASel2
  1341. */
  1342. REG_INIT(AB8505_VSMPSASEL2, 0x04, 0x14, 0x3f),
  1343. /*
  1344. * 0x3f, VsmpsASel3
  1345. */
  1346. REG_INIT(AB8505_VSMPSASEL3, 0x04, 0x15, 0x3f),
  1347. /*
  1348. * 0x3f, VsmpsBSel1
  1349. */
  1350. REG_INIT(AB8505_VSMPSBSEL1, 0x04, 0x17, 0x3f),
  1351. /*
  1352. * 0x3f, VsmpsBSel2
  1353. */
  1354. REG_INIT(AB8505_VSMPSBSEL2, 0x04, 0x18, 0x3f),
  1355. /*
  1356. * 0x3f, VsmpsBSel3
  1357. */
  1358. REG_INIT(AB8505_VSMPSBSEL3, 0x04, 0x19, 0x3f),
  1359. /*
  1360. * 0x7f, VsafeSel1
  1361. */
  1362. REG_INIT(AB8505_VSAFESEL1, 0x04, 0x1b, 0x7f),
  1363. /*
  1364. * 0x3f, VsafeSel2
  1365. */
  1366. REG_INIT(AB8505_VSAFESEL2, 0x04, 0x1c, 0x7f),
  1367. /*
  1368. * 0x3f, VsafeSel3
  1369. */
  1370. REG_INIT(AB8505_VSAFESEL3, 0x04, 0x1d, 0x7f),
  1371. /*
  1372. * 0x0f, Vaux1Sel
  1373. */
  1374. REG_INIT(AB8505_VAUX1SEL, 0x04, 0x1f, 0x0f),
  1375. /*
  1376. * 0x0f, Vaux2Sel
  1377. */
  1378. REG_INIT(AB8505_VAUX2SEL, 0x04, 0x20, 0x0f),
  1379. /*
  1380. * 0x07, Vaux3Sel
  1381. * 0x30, VRF1Sel
  1382. */
  1383. REG_INIT(AB8505_VRF1VAUX3SEL, 0x04, 0x21, 0x37),
  1384. /*
  1385. * 0x03, Vaux4RequestCtrl
  1386. */
  1387. REG_INIT(AB8505_VAUX4REQCTRL, 0x04, 0x2d, 0x03),
  1388. /*
  1389. * 0x03, Vaux4Regu
  1390. */
  1391. REG_INIT(AB8505_VAUX4REGU, 0x04, 0x2e, 0x03),
  1392. /*
  1393. * 0x0f, Vaux4Sel
  1394. */
  1395. REG_INIT(AB8505_VAUX4SEL, 0x04, 0x2f, 0x0f),
  1396. /*
  1397. * 0x04, Vaux1Disch
  1398. * 0x08, Vaux2Disch
  1399. * 0x10, Vaux3Disch
  1400. * 0x20, Vintcore12Disch
  1401. * 0x40, VTVoutDisch
  1402. * 0x80, VaudioDisch
  1403. */
  1404. REG_INIT(AB8505_REGUCTRLDISCH, 0x04, 0x43, 0xfc),
  1405. /*
  1406. * 0x02, VanaDisch
  1407. * 0x04, VdmicPullDownEna
  1408. * 0x10, VdmicDisch
  1409. */
  1410. REG_INIT(AB8505_REGUCTRLDISCH2, 0x04, 0x44, 0x16),
  1411. /*
  1412. * 0x01, Vaux4Disch
  1413. */
  1414. REG_INIT(AB8505_REGUCTRLDISCH3, 0x04, 0x48, 0x01),
  1415. /*
  1416. * 0x07, Vaux5Sel
  1417. * 0x08, Vaux5LP
  1418. * 0x10, Vaux5Ena
  1419. * 0x20, Vaux5Disch
  1420. * 0x40, Vaux5DisSfst
  1421. * 0x80, Vaux5DisPulld
  1422. */
  1423. REG_INIT(AB8505_CTRLVAUX5, 0x01, 0x55, 0xff),
  1424. /*
  1425. * 0x07, Vaux6Sel
  1426. * 0x08, Vaux6LP
  1427. * 0x10, Vaux6Ena
  1428. * 0x80, Vaux6DisPulld
  1429. */
  1430. REG_INIT(AB8505_CTRLVAUX6, 0x01, 0x56, 0x9f),
  1431. };
  1432. static struct of_regulator_match ab8500_regulator_match[] = {
  1433. { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8500_LDO_AUX1, },
  1434. { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8500_LDO_AUX2, },
  1435. { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8500_LDO_AUX3, },
  1436. { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8500_LDO_INTCORE, },
  1437. { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, },
  1438. { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, },
  1439. { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, },
  1440. { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, },
  1441. { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, },
  1442. { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, },
  1443. };
  1444. static struct of_regulator_match ab8505_regulator_match[] = {
  1445. { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8505_LDO_AUX1, },
  1446. { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8505_LDO_AUX2, },
  1447. { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8505_LDO_AUX3, },
  1448. { .name = "ab8500_ldo_aux4", .driver_data = (void *) AB8505_LDO_AUX4, },
  1449. { .name = "ab8500_ldo_aux5", .driver_data = (void *) AB8505_LDO_AUX5, },
  1450. { .name = "ab8500_ldo_aux6", .driver_data = (void *) AB8505_LDO_AUX6, },
  1451. { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8505_LDO_INTCORE, },
  1452. { .name = "ab8500_ldo_adc", .driver_data = (void *) AB8505_LDO_ADC, },
  1453. { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8505_LDO_AUDIO, },
  1454. { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8505_LDO_ANAMIC1, },
  1455. { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB8505_LDO_ANAMIC2, },
  1456. { .name = "ab8500_ldo_aux8", .driver_data = (void *) AB8505_LDO_AUX8, },
  1457. { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8505_LDO_ANA, },
  1458. };
  1459. static struct {
  1460. struct ab8500_regulator_info *info;
  1461. int info_size;
  1462. struct ab8500_reg_init *init;
  1463. int init_size;
  1464. struct of_regulator_match *match;
  1465. int match_size;
  1466. } abx500_regulator;
  1467. static void abx500_get_regulator_info(struct ab8500 *ab8500)
  1468. {
  1469. if (is_ab8505(ab8500)) {
  1470. abx500_regulator.info = ab8505_regulator_info;
  1471. abx500_regulator.info_size = ARRAY_SIZE(ab8505_regulator_info);
  1472. abx500_regulator.init = ab8505_reg_init;
  1473. abx500_regulator.init_size = AB8505_NUM_REGULATOR_REGISTERS;
  1474. abx500_regulator.match = ab8505_regulator_match;
  1475. abx500_regulator.match_size = ARRAY_SIZE(ab8505_regulator_match);
  1476. } else {
  1477. abx500_regulator.info = ab8500_regulator_info;
  1478. abx500_regulator.info_size = ARRAY_SIZE(ab8500_regulator_info);
  1479. abx500_regulator.init = ab8500_reg_init;
  1480. abx500_regulator.init_size = AB8500_NUM_REGULATOR_REGISTERS;
  1481. abx500_regulator.match = ab8500_regulator_match;
  1482. abx500_regulator.match_size = ARRAY_SIZE(ab8500_regulator_match);
  1483. }
  1484. }
  1485. static int ab8500_regulator_register(struct platform_device *pdev,
  1486. struct regulator_init_data *init_data,
  1487. int id, struct device_node *np)
  1488. {
  1489. struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
  1490. struct ab8500_regulator_info *info = NULL;
  1491. struct regulator_config config = { };
  1492. struct regulator_dev *rdev;
  1493. /* assign per-regulator data */
  1494. info = &abx500_regulator.info[id];
  1495. info->dev = &pdev->dev;
  1496. config.dev = &pdev->dev;
  1497. config.init_data = init_data;
  1498. config.driver_data = info;
  1499. config.of_node = np;
  1500. /* fix for hardware before ab8500v2.0 */
  1501. if (is_ab8500_1p1_or_earlier(ab8500)) {
  1502. if (info->desc.id == AB8500_LDO_AUX3) {
  1503. info->desc.n_voltages =
  1504. ARRAY_SIZE(ldo_vauxn_voltages);
  1505. info->desc.volt_table = ldo_vauxn_voltages;
  1506. info->voltage_mask = 0xf;
  1507. }
  1508. }
  1509. /* register regulator with framework */
  1510. rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
  1511. if (IS_ERR(rdev)) {
  1512. dev_err(&pdev->dev, "failed to register regulator %s\n",
  1513. info->desc.name);
  1514. return PTR_ERR(rdev);
  1515. }
  1516. return 0;
  1517. }
  1518. static int ab8500_regulator_probe(struct platform_device *pdev)
  1519. {
  1520. struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
  1521. struct device_node *np = pdev->dev.of_node;
  1522. struct of_regulator_match *match;
  1523. int err, i;
  1524. if (!ab8500) {
  1525. dev_err(&pdev->dev, "null mfd parent\n");
  1526. return -EINVAL;
  1527. }
  1528. abx500_get_regulator_info(ab8500);
  1529. err = of_regulator_match(&pdev->dev, np,
  1530. abx500_regulator.match,
  1531. abx500_regulator.match_size);
  1532. if (err < 0) {
  1533. dev_err(&pdev->dev,
  1534. "Error parsing regulator init data: %d\n", err);
  1535. return err;
  1536. }
  1537. match = abx500_regulator.match;
  1538. for (i = 0; i < abx500_regulator.info_size; i++) {
  1539. err = ab8500_regulator_register(pdev, match[i].init_data, i,
  1540. match[i].of_node);
  1541. if (err)
  1542. return err;
  1543. }
  1544. return 0;
  1545. }
  1546. static struct platform_driver ab8500_regulator_driver = {
  1547. .probe = ab8500_regulator_probe,
  1548. .driver = {
  1549. .name = "ab8500-regulator",
  1550. },
  1551. };
  1552. static int __init ab8500_regulator_init(void)
  1553. {
  1554. int ret;
  1555. ret = platform_driver_register(&ab8500_regulator_driver);
  1556. if (ret != 0)
  1557. pr_err("Failed to register ab8500 regulator: %d\n", ret);
  1558. return ret;
  1559. }
  1560. subsys_initcall(ab8500_regulator_init);
  1561. static void __exit ab8500_regulator_exit(void)
  1562. {
  1563. platform_driver_unregister(&ab8500_regulator_driver);
  1564. }
  1565. module_exit(ab8500_regulator_exit);
  1566. MODULE_LICENSE("GPL v2");
  1567. MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>");
  1568. MODULE_AUTHOR("Bengt Jonsson <bengt.g.jonsson@stericsson.com>");
  1569. MODULE_AUTHOR("Daniel Willerud <daniel.willerud@stericsson.com>");
  1570. MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC");
  1571. MODULE_ALIAS("platform:ab8500-regulator");