Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
[pandora-kernel.git] / arch / arm / mach-ux500 / board-mop500-regulators.c
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>
7  *          Bengt Jonsson <bengt.g.jonsson@stericsson.com>
8  *
9  * MOP500 board specific initialization for regulators
10  */
11 #include <linux/kernel.h>
12 #include <linux/regulator/machine.h>
13 #include <linux/regulator/ab8500.h>
14 #include "board-mop500-regulators.h"
15
16 static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
17         /* External displays, connector on board 2v5 power supply */
18         REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
19         /* SFH7741 proximity sensor */
20         REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
21         /* BH1780GLS ambient light sensor */
22         REGULATOR_SUPPLY("vcc", "2-0029"),
23         /* lsm303dlh accelerometer */
24         REGULATOR_SUPPLY("vdd", "3-0018"),
25         /* lsm303dlh magnetometer */
26         REGULATOR_SUPPLY("vdd", "3-001e"),
27         /* Rohm BU21013 Touchscreen devices */
28         REGULATOR_SUPPLY("avdd", "3-005c"),
29         REGULATOR_SUPPLY("avdd", "3-005d"),
30         /* Synaptics RMI4 Touchscreen device */
31         REGULATOR_SUPPLY("vdd", "3-004b"),
32 };
33
34 static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
35         /* On-board eMMC power */
36         REGULATOR_SUPPLY("vmmc", "sdi4"),
37         /* AB8500 audio codec */
38         REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
39 };
40
41 static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
42         /* External MMC slot power */
43         REGULATOR_SUPPLY("vmmc", "sdi0"),
44 };
45
46 static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
47         /* TV-out DENC supply */
48         REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
49         /* Internal general-purpose ADC */
50         REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
51 };
52
53 static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
54         /* SoC core supply, no device */
55         REGULATOR_SUPPLY("v-intcore", NULL),
56         /* USB Transciever */
57         REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
58 };
59
60 static struct regulator_consumer_supply ab8500_vana_consumers[] = {
61         /* External displays, connector on board, 1v8 power supply */
62         REGULATOR_SUPPLY("vsmps2", "mcde.0"),
63 };
64
65 /* AB8500 regulators */
66 struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
67         /* supplies to the display/camera */
68         [AB8500_LDO_AUX1] = {
69                 .constraints = {
70                         .name = "V-DISPLAY",
71                         .min_uV = 2500000,
72                         .max_uV = 2900000,
73                         .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
74                                           REGULATOR_CHANGE_STATUS,
75                 },
76                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
77                 .consumer_supplies = ab8500_vaux1_consumers,
78         },
79         /* supplies to the on-board eMMC */
80         [AB8500_LDO_AUX2] = {
81                 .constraints = {
82                         .name = "V-eMMC1",
83                         .min_uV = 1100000,
84                         .max_uV = 3300000,
85                         .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
86                                           REGULATOR_CHANGE_STATUS,
87                 },
88                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
89                 .consumer_supplies = ab8500_vaux2_consumers,
90         },
91         /* supply for VAUX3, supplies to SDcard slots */
92         [AB8500_LDO_AUX3] = {
93                 .constraints = {
94                         .name = "V-MMC-SD",
95                         .min_uV = 1100000,
96                         .max_uV = 3300000,
97                         .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
98                                           REGULATOR_CHANGE_STATUS,
99                 },
100                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
101                 .consumer_supplies = ab8500_vaux3_consumers,
102         },
103         /* supply for tvout, gpadc, TVOUT LDO */
104         [AB8500_LDO_TVOUT] = {
105                 .constraints = {
106                         .name = "V-TVOUT",
107                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
108                 },
109                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
110                 .consumer_supplies = ab8500_vtvout_consumers,
111         },
112         /* supply for ab8500-vaudio, VAUDIO LDO */
113         [AB8500_LDO_AUDIO] = {
114                 .constraints = {
115                         .name = "V-AUD",
116                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
117                 },
118         },
119         /* supply for v-anamic1 VAMic1-LDO */
120         [AB8500_LDO_ANAMIC1] = {
121                 .constraints = {
122                         .name = "V-AMIC1",
123                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
124                 },
125         },
126         /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
127         [AB8500_LDO_ANAMIC2] = {
128                 .constraints = {
129                         .name = "V-AMIC2",
130                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
131                 },
132         },
133         /* supply for v-dmic, VDMIC LDO */
134         [AB8500_LDO_DMIC] = {
135                 .constraints = {
136                         .name = "V-DMIC",
137                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
138                 },
139         },
140         /* supply for v-intcore12, VINTCORE12 LDO */
141         [AB8500_LDO_INTCORE] = {
142                 .constraints = {
143                         .name = "V-INTCORE",
144                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
145                 },
146                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
147                 .consumer_supplies = ab8500_vintcore_consumers,
148         },
149         /* supply for U8500 CSI/DSI, VANA LDO */
150         [AB8500_LDO_ANA] = {
151                 .constraints = {
152                         .name = "V-CSI/DSI",
153                         .valid_ops_mask = REGULATOR_CHANGE_STATUS,
154                 },
155                 .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
156                 .consumer_supplies = ab8500_vana_consumers,
157         },
158 };