diff options
author | Todd Fischer <todd.fischer@ridgerun.com> | 2010-04-05 22:23:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-05-27 19:37:37 -0400 |
commit | 4ce5ba5ba2dfc8186bf31fe7f2d23ff6b5384124 (patch) | |
tree | ae27b7a9819dc42666a2dd4731e0d8650d89dbca | |
parent | 0bc20bba357f18a0e52f45afc452d0b69cf06f76 (diff) |
regulator: tps6057x namespace cleanup
Move from using tps or tsp6507x to tps6057x_pmic in a consistent manner.
Signed-off-by: Todd Fischer <todd.fischer@ridgerun.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/regulator/tps6507x-regulator.c | 172 |
1 files changed, 87 insertions, 85 deletions
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index c3f1bf822fd0..ea44741fcd47 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -104,7 +104,7 @@ struct tps_info { | |||
104 | const u16 *table; | 104 | const u16 *table; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | struct tps_pmic { | 107 | struct tps6507x_pmic { |
108 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; | 108 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; |
109 | struct i2c_client *client; | 109 | struct i2c_client *client; |
110 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; | 110 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; |
@@ -112,23 +112,23 @@ struct tps_pmic { | |||
112 | struct mutex io_lock; | 112 | struct mutex io_lock; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static inline int tps_6507x_read(struct tps_pmic *tps, u8 reg) | 115 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) |
116 | { | 116 | { |
117 | return i2c_smbus_read_byte_data(tps->client, reg); | 117 | return i2c_smbus_read_byte_data(tps->client, reg); |
118 | } | 118 | } |
119 | 119 | ||
120 | static inline int tps_6507x_write(struct tps_pmic *tps, u8 reg, u8 val) | 120 | static inline int tps6507x_pmic_write(struct tps6507x_pmic *tps, u8 reg, u8 val) |
121 | { | 121 | { |
122 | return i2c_smbus_write_byte_data(tps->client, reg, val); | 122 | return i2c_smbus_write_byte_data(tps->client, reg, val); |
123 | } | 123 | } |
124 | 124 | ||
125 | static int tps_6507x_set_bits(struct tps_pmic *tps, u8 reg, u8 mask) | 125 | static int tps6507x_pmic_set_bits(struct tps6507x_pmic *tps, u8 reg, u8 mask) |
126 | { | 126 | { |
127 | int err, data; | 127 | int err, data; |
128 | 128 | ||
129 | mutex_lock(&tps->io_lock); | 129 | mutex_lock(&tps->io_lock); |
130 | 130 | ||
131 | data = tps_6507x_read(tps, reg); | 131 | data = tps6507x_pmic_read(tps, reg); |
132 | if (data < 0) { | 132 | if (data < 0) { |
133 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); | 133 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); |
134 | err = data; | 134 | err = data; |
@@ -136,7 +136,7 @@ static int tps_6507x_set_bits(struct tps_pmic *tps, u8 reg, u8 mask) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | data |= mask; | 138 | data |= mask; |
139 | err = tps_6507x_write(tps, reg, data); | 139 | err = tps6507x_pmic_write(tps, reg, data); |
140 | if (err) | 140 | if (err) |
141 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); | 141 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); |
142 | 142 | ||
@@ -145,13 +145,13 @@ out: | |||
145 | return err; | 145 | return err; |
146 | } | 146 | } |
147 | 147 | ||
148 | static int tps_6507x_clear_bits(struct tps_pmic *tps, u8 reg, u8 mask) | 148 | static int tps6507x_pmic_clear_bits(struct tps6507x_pmic *tps, u8 reg, u8 mask) |
149 | { | 149 | { |
150 | int err, data; | 150 | int err, data; |
151 | 151 | ||
152 | mutex_lock(&tps->io_lock); | 152 | mutex_lock(&tps->io_lock); |
153 | 153 | ||
154 | data = tps_6507x_read(tps, reg); | 154 | data = tps6507x_pmic_read(tps, reg); |
155 | if (data < 0) { | 155 | if (data < 0) { |
156 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); | 156 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); |
157 | err = data; | 157 | err = data; |
@@ -159,7 +159,7 @@ static int tps_6507x_clear_bits(struct tps_pmic *tps, u8 reg, u8 mask) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | data &= ~mask; | 161 | data &= ~mask; |
162 | err = tps_6507x_write(tps, reg, data); | 162 | err = tps6507x_pmic_write(tps, reg, data); |
163 | if (err) | 163 | if (err) |
164 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); | 164 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); |
165 | 165 | ||
@@ -168,13 +168,13 @@ out: | |||
168 | return err; | 168 | return err; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int tps_6507x_reg_read(struct tps_pmic *tps, u8 reg) | 171 | static int tps6507x_pmic_reg_read(struct tps6507x_pmic *tps, u8 reg) |
172 | { | 172 | { |
173 | int data; | 173 | int data; |
174 | 174 | ||
175 | mutex_lock(&tps->io_lock); | 175 | mutex_lock(&tps->io_lock); |
176 | 176 | ||
177 | data = tps_6507x_read(tps, reg); | 177 | data = tps6507x_pmic_read(tps, reg); |
178 | if (data < 0) | 178 | if (data < 0) |
179 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); | 179 | dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg); |
180 | 180 | ||
@@ -182,13 +182,13 @@ static int tps_6507x_reg_read(struct tps_pmic *tps, u8 reg) | |||
182 | return data; | 182 | return data; |
183 | } | 183 | } |
184 | 184 | ||
185 | static int tps_6507x_reg_write(struct tps_pmic *tps, u8 reg, u8 val) | 185 | static int tps6507x_pmic_reg_write(struct tps6507x_pmic *tps, u8 reg, u8 val) |
186 | { | 186 | { |
187 | int err; | 187 | int err; |
188 | 188 | ||
189 | mutex_lock(&tps->io_lock); | 189 | mutex_lock(&tps->io_lock); |
190 | 190 | ||
191 | err = tps_6507x_write(tps, reg, val); | 191 | err = tps6507x_pmic_write(tps, reg, val); |
192 | if (err < 0) | 192 | if (err < 0) |
193 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); | 193 | dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg); |
194 | 194 | ||
@@ -196,9 +196,9 @@ static int tps_6507x_reg_write(struct tps_pmic *tps, u8 reg, u8 val) | |||
196 | return err; | 196 | return err; |
197 | } | 197 | } |
198 | 198 | ||
199 | static int tps6507x_dcdc_is_enabled(struct regulator_dev *dev) | 199 | static int tps6507x_pmic_dcdc_is_enabled(struct regulator_dev *dev) |
200 | { | 200 | { |
201 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 201 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
202 | int data, dcdc = rdev_get_id(dev); | 202 | int data, dcdc = rdev_get_id(dev); |
203 | u8 shift; | 203 | u8 shift; |
204 | 204 | ||
@@ -206,7 +206,7 @@ static int tps6507x_dcdc_is_enabled(struct regulator_dev *dev) | |||
206 | return -EINVAL; | 206 | return -EINVAL; |
207 | 207 | ||
208 | shift = TPS6507X_MAX_REG_ID - dcdc; | 208 | shift = TPS6507X_MAX_REG_ID - dcdc; |
209 | data = tps_6507x_reg_read(tps, TPS6507X_REG_CON_CTRL1); | 209 | data = tps6507x_pmic_reg_read(tps, TPS6507X_REG_CON_CTRL1); |
210 | 210 | ||
211 | if (data < 0) | 211 | if (data < 0) |
212 | return data; | 212 | return data; |
@@ -214,9 +214,9 @@ static int tps6507x_dcdc_is_enabled(struct regulator_dev *dev) | |||
214 | return (data & 1<<shift) ? 1 : 0; | 214 | return (data & 1<<shift) ? 1 : 0; |
215 | } | 215 | } |
216 | 216 | ||
217 | static int tps6507x_ldo_is_enabled(struct regulator_dev *dev) | 217 | static int tps6507x_pmic_ldo_is_enabled(struct regulator_dev *dev) |
218 | { | 218 | { |
219 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 219 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
220 | int data, ldo = rdev_get_id(dev); | 220 | int data, ldo = rdev_get_id(dev); |
221 | u8 shift; | 221 | u8 shift; |
222 | 222 | ||
@@ -224,7 +224,7 @@ static int tps6507x_ldo_is_enabled(struct regulator_dev *dev) | |||
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | 225 | ||
226 | shift = TPS6507X_MAX_REG_ID - ldo; | 226 | shift = TPS6507X_MAX_REG_ID - ldo; |
227 | data = tps_6507x_reg_read(tps, TPS6507X_REG_CON_CTRL1); | 227 | data = tps6507x_pmic_reg_read(tps, TPS6507X_REG_CON_CTRL1); |
228 | 228 | ||
229 | if (data < 0) | 229 | if (data < 0) |
230 | return data; | 230 | return data; |
@@ -232,9 +232,9 @@ static int tps6507x_ldo_is_enabled(struct regulator_dev *dev) | |||
232 | return (data & 1<<shift) ? 1 : 0; | 232 | return (data & 1<<shift) ? 1 : 0; |
233 | } | 233 | } |
234 | 234 | ||
235 | static int tps6507x_dcdc_enable(struct regulator_dev *dev) | 235 | static int tps6507x_pmic_dcdc_enable(struct regulator_dev *dev) |
236 | { | 236 | { |
237 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 237 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
238 | int dcdc = rdev_get_id(dev); | 238 | int dcdc = rdev_get_id(dev); |
239 | u8 shift; | 239 | u8 shift; |
240 | 240 | ||
@@ -242,12 +242,12 @@ static int tps6507x_dcdc_enable(struct regulator_dev *dev) | |||
242 | return -EINVAL; | 242 | return -EINVAL; |
243 | 243 | ||
244 | shift = TPS6507X_MAX_REG_ID - dcdc; | 244 | shift = TPS6507X_MAX_REG_ID - dcdc; |
245 | return tps_6507x_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); | 245 | return tps6507x_pmic_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); |
246 | } | 246 | } |
247 | 247 | ||
248 | static int tps6507x_dcdc_disable(struct regulator_dev *dev) | 248 | static int tps6507x_pmic_dcdc_disable(struct regulator_dev *dev) |
249 | { | 249 | { |
250 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 250 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
251 | int dcdc = rdev_get_id(dev); | 251 | int dcdc = rdev_get_id(dev); |
252 | u8 shift; | 252 | u8 shift; |
253 | 253 | ||
@@ -255,12 +255,13 @@ static int tps6507x_dcdc_disable(struct regulator_dev *dev) | |||
255 | return -EINVAL; | 255 | return -EINVAL; |
256 | 256 | ||
257 | shift = TPS6507X_MAX_REG_ID - dcdc; | 257 | shift = TPS6507X_MAX_REG_ID - dcdc; |
258 | return tps_6507x_clear_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); | 258 | return tps6507x_pmic_clear_bits(tps, TPS6507X_REG_CON_CTRL1, |
259 | 1 << shift); | ||
259 | } | 260 | } |
260 | 261 | ||
261 | static int tps6507x_ldo_enable(struct regulator_dev *dev) | 262 | static int tps6507x_pmic_ldo_enable(struct regulator_dev *dev) |
262 | { | 263 | { |
263 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 264 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
264 | int ldo = rdev_get_id(dev); | 265 | int ldo = rdev_get_id(dev); |
265 | u8 shift; | 266 | u8 shift; |
266 | 267 | ||
@@ -268,12 +269,12 @@ static int tps6507x_ldo_enable(struct regulator_dev *dev) | |||
268 | return -EINVAL; | 269 | return -EINVAL; |
269 | 270 | ||
270 | shift = TPS6507X_MAX_REG_ID - ldo; | 271 | shift = TPS6507X_MAX_REG_ID - ldo; |
271 | return tps_6507x_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); | 272 | return tps6507x_pmic_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); |
272 | } | 273 | } |
273 | 274 | ||
274 | static int tps6507x_ldo_disable(struct regulator_dev *dev) | 275 | static int tps6507x_pmic_ldo_disable(struct regulator_dev *dev) |
275 | { | 276 | { |
276 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 277 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
277 | int ldo = rdev_get_id(dev); | 278 | int ldo = rdev_get_id(dev); |
278 | u8 shift; | 279 | u8 shift; |
279 | 280 | ||
@@ -281,12 +282,13 @@ static int tps6507x_ldo_disable(struct regulator_dev *dev) | |||
281 | return -EINVAL; | 282 | return -EINVAL; |
282 | 283 | ||
283 | shift = TPS6507X_MAX_REG_ID - ldo; | 284 | shift = TPS6507X_MAX_REG_ID - ldo; |
284 | return tps_6507x_clear_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift); | 285 | return tps6507x_pmic_clear_bits(tps, TPS6507X_REG_CON_CTRL1, |
286 | 1 << shift); | ||
285 | } | 287 | } |
286 | 288 | ||
287 | static int tps6507x_dcdc_get_voltage(struct regulator_dev *dev) | 289 | static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev) |
288 | { | 290 | { |
289 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 291 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
290 | int data, dcdc = rdev_get_id(dev); | 292 | int data, dcdc = rdev_get_id(dev); |
291 | u8 reg; | 293 | u8 reg; |
292 | 294 | ||
@@ -304,7 +306,7 @@ static int tps6507x_dcdc_get_voltage(struct regulator_dev *dev) | |||
304 | return -EINVAL; | 306 | return -EINVAL; |
305 | } | 307 | } |
306 | 308 | ||
307 | data = tps_6507x_reg_read(tps, reg); | 309 | data = tps6507x_pmic_reg_read(tps, reg); |
308 | if (data < 0) | 310 | if (data < 0) |
309 | return data; | 311 | return data; |
310 | 312 | ||
@@ -312,10 +314,10 @@ static int tps6507x_dcdc_get_voltage(struct regulator_dev *dev) | |||
312 | return tps->info[dcdc]->table[data] * 1000; | 314 | return tps->info[dcdc]->table[data] * 1000; |
313 | } | 315 | } |
314 | 316 | ||
315 | static int tps6507x_dcdc_set_voltage(struct regulator_dev *dev, | 317 | static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev, |
316 | int min_uV, int max_uV) | 318 | int min_uV, int max_uV) |
317 | { | 319 | { |
318 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 320 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
319 | int data, vsel, dcdc = rdev_get_id(dev); | 321 | int data, vsel, dcdc = rdev_get_id(dev); |
320 | u8 reg; | 322 | u8 reg; |
321 | 323 | ||
@@ -353,19 +355,19 @@ static int tps6507x_dcdc_set_voltage(struct regulator_dev *dev, | |||
353 | if (vsel == tps->info[dcdc]->table_len) | 355 | if (vsel == tps->info[dcdc]->table_len) |
354 | return -EINVAL; | 356 | return -EINVAL; |
355 | 357 | ||
356 | data = tps_6507x_reg_read(tps, reg); | 358 | data = tps6507x_pmic_reg_read(tps, reg); |
357 | if (data < 0) | 359 | if (data < 0) |
358 | return data; | 360 | return data; |
359 | 361 | ||
360 | data &= ~TPS6507X_DEFDCDCX_DCDC_MASK; | 362 | data &= ~TPS6507X_DEFDCDCX_DCDC_MASK; |
361 | data |= vsel; | 363 | data |= vsel; |
362 | 364 | ||
363 | return tps_6507x_reg_write(tps, reg, data); | 365 | return tps6507x_pmic_reg_write(tps, reg, data); |
364 | } | 366 | } |
365 | 367 | ||
366 | static int tps6507x_ldo_get_voltage(struct regulator_dev *dev) | 368 | static int tps6507x_pmic_ldo_get_voltage(struct regulator_dev *dev) |
367 | { | 369 | { |
368 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 370 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
369 | int data, ldo = rdev_get_id(dev); | 371 | int data, ldo = rdev_get_id(dev); |
370 | u8 reg, mask; | 372 | u8 reg, mask; |
371 | 373 | ||
@@ -379,7 +381,7 @@ static int tps6507x_ldo_get_voltage(struct regulator_dev *dev) | |||
379 | TPS6507X_REG_DEFLDO2_LDO2_MASK); | 381 | TPS6507X_REG_DEFLDO2_LDO2_MASK); |
380 | } | 382 | } |
381 | 383 | ||
382 | data = tps_6507x_reg_read(tps, reg); | 384 | data = tps6507x_pmic_reg_read(tps, reg); |
383 | if (data < 0) | 385 | if (data < 0) |
384 | return data; | 386 | return data; |
385 | 387 | ||
@@ -387,10 +389,10 @@ static int tps6507x_ldo_get_voltage(struct regulator_dev *dev) | |||
387 | return tps->info[ldo]->table[data] * 1000; | 389 | return tps->info[ldo]->table[data] * 1000; |
388 | } | 390 | } |
389 | 391 | ||
390 | static int tps6507x_ldo_set_voltage(struct regulator_dev *dev, | 392 | static int tps6507x_pmic_ldo_set_voltage(struct regulator_dev *dev, |
391 | int min_uV, int max_uV) | 393 | int min_uV, int max_uV) |
392 | { | 394 | { |
393 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 395 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
394 | int data, vsel, ldo = rdev_get_id(dev); | 396 | int data, vsel, ldo = rdev_get_id(dev); |
395 | u8 reg, mask; | 397 | u8 reg, mask; |
396 | 398 | ||
@@ -421,20 +423,20 @@ static int tps6507x_ldo_set_voltage(struct regulator_dev *dev, | |||
421 | if (vsel == tps->info[ldo]->table_len) | 423 | if (vsel == tps->info[ldo]->table_len) |
422 | return -EINVAL; | 424 | return -EINVAL; |
423 | 425 | ||
424 | data = tps_6507x_reg_read(tps, reg); | 426 | data = tps6507x_pmic_reg_read(tps, reg); |
425 | if (data < 0) | 427 | if (data < 0) |
426 | return data; | 428 | return data; |
427 | 429 | ||
428 | data &= ~mask; | 430 | data &= ~mask; |
429 | data |= vsel; | 431 | data |= vsel; |
430 | 432 | ||
431 | return tps_6507x_reg_write(tps, reg, data); | 433 | return tps6507x_pmic_reg_write(tps, reg, data); |
432 | } | 434 | } |
433 | 435 | ||
434 | static int tps6507x_dcdc_list_voltage(struct regulator_dev *dev, | 436 | static int tps6507x_pmic_dcdc_list_voltage(struct regulator_dev *dev, |
435 | unsigned selector) | 437 | unsigned selector) |
436 | { | 438 | { |
437 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 439 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
438 | int dcdc = rdev_get_id(dev); | 440 | int dcdc = rdev_get_id(dev); |
439 | 441 | ||
440 | if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3) | 442 | if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3) |
@@ -446,10 +448,10 @@ static int tps6507x_dcdc_list_voltage(struct regulator_dev *dev, | |||
446 | return tps->info[dcdc]->table[selector] * 1000; | 448 | return tps->info[dcdc]->table[selector] * 1000; |
447 | } | 449 | } |
448 | 450 | ||
449 | static int tps6507x_ldo_list_voltage(struct regulator_dev *dev, | 451 | static int tps6507x_pmic_ldo_list_voltage(struct regulator_dev *dev, |
450 | unsigned selector) | 452 | unsigned selector) |
451 | { | 453 | { |
452 | struct tps_pmic *tps = rdev_get_drvdata(dev); | 454 | struct tps6507x_pmic *tps = rdev_get_drvdata(dev); |
453 | int ldo = rdev_get_id(dev); | 455 | int ldo = rdev_get_id(dev); |
454 | 456 | ||
455 | if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2) | 457 | if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2) |
@@ -462,33 +464,33 @@ static int tps6507x_ldo_list_voltage(struct regulator_dev *dev, | |||
462 | } | 464 | } |
463 | 465 | ||
464 | /* Operations permitted on VDCDCx */ | 466 | /* Operations permitted on VDCDCx */ |
465 | static struct regulator_ops tps6507x_dcdc_ops = { | 467 | static struct regulator_ops tps6507x_pmic_dcdc_ops = { |
466 | .is_enabled = tps6507x_dcdc_is_enabled, | 468 | .is_enabled = tps6507x_pmic_dcdc_is_enabled, |
467 | .enable = tps6507x_dcdc_enable, | 469 | .enable = tps6507x_pmic_dcdc_enable, |
468 | .disable = tps6507x_dcdc_disable, | 470 | .disable = tps6507x_pmic_dcdc_disable, |
469 | .get_voltage = tps6507x_dcdc_get_voltage, | 471 | .get_voltage = tps6507x_pmic_dcdc_get_voltage, |
470 | .set_voltage = tps6507x_dcdc_set_voltage, | 472 | .set_voltage = tps6507x_pmic_dcdc_set_voltage, |
471 | .list_voltage = tps6507x_dcdc_list_voltage, | 473 | .list_voltage = tps6507x_pmic_dcdc_list_voltage, |
472 | }; | 474 | }; |
473 | 475 | ||
474 | /* Operations permitted on LDOx */ | 476 | /* Operations permitted on LDOx */ |
475 | static struct regulator_ops tps6507x_ldo_ops = { | 477 | static struct regulator_ops tps6507x_pmic_ldo_ops = { |
476 | .is_enabled = tps6507x_ldo_is_enabled, | 478 | .is_enabled = tps6507x_pmic_ldo_is_enabled, |
477 | .enable = tps6507x_ldo_enable, | 479 | .enable = tps6507x_pmic_ldo_enable, |
478 | .disable = tps6507x_ldo_disable, | 480 | .disable = tps6507x_pmic_ldo_disable, |
479 | .get_voltage = tps6507x_ldo_get_voltage, | 481 | .get_voltage = tps6507x_pmic_ldo_get_voltage, |
480 | .set_voltage = tps6507x_ldo_set_voltage, | 482 | .set_voltage = tps6507x_pmic_ldo_set_voltage, |
481 | .list_voltage = tps6507x_ldo_list_voltage, | 483 | .list_voltage = tps6507x_pmic_ldo_list_voltage, |
482 | }; | 484 | }; |
483 | 485 | ||
484 | static int __devinit tps_6507x_probe(struct i2c_client *client, | 486 | static int __devinit tps6507x_pmic_probe(struct i2c_client *client, |
485 | const struct i2c_device_id *id) | 487 | const struct i2c_device_id *id) |
486 | { | 488 | { |
487 | static int desc_id; | 489 | static int desc_id; |
488 | const struct tps_info *info = (void *)id->driver_data; | 490 | const struct tps_info *info = (void *)id->driver_data; |
489 | struct regulator_init_data *init_data; | 491 | struct regulator_init_data *init_data; |
490 | struct regulator_dev *rdev; | 492 | struct regulator_dev *rdev; |
491 | struct tps_pmic *tps; | 493 | struct tps6507x_pmic *tps; |
492 | struct tps6507x_board *tps_board; | 494 | struct tps6507x_board *tps_board; |
493 | int i; | 495 | int i; |
494 | int error; | 496 | int error; |
@@ -530,7 +532,7 @@ static int __devinit tps_6507x_probe(struct i2c_client *client, | |||
530 | tps->desc[i].id = desc_id++; | 532 | tps->desc[i].id = desc_id++; |
531 | tps->desc[i].n_voltages = num_voltages[i]; | 533 | tps->desc[i].n_voltages = num_voltages[i]; |
532 | tps->desc[i].ops = (i > TPS6507X_DCDC_3 ? | 534 | tps->desc[i].ops = (i > TPS6507X_DCDC_3 ? |
533 | &tps6507x_ldo_ops : &tps6507x_dcdc_ops); | 535 | &tps6507x_pmic_ldo_ops : &tps6507x_pmic_dcdc_ops); |
534 | tps->desc[i].type = REGULATOR_VOLTAGE; | 536 | tps->desc[i].type = REGULATOR_VOLTAGE; |
535 | tps->desc[i].owner = THIS_MODULE; | 537 | tps->desc[i].owner = THIS_MODULE; |
536 | 538 | ||
@@ -560,14 +562,14 @@ fail: | |||
560 | } | 562 | } |
561 | 563 | ||
562 | /** | 564 | /** |
563 | * tps_6507x_remove - TPS6507x driver i2c remove handler | 565 | * tps6507x_remove - TPS6507x driver i2c remove handler |
564 | * @client: i2c driver client device structure | 566 | * @client: i2c driver client device structure |
565 | * | 567 | * |
566 | * Unregister TPS driver as an i2c client device driver | 568 | * Unregister TPS driver as an i2c client device driver |
567 | */ | 569 | */ |
568 | static int __devexit tps_6507x_remove(struct i2c_client *client) | 570 | static int __devexit tps6507x_pmic_remove(struct i2c_client *client) |
569 | { | 571 | { |
570 | struct tps_pmic *tps = i2c_get_clientdata(client); | 572 | struct tps6507x_pmic *tps = i2c_get_clientdata(client); |
571 | int i; | 573 | int i; |
572 | 574 | ||
573 | /* clear the client data in i2c */ | 575 | /* clear the client data in i2c */ |
@@ -581,7 +583,7 @@ static int __devexit tps_6507x_remove(struct i2c_client *client) | |||
581 | return 0; | 583 | return 0; |
582 | } | 584 | } |
583 | 585 | ||
584 | static const struct tps_info tps6507x_regs[] = { | 586 | static const struct tps_info tps6507x_pmic_regs[] = { |
585 | { | 587 | { |
586 | .name = "VDCDC1", | 588 | .name = "VDCDC1", |
587 | .min_uV = 725000, | 589 | .min_uV = 725000, |
@@ -619,44 +621,44 @@ static const struct tps_info tps6507x_regs[] = { | |||
619 | }, | 621 | }, |
620 | }; | 622 | }; |
621 | 623 | ||
622 | static const struct i2c_device_id tps_6507x_id[] = { | 624 | static const struct i2c_device_id tps6507x_pmic_id[] = { |
623 | {.name = "tps6507x", | 625 | {.name = "tps6507x", |
624 | .driver_data = (unsigned long) tps6507x_regs,}, | 626 | .driver_data = (unsigned long) tps6507x_pmic_regs,}, |
625 | { }, | 627 | { }, |
626 | }; | 628 | }; |
627 | MODULE_DEVICE_TABLE(i2c, tps_6507x_id); | 629 | MODULE_DEVICE_TABLE(i2c, tps6507x_pmic_id); |
628 | 630 | ||
629 | static struct i2c_driver tps_6507x_i2c_driver = { | 631 | static struct i2c_driver tps6507x_i2c_driver = { |
630 | .driver = { | 632 | .driver = { |
631 | .name = "tps6507x", | 633 | .name = "tps6507x", |
632 | .owner = THIS_MODULE, | 634 | .owner = THIS_MODULE, |
633 | }, | 635 | }, |
634 | .probe = tps_6507x_probe, | 636 | .probe = tps6507x_pmic_probe, |
635 | .remove = __devexit_p(tps_6507x_remove), | 637 | .remove = __devexit_p(tps6507x_pmic_remove), |
636 | .id_table = tps_6507x_id, | 638 | .id_table = tps6507x_pmic_id, |
637 | }; | 639 | }; |
638 | 640 | ||
639 | /** | 641 | /** |
640 | * tps_6507x_init | 642 | * tps6507x_pmic_init |
641 | * | 643 | * |
642 | * Module init function | 644 | * Module init function |
643 | */ | 645 | */ |
644 | static int __init tps_6507x_init(void) | 646 | static int __init tps6507x_pmic_init(void) |
645 | { | 647 | { |
646 | return i2c_add_driver(&tps_6507x_i2c_driver); | 648 | return i2c_add_driver(&tps6507x_i2c_driver); |
647 | } | 649 | } |
648 | subsys_initcall(tps_6507x_init); | 650 | subsys_initcall(tps6507x_pmic_init); |
649 | 651 | ||
650 | /** | 652 | /** |
651 | * tps_6507x_cleanup | 653 | * tps6507x_pmic_cleanup |
652 | * | 654 | * |
653 | * Module exit function | 655 | * Module exit function |
654 | */ | 656 | */ |
655 | static void __exit tps_6507x_cleanup(void) | 657 | static void __exit tps6507x_pmic_cleanup(void) |
656 | { | 658 | { |
657 | i2c_del_driver(&tps_6507x_i2c_driver); | 659 | i2c_del_driver(&tps6507x_i2c_driver); |
658 | } | 660 | } |
659 | module_exit(tps_6507x_cleanup); | 661 | module_exit(tps6507x_pmic_cleanup); |
660 | 662 | ||
661 | MODULE_AUTHOR("Texas Instruments"); | 663 | MODULE_AUTHOR("Texas Instruments"); |
662 | MODULE_DESCRIPTION("TPS6507x voltage regulator driver"); | 664 | MODULE_DESCRIPTION("TPS6507x voltage regulator driver"); |