aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65910-regulator.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-07-06 04:43:12 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-06 14:11:05 -0400
commit19228a6a59250d414824ae07e06ad057a404ea3e (patch)
tree12fb44aeb551cd584f286197427e63b9add709dd /drivers/regulator/tps65910-regulator.c
parent6be5bfc3bf0d31a70745a52e69f7f46de974193f (diff)
regulator: tps65910: add support for input supply
There is multiple voltage input pins on device which takes the voltage input for different voltage regulator. Support to configure the voltage input supplied by different regulator for each regulators. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps65910-regulator.c')
-rw-r--r--drivers/regulator/tps65910-regulator.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index a534e0872006..e319d963fee6 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -85,6 +85,7 @@ static const unsigned int VMMC_VSEL_table[] = {
85 85
86struct tps_info { 86struct tps_info {
87 const char *name; 87 const char *name;
88 const char *vin_name;
88 u8 n_voltages; 89 u8 n_voltages;
89 const unsigned int *voltage_table; 90 const unsigned int *voltage_table;
90 int enable_time_us; 91 int enable_time_us;
@@ -93,20 +94,24 @@ struct tps_info {
93static struct tps_info tps65910_regs[] = { 94static struct tps_info tps65910_regs[] = {
94 { 95 {
95 .name = "vrtc", 96 .name = "vrtc",
97 .vin_name = "vcc7",
96 .enable_time_us = 2200, 98 .enable_time_us = 2200,
97 }, 99 },
98 { 100 {
99 .name = "vio", 101 .name = "vio",
102 .vin_name = "vccio",
100 .n_voltages = ARRAY_SIZE(VIO_VSEL_table), 103 .n_voltages = ARRAY_SIZE(VIO_VSEL_table),
101 .voltage_table = VIO_VSEL_table, 104 .voltage_table = VIO_VSEL_table,
102 .enable_time_us = 350, 105 .enable_time_us = 350,
103 }, 106 },
104 { 107 {
105 .name = "vdd1", 108 .name = "vdd1",
109 .vin_name = "vcc1",
106 .enable_time_us = 350, 110 .enable_time_us = 350,
107 }, 111 },
108 { 112 {
109 .name = "vdd2", 113 .name = "vdd2",
114 .vin_name = "vcc2",
110 .enable_time_us = 350, 115 .enable_time_us = 350,
111 }, 116 },
112 { 117 {
@@ -117,48 +122,56 @@ static struct tps_info tps65910_regs[] = {
117 }, 122 },
118 { 123 {
119 .name = "vdig1", 124 .name = "vdig1",
125 .vin_name = "vcc6",
120 .n_voltages = ARRAY_SIZE(VDIG1_VSEL_table), 126 .n_voltages = ARRAY_SIZE(VDIG1_VSEL_table),
121 .voltage_table = VDIG1_VSEL_table, 127 .voltage_table = VDIG1_VSEL_table,
122 .enable_time_us = 100, 128 .enable_time_us = 100,
123 }, 129 },
124 { 130 {
125 .name = "vdig2", 131 .name = "vdig2",
132 .vin_name = "vcc6",
126 .n_voltages = ARRAY_SIZE(VDIG2_VSEL_table), 133 .n_voltages = ARRAY_SIZE(VDIG2_VSEL_table),
127 .voltage_table = VDIG2_VSEL_table, 134 .voltage_table = VDIG2_VSEL_table,
128 .enable_time_us = 100, 135 .enable_time_us = 100,
129 }, 136 },
130 { 137 {
131 .name = "vpll", 138 .name = "vpll",
139 .vin_name = "vcc5",
132 .n_voltages = ARRAY_SIZE(VPLL_VSEL_table), 140 .n_voltages = ARRAY_SIZE(VPLL_VSEL_table),
133 .voltage_table = VPLL_VSEL_table, 141 .voltage_table = VPLL_VSEL_table,
134 .enable_time_us = 100, 142 .enable_time_us = 100,
135 }, 143 },
136 { 144 {
137 .name = "vdac", 145 .name = "vdac",
146 .vin_name = "vcc5",
138 .n_voltages = ARRAY_SIZE(VDAC_VSEL_table), 147 .n_voltages = ARRAY_SIZE(VDAC_VSEL_table),
139 .voltage_table = VDAC_VSEL_table, 148 .voltage_table = VDAC_VSEL_table,
140 .enable_time_us = 100, 149 .enable_time_us = 100,
141 }, 150 },
142 { 151 {
143 .name = "vaux1", 152 .name = "vaux1",
153 .vin_name = "vcc4",
144 .n_voltages = ARRAY_SIZE(VAUX1_VSEL_table), 154 .n_voltages = ARRAY_SIZE(VAUX1_VSEL_table),
145 .voltage_table = VAUX1_VSEL_table, 155 .voltage_table = VAUX1_VSEL_table,
146 .enable_time_us = 100, 156 .enable_time_us = 100,
147 }, 157 },
148 { 158 {
149 .name = "vaux2", 159 .name = "vaux2",
160 .vin_name = "vcc4",
150 .n_voltages = ARRAY_SIZE(VAUX2_VSEL_table), 161 .n_voltages = ARRAY_SIZE(VAUX2_VSEL_table),
151 .voltage_table = VAUX2_VSEL_table, 162 .voltage_table = VAUX2_VSEL_table,
152 .enable_time_us = 100, 163 .enable_time_us = 100,
153 }, 164 },
154 { 165 {
155 .name = "vaux33", 166 .name = "vaux33",
167 .vin_name = "vcc3",
156 .n_voltages = ARRAY_SIZE(VAUX33_VSEL_table), 168 .n_voltages = ARRAY_SIZE(VAUX33_VSEL_table),
157 .voltage_table = VAUX33_VSEL_table, 169 .voltage_table = VAUX33_VSEL_table,
158 .enable_time_us = 100, 170 .enable_time_us = 100,
159 }, 171 },
160 { 172 {
161 .name = "vmmc", 173 .name = "vmmc",
174 .vin_name = "vcc3",
162 .n_voltages = ARRAY_SIZE(VMMC_VSEL_table), 175 .n_voltages = ARRAY_SIZE(VMMC_VSEL_table),
163 .voltage_table = VMMC_VSEL_table, 176 .voltage_table = VMMC_VSEL_table,
164 .enable_time_us = 100, 177 .enable_time_us = 100,
@@ -168,21 +181,25 @@ static struct tps_info tps65910_regs[] = {
168static struct tps_info tps65911_regs[] = { 181static struct tps_info tps65911_regs[] = {
169 { 182 {
170 .name = "vrtc", 183 .name = "vrtc",
184 .vin_name = "vcc7",
171 .enable_time_us = 2200, 185 .enable_time_us = 2200,
172 }, 186 },
173 { 187 {
174 .name = "vio", 188 .name = "vio",
189 .vin_name = "vccio",
175 .n_voltages = ARRAY_SIZE(VIO_VSEL_table), 190 .n_voltages = ARRAY_SIZE(VIO_VSEL_table),
176 .voltage_table = VIO_VSEL_table, 191 .voltage_table = VIO_VSEL_table,
177 .enable_time_us = 350, 192 .enable_time_us = 350,
178 }, 193 },
179 { 194 {
180 .name = "vdd1", 195 .name = "vdd1",
196 .vin_name = "vcc1",
181 .n_voltages = 73, 197 .n_voltages = 73,
182 .enable_time_us = 350, 198 .enable_time_us = 350,
183 }, 199 },
184 { 200 {
185 .name = "vdd2", 201 .name = "vdd2",
202 .vin_name = "vcc2",
186 .n_voltages = 73, 203 .n_voltages = 73,
187 .enable_time_us = 350, 204 .enable_time_us = 350,
188 }, 205 },
@@ -193,41 +210,49 @@ static struct tps_info tps65911_regs[] = {
193 }, 210 },
194 { 211 {
195 .name = "ldo1", 212 .name = "ldo1",
213 .vin_name = "vcc6",
196 .n_voltages = 47, 214 .n_voltages = 47,
197 .enable_time_us = 420, 215 .enable_time_us = 420,
198 }, 216 },
199 { 217 {
200 .name = "ldo2", 218 .name = "ldo2",
219 .vin_name = "vcc6",
201 .n_voltages = 47, 220 .n_voltages = 47,
202 .enable_time_us = 420, 221 .enable_time_us = 420,
203 }, 222 },
204 { 223 {
205 .name = "ldo3", 224 .name = "ldo3",
225 .vin_name = "vcc5",
206 .n_voltages = 24, 226 .n_voltages = 24,
207 .enable_time_us = 230, 227 .enable_time_us = 230,
208 }, 228 },
209 { 229 {
210 .name = "ldo4", 230 .name = "ldo4",
231 .vin_name = "vcc5",
211 .n_voltages = 47, 232 .n_voltages = 47,
212 .enable_time_us = 230, 233 .enable_time_us = 230,
213 }, 234 },
214 { 235 {
215 .name = "ldo5", 236 .name = "ldo5",
237 .vin_name = "vcc4",
216 .n_voltages = 24, 238 .n_voltages = 24,
217 .enable_time_us = 230, 239 .enable_time_us = 230,
218 }, 240 },
219 { 241 {
220 .name = "ldo6", 242 .name = "ldo6",
243 .vin_name = "vcc3",
221 .n_voltages = 24, 244 .n_voltages = 24,
222 .enable_time_us = 230, 245 .enable_time_us = 230,
223 }, 246 },
224 { 247 {
225 .name = "ldo7", 248 .name = "ldo7",
249 .vin_name = "vcc3",
226 .n_voltages = 24, 250 .n_voltages = 24,
227 .enable_time_us = 230, 251 .enable_time_us = 230,
228 }, 252 },
229 { 253 {
230 .name = "ldo8", 254 .name = "ldo8",
255 .vin_name = "vcc3",
231 .n_voltages = 24, 256 .n_voltages = 24,
232 .enable_time_us = 230, 257 .enable_time_us = 230,
233 }, 258 },
@@ -1013,6 +1038,9 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
1013 *tps65910_reg_matches = matches; 1038 *tps65910_reg_matches = matches;
1014 1039
1015 for (idx = 0; idx < count; idx++) { 1040 for (idx = 0; idx < count; idx++) {
1041 struct tps_info *info = matches[idx].driver_data;
1042 char in_supply[32]; /* 32 is max size of property name */
1043
1016 if (!matches[idx].init_data || !matches[idx].of_node) 1044 if (!matches[idx].init_data || !matches[idx].of_node)
1017 continue; 1045 continue;
1018 1046
@@ -1023,6 +1051,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
1023 "ti,regulator-ext-sleep-control", &prop); 1051 "ti,regulator-ext-sleep-control", &prop);
1024 if (!ret) 1052 if (!ret)
1025 pmic_plat_data->regulator_ext_sleep_control[idx] = prop; 1053 pmic_plat_data->regulator_ext_sleep_control[idx] = prop;
1054
1055 if (info->vin_name) {
1056 snprintf(in_supply, 32, "%s-supply", info->vin_name);
1057 if (of_find_property(np, in_supply, 0))
1058 pmic_plat_data->input_supply[idx] =
1059 info->vin_name;
1060 }
1026 } 1061 }
1027 1062
1028 return pmic_plat_data; 1063 return pmic_plat_data;
@@ -1126,6 +1161,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
1126 pmic->info[i] = info; 1161 pmic->info[i] = info;
1127 1162
1128 pmic->desc[i].name = info->name; 1163 pmic->desc[i].name = info->name;
1164 pmic->desc[i].supply_name = pmic_plat_data->input_supply[i];
1129 pmic->desc[i].id = i; 1165 pmic->desc[i].id = i;
1130 pmic->desc[i].n_voltages = info->n_voltages; 1166 pmic->desc[i].n_voltages = info->n_voltages;
1131 pmic->desc[i].enable_time = info->enable_time_us; 1167 pmic->desc[i].enable_time = info->enable_time_us;