aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/mfd/tps65910.txt25
-rw-r--r--drivers/regulator/tps65910-regulator.c36
-rw-r--r--include/linux/mfd/tps65910.h2
3 files changed, 63 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt b/Documentation/devicetree/bindings/mfd/tps65910.txt
index b51d2066599c..31be5a3d9f76 100644
--- a/Documentation/devicetree/bindings/mfd/tps65910.txt
+++ b/Documentation/devicetree/bindings/mfd/tps65910.txt
@@ -32,6 +32,28 @@ Optional properties:
32 comparator. (see VMBCH_VSEL in TPS65910 datasheet) 32 comparator. (see VMBCH_VSEL in TPS65910 datasheet)
33- ti,en-gpio-sleep: enable sleep control for gpios 33- ti,en-gpio-sleep: enable sleep control for gpios
34 There should be 9 entries here, one for each gpio. 34 There should be 9 entries here, one for each gpio.
35- xxx-supply: Input voltage supply regulator.
36 Missing of these properties will be assume as there is no supply regulator
37 for that input pins and always powered on.
38 The valid input supply properties are:
39 tps65910:
40 vcc1-supply: VDD1 input.
41 vcc2-supply: VDD2 input.
42 vcc3-supply: VAUX33 and VMMC input.
43 vcc4-supply: VAUX1 and VAUX2 input.
44 vcc5-supply: VPLL and VDAC input.
45 vcc6-supply: VDIG1 and VDIG2 input.
46 vcc7-supply: VRTC input.
47 vccio-supply: VIO input.
48 tps65911:
49 vcc1-supply: VDD1 input.
50 vcc2-supply: VDD2 input.
51 vcc3-supply: LDO6, LDO7 and LDO8 input.
52 vcc4-supply: LDO5 input.
53 vcc5-supply: LDO3 and LDO4 input.
54 vcc6-supply: LDO1 and LDO2 input.
55 vcc7-supply: VRTC input.
56 vccio-supply: VIO input.
35 57
36Regulator Optional properties: 58Regulator Optional properties:
37- ti,regulator-ext-sleep-control: enable external sleep 59- ti,regulator-ext-sleep-control: enable external sleep
@@ -57,6 +79,9 @@ Example:
57 79
58 ti,en-gpio-sleep = <0 0 1 0 0 0 0 0 0>; 80 ti,en-gpio-sleep = <0 0 1 0 0 0 0 0 0>;
59 81
82 vcc7-supply = <&reg_parent>;
83 vcc1-supply = <&reg_parent>;
84
60 regulators { 85 regulators {
61 #address-cells = <1>; 86 #address-cells = <1>;
62 #size-cells = <0>; 87 #size-cells = <0>;
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;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index dd8dc0a6c462..c5f806011b32 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -799,6 +799,7 @@ struct tps65910_sleep_keepon_data {
799/** 799/**
800 * struct tps65910_board 800 * struct tps65910_board
801 * Board platform data may be used to initialize regulators. 801 * Board platform data may be used to initialize regulators.
802 * @input_supply: Name of input supply regulator.
802 */ 803 */
803 804
804struct tps65910_board { 805struct tps65910_board {
@@ -811,6 +812,7 @@ struct tps65910_board {
811 struct tps65910_sleep_keepon_data *slp_keepon; 812 struct tps65910_sleep_keepon_data *slp_keepon;
812 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; 813 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
813 unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; 814 unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
815 const char *input_supply[TPS65910_NUM_REGS];
814 struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; 816 struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
815}; 817};
816 818