ab8500.c 41 KB

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