1
2
3
4
5
6
7
8
9
10
11
12#include <linux/kernel.h>
13#include <linux/regulator/machine.h>
14#include <linux/regulator/ab8500.h>
15#include "board-mop500-regulators.h"
16#include "id.h"
17
18static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
19 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
20};
21
22struct regulator_init_data gpio_en_3v3_regulator = {
23 .constraints = {
24 .name = "EN-3V3",
25 .min_uV = 3300000,
26 .max_uV = 3300000,
27 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
28 },
29 .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
30 .consumer_supplies = gpio_en_3v3_consumers,
31};
32
33static struct regulator_consumer_supply sdi0_reg_consumers[] = {
34 REGULATOR_SUPPLY("vqmmc", "sdi0"),
35};
36
37struct regulator_init_data sdi0_reg_init_data = {
38 .constraints = {
39 .min_uV = 1800000,
40 .max_uV = 2900000,
41 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE|REGULATOR_CHANGE_STATUS,
42 },
43 .num_consumer_supplies = ARRAY_SIZE(sdi0_reg_consumers),
44 .consumer_supplies = sdi0_reg_consumers,
45};
46
47
48
49
50static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
51
52
53
54
55
56
57 REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
58};
59
60struct regulator_init_data tps61052_regulator = {
61 .constraints = {
62 .name = "vaudio-hf",
63 .min_uV = 4500000,
64 .max_uV = 4500000,
65 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
66 },
67 .num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
68 .consumer_supplies = tps61052_vaudio_consumers,
69};
70
71static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
72
73 REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
74
75 REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"),
76
77 REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"),
78
79 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
80
81 REGULATOR_SUPPLY("vcc", "2-0029"),
82
83 REGULATOR_SUPPLY("vdd", "2-0018"),
84
85 REGULATOR_SUPPLY("vdd", "2-0019"),
86
87 REGULATOR_SUPPLY("vdd", "2-001e"),
88
89 REGULATOR_SUPPLY("avdd", "3-005c"),
90 REGULATOR_SUPPLY("avdd", "3-005d"),
91
92 REGULATOR_SUPPLY("vdd", "3-004b"),
93
94 REGULATOR_SUPPLY("vdd", "2-0068"),
95
96 REGULATOR_SUPPLY("vdd", "3-0029"),
97
98 REGULATOR_SUPPLY("vdd", "2-005c"),
99
100 REGULATOR_SUPPLY("vcpin", "spi8.0"),
101
102 REGULATOR_SUPPLY("vaux12v5", "mmio_camera"),
103};
104
105static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
106
107 REGULATOR_SUPPLY("vmmc", "sdi4"),
108
109 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
110
111 REGULATOR_SUPPLY("vcc-N2158", "ab8500-acc-det.0"),
112
113 REGULATOR_SUPPLY("vcc-N2158", "mcde_tv_ab8500.4"),
114
115 REGULATOR_SUPPLY("vcc-N2158", "av8100_hdmi.3"),
116};
117
118static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
119 REGULATOR_SUPPLY("v-SD-STM", "stm"),
120
121 REGULATOR_SUPPLY("vmmc", "sdi0"),
122};
123
124static struct regulator_consumer_supply ab8505_vaux4_consumers[] = {
125};
126
127static struct regulator_consumer_supply ab8505_vaux5_consumers[] = {
128};
129
130static struct regulator_consumer_supply ab8505_vaux6_consumers[] = {
131};
132
133static struct regulator_consumer_supply ab8505_vaux8_consumers[] = {
134
135 REGULATOR_SUPPLY("v-aux8", NULL),
136};
137
138static struct regulator_consumer_supply ab8505_vadc_consumers[] = {
139
140 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
141
142 REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"),
143};
144
145static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
146
147 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
148
149 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
150
151 REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"),
152
153 REGULATOR_SUPPLY("vtvout", "mcde_tv_ab8500.4"),
154};
155
156static struct regulator_consumer_supply ab8500_vaud_consumers[] = {
157
158 REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
159};
160
161static struct regulator_consumer_supply ab8500_vamic1_consumers[] = {
162
163 REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
164};
165
166static struct regulator_consumer_supply ab8500_vamic2_consumers[] = {
167
168 REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
169};
170
171static struct regulator_consumer_supply ab8500_vdmic_consumers[] = {
172
173 REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
174};
175
176static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
177
178 REGULATOR_SUPPLY("v-intcore", NULL),
179
180 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
181
182 REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"),
183};
184
185static struct regulator_consumer_supply ab8505_usb_consumers[] = {
186
187 REGULATOR_SUPPLY("v-ape", NULL),
188};
189
190static struct regulator_consumer_supply ab8500_vana_consumers[] = {
191
192 REGULATOR_SUPPLY("vdddsi1v2", "mcde"),
193 REGULATOR_SUPPLY("vdddsi1v2", "b2r2_core"),
194 REGULATOR_SUPPLY("vdddsi1v2", "b2r2_1_core"),
195 REGULATOR_SUPPLY("vdddsi1v2", "dsilink.0"),
196 REGULATOR_SUPPLY("vdddsi1v2", "dsilink.1"),
197 REGULATOR_SUPPLY("vdddsi1v2", "dsilink.2"),
198
199 REGULATOR_SUPPLY("vddcsi1v2", "mmio_camera"),
200};
201
202
203static struct ab8500_regulator_reg_init ab8500_reg_init[] = {
204
205
206
207
208 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00),
209
210
211
212
213
214
215 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00),
216
217
218
219
220 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00),
221
222
223
224
225
226
227 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00),
228
229
230
231
232
233 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40),
234
235
236
237
238
239
240 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00),
241
242
243
244
245
246 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00),
247
248
249
250
251
252
253 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00),
254
255
256
257
258
259 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04),
260
261
262
263
264 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00),
265
266
267
268
269
270
271
272 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00),
273
274
275
276
277
278
279
280
281
282 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a),
283
284
285
286
287
288
289
290
291
292 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20),
293
294
295
296
297
298
299
300 INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10),
301
302
303
304
305
306
307 INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00),
308
309
310
311
312 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00),
313
314
315
316
317 INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02),
318
319
320
321
322 INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00),
323
324
325
326
327
328
329
330 INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x13),
331
332
333
334
335 INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01),
336
337
338
339 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00),
340
341
342
343 INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x0C),
344
345
346
347 INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d),
348
349
350
351 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07),
352
353
354
355 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00),
356
357
358
359
360
361
362
363
364 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00),
365
366
367
368
369
370 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00),
371};
372
373
374static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
375
376 [AB8500_LDO_AUX1] = {
377 .supply_regulator = "ab8500-ext-supply3",
378 .constraints = {
379 .name = "V-DISPLAY",
380 .min_uV = 2800000,
381 .max_uV = 3300000,
382 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
383 REGULATOR_CHANGE_STATUS,
384 .boot_on = 1,
385 },
386 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
387 .consumer_supplies = ab8500_vaux1_consumers,
388 },
389
390 [AB8500_LDO_AUX2] = {
391 .supply_regulator = "ab8500-ext-supply3",
392 .constraints = {
393 .name = "V-eMMC1",
394 .min_uV = 1100000,
395 .max_uV = 3300000,
396 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
397 REGULATOR_CHANGE_STATUS |
398 REGULATOR_CHANGE_MODE,
399 .valid_modes_mask = REGULATOR_MODE_NORMAL |
400 REGULATOR_MODE_IDLE,
401 },
402 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
403 .consumer_supplies = ab8500_vaux2_consumers,
404 },
405
406 [AB8500_LDO_AUX3] = {
407 .supply_regulator = "ab8500-ext-supply3",
408 .constraints = {
409 .name = "V-MMC-SD",
410 .min_uV = 1100000,
411 .max_uV = 3300000,
412 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
413 REGULATOR_CHANGE_STATUS |
414 REGULATOR_CHANGE_MODE,
415 .valid_modes_mask = REGULATOR_MODE_NORMAL |
416 REGULATOR_MODE_IDLE,
417 },
418 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
419 .consumer_supplies = ab8500_vaux3_consumers,
420 },
421
422 [AB8500_LDO_TVOUT] = {
423 .constraints = {
424 .name = "V-TVOUT",
425 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
426 },
427 .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
428 .consumer_supplies = ab8500_vtvout_consumers,
429 },
430
431 [AB8500_LDO_AUDIO] = {
432 .constraints = {
433 .name = "V-AUD",
434 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
435 },
436 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers),
437 .consumer_supplies = ab8500_vaud_consumers,
438 },
439
440 [AB8500_LDO_ANAMIC1] = {
441 .constraints = {
442 .name = "V-AMIC1",
443 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
444 },
445 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers),
446 .consumer_supplies = ab8500_vamic1_consumers,
447 },
448
449 [AB8500_LDO_ANAMIC2] = {
450 .constraints = {
451 .name = "V-AMIC2",
452 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
453 },
454 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers),
455 .consumer_supplies = ab8500_vamic2_consumers,
456 },
457
458 [AB8500_LDO_DMIC] = {
459 .constraints = {
460 .name = "V-DMIC",
461 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
462 },
463 .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers),
464 .consumer_supplies = ab8500_vdmic_consumers,
465 },
466
467 [AB8500_LDO_INTCORE] = {
468 .constraints = {
469 .name = "V-INTCORE",
470 .min_uV = 1250000,
471 .max_uV = 1350000,
472 .input_uV = 1800000,
473 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
474 REGULATOR_CHANGE_STATUS |
475 REGULATOR_CHANGE_MODE |
476 REGULATOR_CHANGE_DRMS,
477 .valid_modes_mask = REGULATOR_MODE_NORMAL |
478 REGULATOR_MODE_IDLE,
479 },
480 .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
481 .consumer_supplies = ab8500_vintcore_consumers,
482 },
483
484 [AB8500_LDO_ANA] = {
485 .constraints = {
486 .name = "V-CSI-DSI",
487 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
488 },
489 .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
490 .consumer_supplies = ab8500_vana_consumers,
491 },
492};
493
494
495static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
496
497 REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
498};
499
500
501static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
502 .hwreq = true,
503};
504
505
506
507
508static struct regulator_init_data ab8500_ext_regulators[] = {
509
510 [AB8500_EXT_SUPPLY1] = {
511 .constraints = {
512 .name = "ab8500-ext-supply1",
513 .min_uV = 1800000,
514 .max_uV = 1800000,
515 .initial_mode = REGULATOR_MODE_IDLE,
516 .boot_on = 1,
517 .always_on = 1,
518 },
519 },
520
521 [AB8500_EXT_SUPPLY2] = {
522 .constraints = {
523 .name = "ab8500-ext-supply2",
524 .min_uV = 1360000,
525 .max_uV = 1360000,
526 },
527 },
528
529 [AB8500_EXT_SUPPLY3] = {
530 .constraints = {
531 .name = "ab8500-ext-supply3",
532 .min_uV = 3400000,
533 .max_uV = 3400000,
534 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
535 .boot_on = 1,
536 },
537 .num_consumer_supplies =
538 ARRAY_SIZE(ab8500_ext_supply3_consumers),
539 .consumer_supplies = ab8500_ext_supply3_consumers,
540 },
541};
542
543
544static struct ab8500_regulator_reg_init ab8505_reg_init[] = {
545
546
547
548
549
550
551 INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL1, 0x00, 0x00),
552
553
554
555
556
557 INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL2, 0x30, 0x00),
558
559
560
561
562 INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL3, 0xf0, 0x00),
563
564
565
566
567 INIT_REGULATOR_REGISTER(AB8505_REGUREQUESTCTRL4, 0x07, 0x00),
568
569
570
571
572
573
574
575
576
577
578 INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00),
579
580
581
582
583
584
585 INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQ1HPVALID2, 0x00, 0x00),
586
587
588
589
590
591
592
593
594
595
596 INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ1VALID1, 0xe8, 0x00),
597
598
599
600 INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ1VALID2, 0x00, 0x00),
601
602
603
604
605
606
607
608
609
610
611 INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ2VALID1, 0xe8, 0x00),
612
613
614
615 INIT_REGULATOR_REGISTER(AB8505_REGUHWHPREQ2VALID2, 0x00, 0x00),
616
617
618
619
620
621
622
623
624
625
626
627 INIT_REGULATOR_REGISTER(AB8505_REGUSWHPREQVALID1, 0xa0, 0x00),
628
629
630
631
632
633 INIT_REGULATOR_REGISTER(AB8505_REGUSWHPREQVALID2, 0x03, 0x00),
634
635
636
637
638
639 INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQVALID1, 0x0e, 0x0a),
640
641
642
643
644
645 INIT_REGULATOR_REGISTER(AB8505_REGUSYSCLKREQVALID2, 0x0e, 0x00),
646
647
648
649
650
651
652 INIT_REGULATOR_REGISTER(AB8505_REGUVAUX4REQVALID, 0x00, 0x00),
653
654
655
656
657
658
659
660 INIT_REGULATOR_REGISTER(AB8505_REGUMISC1, 0xfe, 0x10),
661
662
663
664
665
666
667 INIT_REGULATOR_REGISTER(AB8505_VAUDIOSUPPLY, 0x1e, 0x00),
668
669
670
671
672 INIT_REGULATOR_REGISTER(AB8505_REGUCTRL1VAMIC, 0x03, 0x00),
673
674
675
676
677
678
679 INIT_REGULATOR_REGISTER(AB8505_VSMPSAREGU, 0x00, 0x00),
680
681
682
683
684
685
686 INIT_REGULATOR_REGISTER(AB8505_VSMPSBREGU, 0x00, 0x00),
687
688
689
690
691
692
693 INIT_REGULATOR_REGISTER(AB8505_VSAFEREGU, 0x00, 0x00),
694
695
696
697
698 INIT_REGULATOR_REGISTER(AB8505_VPLLVANAREGU, 0x0f, 0x02),
699
700
701
702
703
704
705
706 INIT_REGULATOR_REGISTER(AB8505_EXTSUPPLYREGU, 0xff, 0x30),
707
708
709
710
711 INIT_REGULATOR_REGISTER(AB8505_VAUX12REGU, 0x0f, 0x01),
712
713
714
715 INIT_REGULATOR_REGISTER(AB8505_VRF1VAUX3REGU, 0x03, 0x00),
716
717
718
719 INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL1, 0x00, 0x00),
720
721
722
723 INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL2, 0x00, 0x00),
724
725
726
727 INIT_REGULATOR_REGISTER(AB8505_VSMPSASEL3, 0x00, 0x00),
728
729
730
731 INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL1, 0x00, 0x00),
732
733
734
735 INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL2, 0x00, 0x00),
736
737
738
739 INIT_REGULATOR_REGISTER(AB8505_VSMPSBSEL3, 0x00, 0x00),
740
741
742
743 INIT_REGULATOR_REGISTER(AB8505_VSAFESEL1, 0x00, 0x00),
744
745
746
747 INIT_REGULATOR_REGISTER(AB8505_VSAFESEL2, 0x00, 0x00),
748
749
750
751 INIT_REGULATOR_REGISTER(AB8505_VSAFESEL3, 0x00, 0x00),
752
753
754
755 INIT_REGULATOR_REGISTER(AB8505_VAUX1SEL, 0x0f, 0x0C),
756
757
758
759 INIT_REGULATOR_REGISTER(AB8505_VAUX2SEL, 0x0f, 0x0d),
760
761
762
763 INIT_REGULATOR_REGISTER(AB8505_VRF1VAUX3SEL, 0x07, 0x07),
764
765
766
767 INIT_REGULATOR_REGISTER(AB8505_VAUX4REQCTRL, 0x00, 0x00),
768
769
770
771 INIT_REGULATOR_REGISTER(AB8505_VAUX4REGU, 0x00, 0x00),
772
773
774
775 INIT_REGULATOR_REGISTER(AB8505_VAUX4SEL, 0x00, 0x00),
776
777
778
779
780
781
782
783
784 INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH, 0xfc, 0x00),
785
786
787
788
789
790 INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH2, 0x16, 0x00),
791
792
793
794 INIT_REGULATOR_REGISTER(AB8505_REGUCTRLDISCH3, 0x01, 0x00),
795
796
797
798
799
800
801
802
803 INIT_REGULATOR_REGISTER(AB8505_CTRLVAUX5, 0x00, 0x00),
804
805
806
807
808
809
810 INIT_REGULATOR_REGISTER(AB8505_CTRLVAUX6, 0x00, 0x00),
811};
812
813struct regulator_init_data ab8505_regulators[AB8505_NUM_REGULATORS] = {
814
815 [AB8505_LDO_AUX1] = {
816 .constraints = {
817 .name = "V-DISPLAY",
818 .min_uV = 2800000,
819 .max_uV = 3300000,
820 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
821 REGULATOR_CHANGE_STATUS,
822 .boot_on = 1,
823 },
824 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
825 .consumer_supplies = ab8500_vaux1_consumers,
826 },
827
828 [AB8505_LDO_AUX2] = {
829 .constraints = {
830 .name = "V-eMMC1",
831 .min_uV = 1100000,
832 .max_uV = 3300000,
833 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
834 REGULATOR_CHANGE_STATUS |
835 REGULATOR_CHANGE_MODE,
836 .valid_modes_mask = REGULATOR_MODE_NORMAL |
837 REGULATOR_MODE_IDLE,
838 },
839 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
840 .consumer_supplies = ab8500_vaux2_consumers,
841 },
842
843 [AB8505_LDO_AUX3] = {
844 .constraints = {
845 .name = "V-MMC-SD",
846 .min_uV = 1100000,
847 .max_uV = 3300000,
848 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
849 REGULATOR_CHANGE_STATUS |
850 REGULATOR_CHANGE_MODE,
851 .valid_modes_mask = REGULATOR_MODE_NORMAL |
852 REGULATOR_MODE_IDLE,
853 },
854 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
855 .consumer_supplies = ab8500_vaux3_consumers,
856 },
857
858 [AB8505_LDO_AUX4] = {
859 .constraints = {
860 .name = "V-NFC-SE",
861 .min_uV = 1100000,
862 .max_uV = 3300000,
863 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
864 REGULATOR_CHANGE_STATUS |
865 REGULATOR_CHANGE_MODE,
866 .valid_modes_mask = REGULATOR_MODE_NORMAL |
867 REGULATOR_MODE_IDLE,
868 },
869 .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux4_consumers),
870 .consumer_supplies = ab8505_vaux4_consumers,
871 },
872
873 [AB8505_LDO_AUX5] = {
874 .constraints = {
875 .name = "V-AUX5",
876 .min_uV = 1050000,
877 .max_uV = 2790000,
878 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
879 REGULATOR_CHANGE_STATUS |
880 REGULATOR_CHANGE_MODE,
881 .valid_modes_mask = REGULATOR_MODE_NORMAL |
882 REGULATOR_MODE_IDLE,
883 },
884 .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux5_consumers),
885 .consumer_supplies = ab8505_vaux5_consumers,
886 },
887
888 [AB8505_LDO_AUX6] = {
889 .constraints = {
890 .name = "V-AUX6",
891 .min_uV = 1050000,
892 .max_uV = 2790000,
893 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
894 REGULATOR_CHANGE_STATUS |
895 REGULATOR_CHANGE_MODE,
896 .valid_modes_mask = REGULATOR_MODE_NORMAL |
897 REGULATOR_MODE_IDLE,
898 },
899 .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux6_consumers),
900 .consumer_supplies = ab8505_vaux6_consumers,
901 },
902
903 [AB8505_LDO_ADC] = {
904 .constraints = {
905 .name = "V-ADC",
906 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
907 },
908 .num_consumer_supplies = ARRAY_SIZE(ab8505_vadc_consumers),
909 .consumer_supplies = ab8505_vadc_consumers,
910 },
911
912 [AB8505_LDO_AUDIO] = {
913 .constraints = {
914 .name = "V-AUD",
915 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
916 },
917 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers),
918 .consumer_supplies = ab8500_vaud_consumers,
919 },
920
921 [AB8505_LDO_ANAMIC1] = {
922 .constraints = {
923 .name = "V-AMIC1",
924 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
925 REGULATOR_CHANGE_MODE,
926 .valid_modes_mask = REGULATOR_MODE_NORMAL |
927 REGULATOR_MODE_IDLE,
928 },
929 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers),
930 .consumer_supplies = ab8500_vamic1_consumers,
931 },
932
933 [AB8505_LDO_ANAMIC2] = {
934 .constraints = {
935 .name = "V-AMIC2",
936 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
937 REGULATOR_CHANGE_MODE,
938 .valid_modes_mask = REGULATOR_MODE_NORMAL |
939 REGULATOR_MODE_IDLE,
940 },
941 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers),
942 .consumer_supplies = ab8500_vamic2_consumers,
943 },
944
945 [AB8505_LDO_AUX8] = {
946 .constraints = {
947 .name = "V-AUX8",
948 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
949 },
950 .num_consumer_supplies = ARRAY_SIZE(ab8505_vaux8_consumers),
951 .consumer_supplies = ab8505_vaux8_consumers,
952 },
953
954 [AB8505_LDO_INTCORE] = {
955 .constraints = {
956 .name = "V-INTCORE",
957 .min_uV = 1250000,
958 .max_uV = 1350000,
959 .input_uV = 1800000,
960 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
961 REGULATOR_CHANGE_STATUS |
962 REGULATOR_CHANGE_MODE |
963 REGULATOR_CHANGE_DRMS,
964 .valid_modes_mask = REGULATOR_MODE_NORMAL |
965 REGULATOR_MODE_IDLE,
966 },
967 .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
968 .consumer_supplies = ab8500_vintcore_consumers,
969 },
970
971 [AB8505_LDO_USB] = {
972 .constraints = {
973 .name = "V-USB",
974 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
975 REGULATOR_CHANGE_MODE,
976 .valid_modes_mask = REGULATOR_MODE_NORMAL |
977 REGULATOR_MODE_IDLE,
978 },
979 .num_consumer_supplies = ARRAY_SIZE(ab8505_usb_consumers),
980 .consumer_supplies = ab8505_usb_consumers,
981 },
982
983 [AB8505_LDO_ANA] = {
984 .constraints = {
985 .name = "V-CSI-DSI",
986 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
987 },
988 .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
989 .consumer_supplies = ab8500_vana_consumers,
990 },
991};
992
993struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
994 .reg_init = ab8500_reg_init,
995 .num_reg_init = ARRAY_SIZE(ab8500_reg_init),
996 .regulator = ab8500_regulators,
997 .num_regulator = ARRAY_SIZE(ab8500_regulators),
998 .ext_regulator = ab8500_ext_regulators,
999 .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators),
1000};
1001
1002struct ab8500_regulator_platform_data ab8505_regulator_plat_data = {
1003 .reg_init = ab8505_reg_init,
1004 .num_reg_init = ARRAY_SIZE(ab8505_reg_init),
1005 .regulator = ab8505_regulators,
1006 .num_regulator = ARRAY_SIZE(ab8505_regulators),
1007};
1008
1009static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
1010{
1011 int i;
1012
1013 if (cpu_is_u8520()) {
1014 for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) {
1015 if (ab8505_reg_init[i].id == id) {
1016 u8 initval = ab8505_reg_init[i].value;
1017 initval = (initval & ~mask) | (value & mask);
1018 ab8505_reg_init[i].value = initval;
1019
1020 BUG_ON(mask & ~ab8505_reg_init[i].mask);
1021 return;
1022 }
1023 }
1024 } else {
1025 for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
1026 if (ab8500_reg_init[i].id == id) {
1027 u8 initval = ab8500_reg_init[i].value;
1028 initval = (initval & ~mask) | (value & mask);
1029 ab8500_reg_init[i].value = initval;
1030
1031 BUG_ON(mask & ~ab8500_reg_init[i].mask);
1032 return;
1033 }
1034 }
1035 }
1036
1037 BUG_ON(1);
1038}
1039
1040void mop500_regulator_init(void)
1041{
1042 struct regulator_init_data *regulator;
1043
1044
1045
1046
1047 if (cpu_is_u8520()) {
1048
1049 ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05);
1050 }
1051
1052
1053
1054
1055
1056 if (cpu_is_u8500v20()) {
1057
1058 ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01);
1059
1060
1061 ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2,
1062 0x20, 0x20);
1063
1064
1065 ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04);
1066
1067
1068 regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
1069 regulator->constraints.always_on = 1;
1070
1071
1072 regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
1073 regulator->constraints.state_mem.disabled = 1;
1074 regulator->constraints.state_standby.disabled = 1;
1075
1076
1077 regulator->driver_data = (void *)&ab8500_ext_supply2;
1078 }
1079}
1080