NFS: Fix RCU issues in the NFSv4 delegation code
[linux-2.6/libata-dev.git] / drivers / regulator / tps6507x-regulator.c
blob74841abcc9cc5d037e5837eebe1bd4971719986a
1 /*
2 * tps6507x-regulator.c
4 * Regulator driver for TPS65073 PMIC
6 * Copyright (C) 2009 Texas Instrument Incorporated - http://www.ti.com/
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2.
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
18 #include <linux/kernel.h>
19 #include <linux/module.h>
20 #include <linux/init.h>
21 #include <linux/err.h>
22 #include <linux/platform_device.h>
23 #include <linux/regulator/driver.h>
24 #include <linux/regulator/machine.h>
25 #include <linux/i2c.h>
26 #include <linux/delay.h>
27 #include <linux/slab.h>
29 /* Register definitions */
30 #define TPS6507X_REG_PPATH1 0X01
31 #define TPS6507X_REG_INT 0X02
32 #define TPS6507X_REG_CHGCONFIG0 0X03
33 #define TPS6507X_REG_CHGCONFIG1 0X04
34 #define TPS6507X_REG_CHGCONFIG2 0X05
35 #define TPS6507X_REG_CHGCONFIG3 0X06
36 #define TPS6507X_REG_REG_ADCONFIG 0X07
37 #define TPS6507X_REG_TSCMODE 0X08
38 #define TPS6507X_REG_ADRESULT_1 0X09
39 #define TPS6507X_REG_ADRESULT_2 0X0A
40 #define TPS6507X_REG_PGOOD 0X0B
41 #define TPS6507X_REG_PGOODMASK 0X0C
42 #define TPS6507X_REG_CON_CTRL1 0X0D
43 #define TPS6507X_REG_CON_CTRL2 0X0E
44 #define TPS6507X_REG_CON_CTRL3 0X0F
45 #define TPS6507X_REG_DEFDCDC1 0X10
46 #define TPS6507X_REG_DEFDCDC2_LOW 0X11
47 #define TPS6507X_REG_DEFDCDC2_HIGH 0X12
48 #define TPS6507X_REG_DEFDCDC3_LOW 0X13
49 #define TPS6507X_REG_DEFDCDC3_HIGH 0X14
50 #define TPS6507X_REG_DEFSLEW 0X15
51 #define TPS6507X_REG_LDO_CTRL1 0X16
52 #define TPS6507X_REG_DEFLDO2 0X17
53 #define TPS6507X_REG_WLED_CTRL1 0X18
54 #define TPS6507X_REG_WLED_CTRL2 0X19
56 /* CON_CTRL1 bitfields */
57 #define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4)
58 #define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3)
59 #define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2)
60 #define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1)
61 #define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0)
63 /* DEFDCDC1 bitfields */
64 #define TPS6507X_DEFDCDC1_DCDC1_EXT_ADJ_EN BIT(7)
65 #define TPS6507X_DEFDCDC1_DCDC1_MASK 0X3F
67 /* DEFDCDC2_LOW bitfields */
68 #define TPS6507X_DEFDCDC2_LOW_DCDC2_MASK 0X3F
70 /* DEFDCDC2_HIGH bitfields */
71 #define TPS6507X_DEFDCDC2_HIGH_DCDC2_MASK 0X3F
73 /* DEFDCDC3_LOW bitfields */
74 #define TPS6507X_DEFDCDC3_LOW_DCDC3_MASK 0X3F
76 /* DEFDCDC3_HIGH bitfields */
77 #define TPS6507X_DEFDCDC3_HIGH_DCDC3_MASK 0X3F
79 /* TPS6507X_REG_LDO_CTRL1 bitfields */
80 #define TPS6507X_REG_LDO_CTRL1_LDO1_MASK 0X0F
82 /* TPS6507X_REG_DEFLDO2 bitfields */
83 #define TPS6507X_REG_DEFLDO2_LDO2_MASK 0X3F
85 /* VDCDC MASK */
86 #define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F
88 /* DCDC's */
89 #define TPS6507X_DCDC_1 0
90 #define TPS6507X_DCDC_2 1
91 #define TPS6507X_DCDC_3 2
92 /* LDOs */
93 #define TPS6507X_LDO_1 3
94 #define TPS6507X_LDO_2 4
96 #define TPS6507X_MAX_REG_ID TPS6507X_LDO_2
98 /* Number of step-down converters available */
99 #define TPS6507X_NUM_DCDC 3
100 /* Number of LDO voltage regulators available */
101 #define TPS6507X_NUM_LDO 2
102 /* Number of total regulators available */
103 #define TPS6507X_NUM_REGULATOR (TPS6507X_NUM_DCDC + TPS6507X_NUM_LDO)
105 /* Supported voltage values for regulators (in milliVolts) */
106 static const u16 VDCDCx_VSEL_table[] = {
107 725, 750, 775, 800,
108 825, 850, 875, 900,
109 925, 950, 975, 1000,
110 1025, 1050, 1075, 1100,
111 1125, 1150, 1175, 1200,
112 1225, 1250, 1275, 1300,
113 1325, 1350, 1375, 1400,
114 1425, 1450, 1475, 1500,
115 1550, 1600, 1650, 1700,
116 1750, 1800, 1850, 1900,
117 1950, 2000, 2050, 2100,
118 2150, 2200, 2250, 2300,
119 2350, 2400, 2450, 2500,
120 2550, 2600, 2650, 2700,
121 2750, 2800, 2850, 2900,
122 3000, 3100, 3200, 3300,
125 static const u16 LDO1_VSEL_table[] = {
126 1000, 1100, 1200, 1250,
127 1300, 1350, 1400, 1500,
128 1600, 1800, 2500, 2750,
129 2800, 3000, 3100, 3300,
132 static const u16 LDO2_VSEL_table[] = {
133 725, 750, 775, 800,
134 825, 850, 875, 900,
135 925, 950, 975, 1000,
136 1025, 1050, 1075, 1100,
137 1125, 1150, 1175, 1200,
138 1225, 1250, 1275, 1300,
139 1325, 1350, 1375, 1400,
140 1425, 1450, 1475, 1500,
141 1550, 1600, 1650, 1700,
142 1750, 1800, 1850, 1900,
143 1950, 2000, 2050, 2100,
144 2150, 2200, 2250, 2300,
145 2350, 2400, 2450, 2500,
146 2550, 2600, 2650, 2700,
147 2750, 2800, 2850, 2900,
148 3000, 3100, 3200, 3300,
151 static unsigned int num_voltages[] = {ARRAY_SIZE(VDCDCx_VSEL_table),
152 ARRAY_SIZE(VDCDCx_VSEL_table),
153 ARRAY_SIZE(VDCDCx_VSEL_table),
154 ARRAY_SIZE(LDO1_VSEL_table),
155 ARRAY_SIZE(LDO2_VSEL_table)};
157 struct tps_info {
158 const char *name;
159 unsigned min_uV;
160 unsigned max_uV;
161 u8 table_len;
162 const u16 *table;
165 struct tps_pmic {
166 struct regulator_desc desc[TPS6507X_NUM_REGULATOR];
167 struct i2c_client *client;
168 struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR];
169 const struct tps_info *info[TPS6507X_NUM_REGULATOR];
170 struct mutex io_lock;
173 static inline int tps_6507x_read(struct tps_pmic *tps, u8 reg)
175 return i2c_smbus_read_byte_data(tps->client, reg);
178 static inline int tps_6507x_write(struct tps_pmic *tps, u8 reg, u8 val)
180 return i2c_smbus_write_byte_data(tps->client, reg, val);
183 static int tps_6507x_set_bits(struct tps_pmic *tps, u8 reg, u8 mask)
185 int err, data;
187 mutex_lock(&tps->io_lock);
189 data = tps_6507x_read(tps, reg);
190 if (data < 0) {
191 dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
192 err = data;
193 goto out;
196 data |= mask;
197 err = tps_6507x_write(tps, reg, data);
198 if (err)
199 dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
201 out:
202 mutex_unlock(&tps->io_lock);
203 return err;
206 static int tps_6507x_clear_bits(struct tps_pmic *tps, u8 reg, u8 mask)
208 int err, data;
210 mutex_lock(&tps->io_lock);
212 data = tps_6507x_read(tps, reg);
213 if (data < 0) {
214 dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
215 err = data;
216 goto out;
219 data &= ~mask;
220 err = tps_6507x_write(tps, reg, data);
221 if (err)
222 dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
224 out:
225 mutex_unlock(&tps->io_lock);
226 return err;
229 static int tps_6507x_reg_read(struct tps_pmic *tps, u8 reg)
231 int data;
233 mutex_lock(&tps->io_lock);
235 data = tps_6507x_read(tps, reg);
236 if (data < 0)
237 dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
239 mutex_unlock(&tps->io_lock);
240 return data;
243 static int tps_6507x_reg_write(struct tps_pmic *tps, u8 reg, u8 val)
245 int err;
247 mutex_lock(&tps->io_lock);
249 err = tps_6507x_write(tps, reg, val);
250 if (err < 0)
251 dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
253 mutex_unlock(&tps->io_lock);
254 return err;
257 static int tps6507x_dcdc_is_enabled(struct regulator_dev *dev)
259 struct tps_pmic *tps = rdev_get_drvdata(dev);
260 int data, dcdc = rdev_get_id(dev);
261 u8 shift;
263 if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3)
264 return -EINVAL;
266 shift = TPS6507X_MAX_REG_ID - dcdc;
267 data = tps_6507x_reg_read(tps, TPS6507X_REG_CON_CTRL1);
269 if (data < 0)
270 return data;
271 else
272 return (data & 1<<shift) ? 1 : 0;
275 static int tps6507x_ldo_is_enabled(struct regulator_dev *dev)
277 struct tps_pmic *tps = rdev_get_drvdata(dev);
278 int data, ldo = rdev_get_id(dev);
279 u8 shift;
281 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
282 return -EINVAL;
284 shift = TPS6507X_MAX_REG_ID - ldo;
285 data = tps_6507x_reg_read(tps, TPS6507X_REG_CON_CTRL1);
287 if (data < 0)
288 return data;
289 else
290 return (data & 1<<shift) ? 1 : 0;
293 static int tps6507x_dcdc_enable(struct regulator_dev *dev)
295 struct tps_pmic *tps = rdev_get_drvdata(dev);
296 int dcdc = rdev_get_id(dev);
297 u8 shift;
299 if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3)
300 return -EINVAL;
302 shift = TPS6507X_MAX_REG_ID - dcdc;
303 return tps_6507x_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift);
306 static int tps6507x_dcdc_disable(struct regulator_dev *dev)
308 struct tps_pmic *tps = rdev_get_drvdata(dev);
309 int dcdc = rdev_get_id(dev);
310 u8 shift;
312 if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3)
313 return -EINVAL;
315 shift = TPS6507X_MAX_REG_ID - dcdc;
316 return tps_6507x_clear_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift);
319 static int tps6507x_ldo_enable(struct regulator_dev *dev)
321 struct tps_pmic *tps = rdev_get_drvdata(dev);
322 int ldo = rdev_get_id(dev);
323 u8 shift;
325 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
326 return -EINVAL;
328 shift = TPS6507X_MAX_REG_ID - ldo;
329 return tps_6507x_set_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift);
332 static int tps6507x_ldo_disable(struct regulator_dev *dev)
334 struct tps_pmic *tps = rdev_get_drvdata(dev);
335 int ldo = rdev_get_id(dev);
336 u8 shift;
338 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
339 return -EINVAL;
341 shift = TPS6507X_MAX_REG_ID - ldo;
342 return tps_6507x_clear_bits(tps, TPS6507X_REG_CON_CTRL1, 1 << shift);
345 static int tps6507x_dcdc_get_voltage(struct regulator_dev *dev)
347 struct tps_pmic *tps = rdev_get_drvdata(dev);
348 int data, dcdc = rdev_get_id(dev);
349 u8 reg;
351 switch (dcdc) {
352 case TPS6507X_DCDC_1:
353 reg = TPS6507X_REG_DEFDCDC1;
354 break;
355 case TPS6507X_DCDC_2:
356 reg = TPS6507X_REG_DEFDCDC2_LOW;
357 break;
358 case TPS6507X_DCDC_3:
359 reg = TPS6507X_REG_DEFDCDC3_LOW;
360 break;
361 default:
362 return -EINVAL;
365 data = tps_6507x_reg_read(tps, reg);
366 if (data < 0)
367 return data;
369 data &= TPS6507X_DEFDCDCX_DCDC_MASK;
370 return tps->info[dcdc]->table[data] * 1000;
373 static int tps6507x_dcdc_set_voltage(struct regulator_dev *dev,
374 int min_uV, int max_uV)
376 struct tps_pmic *tps = rdev_get_drvdata(dev);
377 int data, vsel, dcdc = rdev_get_id(dev);
378 u8 reg;
380 switch (dcdc) {
381 case TPS6507X_DCDC_1:
382 reg = TPS6507X_REG_DEFDCDC1;
383 break;
384 case TPS6507X_DCDC_2:
385 reg = TPS6507X_REG_DEFDCDC2_LOW;
386 break;
387 case TPS6507X_DCDC_3:
388 reg = TPS6507X_REG_DEFDCDC3_LOW;
389 break;
390 default:
391 return -EINVAL;
394 if (min_uV < tps->info[dcdc]->min_uV
395 || min_uV > tps->info[dcdc]->max_uV)
396 return -EINVAL;
397 if (max_uV < tps->info[dcdc]->min_uV
398 || max_uV > tps->info[dcdc]->max_uV)
399 return -EINVAL;
401 for (vsel = 0; vsel < tps->info[dcdc]->table_len; vsel++) {
402 int mV = tps->info[dcdc]->table[vsel];
403 int uV = mV * 1000;
405 /* Break at the first in-range value */
406 if (min_uV <= uV && uV <= max_uV)
407 break;
410 /* write to the register in case we found a match */
411 if (vsel == tps->info[dcdc]->table_len)
412 return -EINVAL;
414 data = tps_6507x_reg_read(tps, reg);
415 if (data < 0)
416 return data;
418 data &= ~TPS6507X_DEFDCDCX_DCDC_MASK;
419 data |= vsel;
421 return tps_6507x_reg_write(tps, reg, data);
424 static int tps6507x_ldo_get_voltage(struct regulator_dev *dev)
426 struct tps_pmic *tps = rdev_get_drvdata(dev);
427 int data, ldo = rdev_get_id(dev);
428 u8 reg, mask;
430 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
431 return -EINVAL;
432 else {
433 reg = (ldo == TPS6507X_LDO_1 ?
434 TPS6507X_REG_LDO_CTRL1 : TPS6507X_REG_DEFLDO2);
435 mask = (ldo == TPS6507X_LDO_1 ?
436 TPS6507X_REG_LDO_CTRL1_LDO1_MASK :
437 TPS6507X_REG_DEFLDO2_LDO2_MASK);
440 data = tps_6507x_reg_read(tps, reg);
441 if (data < 0)
442 return data;
444 data &= mask;
445 return tps->info[ldo]->table[data] * 1000;
448 static int tps6507x_ldo_set_voltage(struct regulator_dev *dev,
449 int min_uV, int max_uV)
451 struct tps_pmic *tps = rdev_get_drvdata(dev);
452 int data, vsel, ldo = rdev_get_id(dev);
453 u8 reg, mask;
455 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
456 return -EINVAL;
457 else {
458 reg = (ldo == TPS6507X_LDO_1 ?
459 TPS6507X_REG_LDO_CTRL1 : TPS6507X_REG_DEFLDO2);
460 mask = (ldo == TPS6507X_LDO_1 ?
461 TPS6507X_REG_LDO_CTRL1_LDO1_MASK :
462 TPS6507X_REG_DEFLDO2_LDO2_MASK);
465 if (min_uV < tps->info[ldo]->min_uV || min_uV > tps->info[ldo]->max_uV)
466 return -EINVAL;
467 if (max_uV < tps->info[ldo]->min_uV || max_uV > tps->info[ldo]->max_uV)
468 return -EINVAL;
470 for (vsel = 0; vsel < tps->info[ldo]->table_len; vsel++) {
471 int mV = tps->info[ldo]->table[vsel];
472 int uV = mV * 1000;
474 /* Break at the first in-range value */
475 if (min_uV <= uV && uV <= max_uV)
476 break;
479 if (vsel == tps->info[ldo]->table_len)
480 return -EINVAL;
482 data = tps_6507x_reg_read(tps, reg);
483 if (data < 0)
484 return data;
486 data &= ~mask;
487 data |= vsel;
489 return tps_6507x_reg_write(tps, reg, data);
492 static int tps6507x_dcdc_list_voltage(struct regulator_dev *dev,
493 unsigned selector)
495 struct tps_pmic *tps = rdev_get_drvdata(dev);
496 int dcdc = rdev_get_id(dev);
498 if (dcdc < TPS6507X_DCDC_1 || dcdc > TPS6507X_DCDC_3)
499 return -EINVAL;
501 if (selector >= tps->info[dcdc]->table_len)
502 return -EINVAL;
503 else
504 return tps->info[dcdc]->table[selector] * 1000;
507 static int tps6507x_ldo_list_voltage(struct regulator_dev *dev,
508 unsigned selector)
510 struct tps_pmic *tps = rdev_get_drvdata(dev);
511 int ldo = rdev_get_id(dev);
513 if (ldo < TPS6507X_LDO_1 || ldo > TPS6507X_LDO_2)
514 return -EINVAL;
516 if (selector >= tps->info[ldo]->table_len)
517 return -EINVAL;
518 else
519 return tps->info[ldo]->table[selector] * 1000;
522 /* Operations permitted on VDCDCx */
523 static struct regulator_ops tps6507x_dcdc_ops = {
524 .is_enabled = tps6507x_dcdc_is_enabled,
525 .enable = tps6507x_dcdc_enable,
526 .disable = tps6507x_dcdc_disable,
527 .get_voltage = tps6507x_dcdc_get_voltage,
528 .set_voltage = tps6507x_dcdc_set_voltage,
529 .list_voltage = tps6507x_dcdc_list_voltage,
532 /* Operations permitted on LDOx */
533 static struct regulator_ops tps6507x_ldo_ops = {
534 .is_enabled = tps6507x_ldo_is_enabled,
535 .enable = tps6507x_ldo_enable,
536 .disable = tps6507x_ldo_disable,
537 .get_voltage = tps6507x_ldo_get_voltage,
538 .set_voltage = tps6507x_ldo_set_voltage,
539 .list_voltage = tps6507x_ldo_list_voltage,
542 static int __devinit tps_6507x_probe(struct i2c_client *client,
543 const struct i2c_device_id *id)
545 static int desc_id;
546 const struct tps_info *info = (void *)id->driver_data;
547 struct regulator_init_data *init_data;
548 struct regulator_dev *rdev;
549 struct tps_pmic *tps;
550 int i;
551 int error;
553 if (!i2c_check_functionality(client->adapter,
554 I2C_FUNC_SMBUS_BYTE_DATA))
555 return -EIO;
558 * init_data points to array of regulator_init structures
559 * coming from the board-evm file.
561 init_data = client->dev.platform_data;
562 if (!init_data)
563 return -EIO;
565 tps = kzalloc(sizeof(*tps), GFP_KERNEL);
566 if (!tps)
567 return -ENOMEM;
569 mutex_init(&tps->io_lock);
571 /* common for all regulators */
572 tps->client = client;
574 for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
575 /* Register the regulators */
576 tps->info[i] = info;
577 tps->desc[i].name = info->name;
578 tps->desc[i].id = desc_id++;
579 tps->desc[i].n_voltages = num_voltages[i];
580 tps->desc[i].ops = (i > TPS6507X_DCDC_3 ?
581 &tps6507x_ldo_ops : &tps6507x_dcdc_ops);
582 tps->desc[i].type = REGULATOR_VOLTAGE;
583 tps->desc[i].owner = THIS_MODULE;
585 rdev = regulator_register(&tps->desc[i],
586 &client->dev, init_data, tps);
587 if (IS_ERR(rdev)) {
588 dev_err(&client->dev, "failed to register %s\n",
589 id->name);
590 error = PTR_ERR(rdev);
591 goto fail;
594 /* Save regulator for cleanup */
595 tps->rdev[i] = rdev;
598 i2c_set_clientdata(client, tps);
600 return 0;
602 fail:
603 while (--i >= 0)
604 regulator_unregister(tps->rdev[i]);
606 kfree(tps);
607 return error;
611 * tps_6507x_remove - TPS6507x driver i2c remove handler
612 * @client: i2c driver client device structure
614 * Unregister TPS driver as an i2c client device driver
616 static int __devexit tps_6507x_remove(struct i2c_client *client)
618 struct tps_pmic *tps = i2c_get_clientdata(client);
619 int i;
621 /* clear the client data in i2c */
622 i2c_set_clientdata(client, NULL);
624 for (i = 0; i < TPS6507X_NUM_REGULATOR; i++)
625 regulator_unregister(tps->rdev[i]);
627 kfree(tps);
629 return 0;
632 static const struct tps_info tps6507x_regs[] = {
634 .name = "VDCDC1",
635 .min_uV = 725000,
636 .max_uV = 3300000,
637 .table_len = ARRAY_SIZE(VDCDCx_VSEL_table),
638 .table = VDCDCx_VSEL_table,
641 .name = "VDCDC2",
642 .min_uV = 725000,
643 .max_uV = 3300000,
644 .table_len = ARRAY_SIZE(VDCDCx_VSEL_table),
645 .table = VDCDCx_VSEL_table,
648 .name = "VDCDC3",
649 .min_uV = 725000,
650 .max_uV = 3300000,
651 .table_len = ARRAY_SIZE(VDCDCx_VSEL_table),
652 .table = VDCDCx_VSEL_table,
655 .name = "LDO1",
656 .min_uV = 1000000,
657 .max_uV = 3300000,
658 .table_len = ARRAY_SIZE(LDO1_VSEL_table),
659 .table = LDO1_VSEL_table,
662 .name = "LDO2",
663 .min_uV = 725000,
664 .max_uV = 3300000,
665 .table_len = ARRAY_SIZE(LDO2_VSEL_table),
666 .table = LDO2_VSEL_table,
670 static const struct i2c_device_id tps_6507x_id[] = {
671 {.name = "tps6507x",
672 .driver_data = (unsigned long) tps6507x_regs,},
673 { },
675 MODULE_DEVICE_TABLE(i2c, tps_6507x_id);
677 static struct i2c_driver tps_6507x_i2c_driver = {
678 .driver = {
679 .name = "tps6507x",
680 .owner = THIS_MODULE,
682 .probe = tps_6507x_probe,
683 .remove = __devexit_p(tps_6507x_remove),
684 .id_table = tps_6507x_id,
688 * tps_6507x_init
690 * Module init function
692 static int __init tps_6507x_init(void)
694 return i2c_add_driver(&tps_6507x_i2c_driver);
696 subsys_initcall(tps_6507x_init);
699 * tps_6507x_cleanup
701 * Module exit function
703 static void __exit tps_6507x_cleanup(void)
705 i2c_del_driver(&tps_6507x_i2c_driver);
707 module_exit(tps_6507x_cleanup);
709 MODULE_AUTHOR("Texas Instruments");
710 MODULE_DESCRIPTION("TPS6507x voltage regulator driver");
711 MODULE_LICENSE("GPL v2");