The discovered bit in PGCCSR register indicates if the device has been
[linux-2.6/next.git] / drivers / regulator / tps65023-regulator.c
blobb02c670863532b6ff107d2b8f52c12164081eeea
1 /*
2 * tps65023-regulator.c
4 * Supports TPS65023 Regulator
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>
28 #include <linux/regmap.h>
30 /* Register definitions */
31 #define TPS65023_REG_VERSION 0
32 #define TPS65023_REG_PGOODZ 1
33 #define TPS65023_REG_MASK 2
34 #define TPS65023_REG_REG_CTRL 3
35 #define TPS65023_REG_CON_CTRL 4
36 #define TPS65023_REG_CON_CTRL2 5
37 #define TPS65023_REG_DEF_CORE 6
38 #define TPS65023_REG_DEFSLEW 7
39 #define TPS65023_REG_LDO_CTRL 8
41 /* PGOODZ bitfields */
42 #define TPS65023_PGOODZ_PWRFAILZ BIT(7)
43 #define TPS65023_PGOODZ_LOWBATTZ BIT(6)
44 #define TPS65023_PGOODZ_VDCDC1 BIT(5)
45 #define TPS65023_PGOODZ_VDCDC2 BIT(4)
46 #define TPS65023_PGOODZ_VDCDC3 BIT(3)
47 #define TPS65023_PGOODZ_LDO2 BIT(2)
48 #define TPS65023_PGOODZ_LDO1 BIT(1)
50 /* MASK bitfields */
51 #define TPS65023_MASK_PWRFAILZ BIT(7)
52 #define TPS65023_MASK_LOWBATTZ BIT(6)
53 #define TPS65023_MASK_VDCDC1 BIT(5)
54 #define TPS65023_MASK_VDCDC2 BIT(4)
55 #define TPS65023_MASK_VDCDC3 BIT(3)
56 #define TPS65023_MASK_LDO2 BIT(2)
57 #define TPS65023_MASK_LDO1 BIT(1)
59 /* REG_CTRL bitfields */
60 #define TPS65023_REG_CTRL_VDCDC1_EN BIT(5)
61 #define TPS65023_REG_CTRL_VDCDC2_EN BIT(4)
62 #define TPS65023_REG_CTRL_VDCDC3_EN BIT(3)
63 #define TPS65023_REG_CTRL_LDO2_EN BIT(2)
64 #define TPS65023_REG_CTRL_LDO1_EN BIT(1)
66 /* REG_CTRL2 bitfields */
67 #define TPS65023_REG_CTRL2_GO BIT(7)
68 #define TPS65023_REG_CTRL2_CORE_ADJ BIT(6)
69 #define TPS65023_REG_CTRL2_DCDC2 BIT(2)
70 #define TPS65023_REG_CTRL2_DCDC1 BIT(2)
71 #define TPS65023_REG_CTRL2_DCDC3 BIT(0)
73 /* REG_CTRL2 bitfields */
74 #define TPS65023_REG_CTRL2_GO BIT(7)
75 #define TPS65023_REG_CTRL2_CORE_ADJ BIT(6)
76 #define TPS65023_REG_CTRL2_DCDC2 BIT(2)
77 #define TPS65023_REG_CTRL2_DCDC1 BIT(1)
78 #define TPS65023_REG_CTRL2_DCDC3 BIT(0)
80 /* LDO_CTRL bitfields */
81 #define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4)
82 #define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0xF0 >> ((ldo_id)*4))
84 /* Number of step-down converters available */
85 #define TPS65023_NUM_DCDC 3
86 /* Number of LDO voltage regulators available */
87 #define TPS65023_NUM_LDO 2
88 /* Number of total regulators available */
89 #define TPS65023_NUM_REGULATOR (TPS65023_NUM_DCDC + TPS65023_NUM_LDO)
91 /* DCDCs */
92 #define TPS65023_DCDC_1 0
93 #define TPS65023_DCDC_2 1
94 #define TPS65023_DCDC_3 2
95 /* LDOs */
96 #define TPS65023_LDO_1 3
97 #define TPS65023_LDO_2 4
99 #define TPS65023_MAX_REG_ID TPS65023_LDO_2
101 /* Supported voltage values for regulators */
102 static const u16 VCORE_VSEL_table[] = {
103 800, 825, 850, 875,
104 900, 925, 950, 975,
105 1000, 1025, 1050, 1075,
106 1100, 1125, 1150, 1175,
107 1200, 1225, 1250, 1275,
108 1300, 1325, 1350, 1375,
109 1400, 1425, 1450, 1475,
110 1500, 1525, 1550, 1600,
113 /* Supported voltage values for LDO regulators for tps65020 */
114 static const u16 TPS65020_LDO1_VSEL_table[] = {
115 1000, 1050, 1100, 1300,
116 1800, 2500, 3000, 3300,
119 static const u16 TPS65020_LDO2_VSEL_table[] = {
120 1000, 1050, 1100, 1300,
121 1800, 2500, 3000, 3300,
124 /* Supported voltage values for LDO regulators
125 * for tps65021 and tps65023 */
126 static const u16 TPS65023_LDO1_VSEL_table[] = {
127 1000, 1100, 1300, 1800,
128 2200, 2600, 2800, 3150,
131 static const u16 TPS65023_LDO2_VSEL_table[] = {
132 1050, 1200, 1300, 1800,
133 2500, 2800, 3000, 3300,
136 /* Regulator specific details */
137 struct tps_info {
138 const char *name;
139 unsigned min_uV;
140 unsigned max_uV;
141 bool fixed;
142 u8 table_len;
143 const u16 *table;
146 /* PMIC details */
147 struct tps_pmic {
148 struct regulator_desc desc[TPS65023_NUM_REGULATOR];
149 struct i2c_client *client;
150 struct regulator_dev *rdev[TPS65023_NUM_REGULATOR];
151 const struct tps_info *info[TPS65023_NUM_REGULATOR];
152 struct regmap *regmap;
153 u8 core_regulator;
156 /* Struct passed as driver data */
157 struct tps_driver_data {
158 const struct tps_info *info;
159 u8 core_regulator;
162 static int tps_65023_set_bits(struct tps_pmic *tps, u8 reg, u8 mask)
164 return regmap_update_bits(tps->regmap, reg, mask, mask);
167 static int tps_65023_clear_bits(struct tps_pmic *tps, u8 reg, u8 mask)
169 return regmap_update_bits(tps->regmap, reg, mask, 0);
172 static int tps_65023_reg_read(struct tps_pmic *tps, u8 reg)
174 unsigned int val;
175 int ret;
177 ret = regmap_read(tps->regmap, reg, &val);
179 if (ret != 0)
180 return ret;
181 else
182 return val;
185 static int tps_65023_reg_write(struct tps_pmic *tps, u8 reg, u8 val)
187 return regmap_write(tps->regmap, reg, val);
190 static int tps65023_dcdc_is_enabled(struct regulator_dev *dev)
192 struct tps_pmic *tps = rdev_get_drvdata(dev);
193 int data, dcdc = rdev_get_id(dev);
194 u8 shift;
196 if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
197 return -EINVAL;
199 shift = TPS65023_NUM_REGULATOR - dcdc;
200 data = tps_65023_reg_read(tps, TPS65023_REG_REG_CTRL);
202 if (data < 0)
203 return data;
204 else
205 return (data & 1<<shift) ? 1 : 0;
208 static int tps65023_ldo_is_enabled(struct regulator_dev *dev)
210 struct tps_pmic *tps = rdev_get_drvdata(dev);
211 int data, ldo = rdev_get_id(dev);
212 u8 shift;
214 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
215 return -EINVAL;
217 shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
218 data = tps_65023_reg_read(tps, TPS65023_REG_REG_CTRL);
220 if (data < 0)
221 return data;
222 else
223 return (data & 1<<shift) ? 1 : 0;
226 static int tps65023_dcdc_enable(struct regulator_dev *dev)
228 struct tps_pmic *tps = rdev_get_drvdata(dev);
229 int dcdc = rdev_get_id(dev);
230 u8 shift;
232 if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
233 return -EINVAL;
235 shift = TPS65023_NUM_REGULATOR - dcdc;
236 return tps_65023_set_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
239 static int tps65023_dcdc_disable(struct regulator_dev *dev)
241 struct tps_pmic *tps = rdev_get_drvdata(dev);
242 int dcdc = rdev_get_id(dev);
243 u8 shift;
245 if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
246 return -EINVAL;
248 shift = TPS65023_NUM_REGULATOR - dcdc;
249 return tps_65023_clear_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
252 static int tps65023_ldo_enable(struct regulator_dev *dev)
254 struct tps_pmic *tps = rdev_get_drvdata(dev);
255 int ldo = rdev_get_id(dev);
256 u8 shift;
258 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
259 return -EINVAL;
261 shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
262 return tps_65023_set_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
265 static int tps65023_ldo_disable(struct regulator_dev *dev)
267 struct tps_pmic *tps = rdev_get_drvdata(dev);
268 int ldo = rdev_get_id(dev);
269 u8 shift;
271 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
272 return -EINVAL;
274 shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
275 return tps_65023_clear_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
278 static int tps65023_dcdc_get_voltage(struct regulator_dev *dev)
280 struct tps_pmic *tps = rdev_get_drvdata(dev);
281 int data, dcdc = rdev_get_id(dev);
283 if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
284 return -EINVAL;
286 if (dcdc == tps->core_regulator) {
287 data = tps_65023_reg_read(tps, TPS65023_REG_DEF_CORE);
288 if (data < 0)
289 return data;
290 data &= (tps->info[dcdc]->table_len - 1);
291 return tps->info[dcdc]->table[data] * 1000;
292 } else
293 return tps->info[dcdc]->min_uV;
296 static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
297 int min_uV, int max_uV,
298 unsigned *selector)
300 struct tps_pmic *tps = rdev_get_drvdata(dev);
301 int dcdc = rdev_get_id(dev);
302 int vsel;
303 int ret;
305 if (dcdc != tps->core_regulator)
306 return -EINVAL;
307 if (min_uV < tps->info[dcdc]->min_uV
308 || min_uV > tps->info[dcdc]->max_uV)
309 return -EINVAL;
310 if (max_uV < tps->info[dcdc]->min_uV
311 || max_uV > tps->info[dcdc]->max_uV)
312 return -EINVAL;
314 for (vsel = 0; vsel < tps->info[dcdc]->table_len; vsel++) {
315 int mV = tps->info[dcdc]->table[vsel];
316 int uV = mV * 1000;
318 /* Break at the first in-range value */
319 if (min_uV <= uV && uV <= max_uV)
320 break;
323 *selector = vsel;
325 if (vsel == tps->info[dcdc]->table_len)
326 goto failed;
328 ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
330 /* Tell the chip that we have changed the value in DEFCORE
331 * and its time to update the core voltage
333 tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2,
334 TPS65023_REG_CTRL2_GO);
336 return ret;
338 failed:
339 return -EINVAL;
342 static int tps65023_ldo_get_voltage(struct regulator_dev *dev)
344 struct tps_pmic *tps = rdev_get_drvdata(dev);
345 int data, ldo = rdev_get_id(dev);
347 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
348 return -EINVAL;
350 data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL);
351 if (data < 0)
352 return data;
354 data >>= (TPS65023_LDO_CTRL_LDOx_SHIFT(ldo - TPS65023_LDO_1));
355 data &= (tps->info[ldo]->table_len - 1);
356 return tps->info[ldo]->table[data] * 1000;
359 static int tps65023_ldo_set_voltage(struct regulator_dev *dev,
360 int min_uV, int max_uV, unsigned *selector)
362 struct tps_pmic *tps = rdev_get_drvdata(dev);
363 int data, vsel, ldo = rdev_get_id(dev);
365 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
366 return -EINVAL;
368 if (min_uV < tps->info[ldo]->min_uV || min_uV > tps->info[ldo]->max_uV)
369 return -EINVAL;
370 if (max_uV < tps->info[ldo]->min_uV || max_uV > tps->info[ldo]->max_uV)
371 return -EINVAL;
373 for (vsel = 0; vsel < tps->info[ldo]->table_len; vsel++) {
374 int mV = tps->info[ldo]->table[vsel];
375 int uV = mV * 1000;
377 /* Break at the first in-range value */
378 if (min_uV <= uV && uV <= max_uV)
379 break;
382 if (vsel == tps->info[ldo]->table_len)
383 return -EINVAL;
385 *selector = vsel;
387 data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL);
388 if (data < 0)
389 return data;
391 data &= TPS65023_LDO_CTRL_LDOx_MASK(ldo - TPS65023_LDO_1);
392 data |= (vsel << (TPS65023_LDO_CTRL_LDOx_SHIFT(ldo - TPS65023_LDO_1)));
393 return tps_65023_reg_write(tps, TPS65023_REG_LDO_CTRL, data);
396 static int tps65023_dcdc_list_voltage(struct regulator_dev *dev,
397 unsigned selector)
399 struct tps_pmic *tps = rdev_get_drvdata(dev);
400 int dcdc = rdev_get_id(dev);
402 if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
403 return -EINVAL;
405 if (dcdc == tps->core_regulator) {
406 if (selector >= tps->info[dcdc]->table_len)
407 return -EINVAL;
408 else
409 return tps->info[dcdc]->table[selector] * 1000;
410 } else
411 return tps->info[dcdc]->min_uV;
414 static int tps65023_ldo_list_voltage(struct regulator_dev *dev,
415 unsigned selector)
417 struct tps_pmic *tps = rdev_get_drvdata(dev);
418 int ldo = rdev_get_id(dev);
420 if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
421 return -EINVAL;
423 if (selector >= tps->info[ldo]->table_len)
424 return -EINVAL;
425 else
426 return tps->info[ldo]->table[selector] * 1000;
429 /* Operations permitted on VDCDCx */
430 static struct regulator_ops tps65023_dcdc_ops = {
431 .is_enabled = tps65023_dcdc_is_enabled,
432 .enable = tps65023_dcdc_enable,
433 .disable = tps65023_dcdc_disable,
434 .get_voltage = tps65023_dcdc_get_voltage,
435 .set_voltage = tps65023_dcdc_set_voltage,
436 .list_voltage = tps65023_dcdc_list_voltage,
439 /* Operations permitted on LDOx */
440 static struct regulator_ops tps65023_ldo_ops = {
441 .is_enabled = tps65023_ldo_is_enabled,
442 .enable = tps65023_ldo_enable,
443 .disable = tps65023_ldo_disable,
444 .get_voltage = tps65023_ldo_get_voltage,
445 .set_voltage = tps65023_ldo_set_voltage,
446 .list_voltage = tps65023_ldo_list_voltage,
449 static struct regmap_config tps65023_regmap_config = {
450 .reg_bits = 8,
451 .val_bits = 8,
454 static int __devinit tps_65023_probe(struct i2c_client *client,
455 const struct i2c_device_id *id)
457 const struct tps_driver_data *drv_data = (void *)id->driver_data;
458 const struct tps_info *info = drv_data->info;
459 struct regulator_init_data *init_data;
460 struct regulator_dev *rdev;
461 struct tps_pmic *tps;
462 int i;
463 int error;
465 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
466 return -EIO;
469 * init_data points to array of regulator_init structures
470 * coming from the board-evm file.
472 init_data = client->dev.platform_data;
473 if (!init_data)
474 return -EIO;
476 tps = kzalloc(sizeof(*tps), GFP_KERNEL);
477 if (!tps)
478 return -ENOMEM;
480 tps->regmap = regmap_init_i2c(client, &tps65023_regmap_config);
481 if (IS_ERR(tps->regmap)) {
482 error = PTR_ERR(tps->regmap);
483 dev_err(&client->dev, "Failed to allocate register map: %d\n",
484 error);
485 goto fail_alloc;
488 /* common for all regulators */
489 tps->client = client;
490 tps->core_regulator = drv_data->core_regulator;
492 for (i = 0; i < TPS65023_NUM_REGULATOR; i++, info++, init_data++) {
493 /* Store regulator specific information */
494 tps->info[i] = info;
496 tps->desc[i].name = info->name;
497 tps->desc[i].id = i;
498 tps->desc[i].n_voltages = info->table_len;
499 tps->desc[i].ops = (i > TPS65023_DCDC_3 ?
500 &tps65023_ldo_ops : &tps65023_dcdc_ops);
501 tps->desc[i].type = REGULATOR_VOLTAGE;
502 tps->desc[i].owner = THIS_MODULE;
504 /* Register the regulators */
505 rdev = regulator_register(&tps->desc[i], &client->dev,
506 init_data, tps);
507 if (IS_ERR(rdev)) {
508 dev_err(&client->dev, "failed to register %s\n",
509 id->name);
510 error = PTR_ERR(rdev);
511 goto fail;
514 /* Save regulator for cleanup */
515 tps->rdev[i] = rdev;
518 i2c_set_clientdata(client, tps);
520 /* Enable setting output voltage by I2C */
521 tps_65023_clear_bits(tps, TPS65023_REG_CON_CTRL2,
522 TPS65023_REG_CTRL2_CORE_ADJ);
524 /* Enable setting output voltage by I2C */
525 tps_65023_clear_bits(tps, TPS65023_REG_CON_CTRL2,
526 TPS65023_REG_CTRL2_CORE_ADJ);
528 return 0;
530 fail:
531 while (--i >= 0)
532 regulator_unregister(tps->rdev[i]);
534 regmap_exit(tps->regmap);
535 fail_alloc:
536 kfree(tps);
537 return error;
541 * tps_65023_remove - TPS65023 driver i2c remove handler
542 * @client: i2c driver client device structure
544 * Unregister TPS driver as an i2c client device driver
546 static int __devexit tps_65023_remove(struct i2c_client *client)
548 struct tps_pmic *tps = i2c_get_clientdata(client);
549 int i;
551 for (i = 0; i < TPS65023_NUM_REGULATOR; i++)
552 regulator_unregister(tps->rdev[i]);
554 regmap_exit(tps->regmap);
555 kfree(tps);
557 return 0;
560 static const struct tps_info tps65020_regs[] = {
562 .name = "VDCDC1",
563 .min_uV = 3300000,
564 .max_uV = 3300000,
565 .fixed = 1,
568 .name = "VDCDC2",
569 .min_uV = 1800000,
570 .max_uV = 1800000,
571 .fixed = 1,
574 .name = "VDCDC3",
575 .min_uV = 800000,
576 .max_uV = 1600000,
577 .table_len = ARRAY_SIZE(VCORE_VSEL_table),
578 .table = VCORE_VSEL_table,
582 .name = "LDO1",
583 .min_uV = 1000000,
584 .max_uV = 3150000,
585 .table_len = ARRAY_SIZE(TPS65020_LDO1_VSEL_table),
586 .table = TPS65020_LDO1_VSEL_table,
589 .name = "LDO2",
590 .min_uV = 1050000,
591 .max_uV = 3300000,
592 .table_len = ARRAY_SIZE(TPS65020_LDO2_VSEL_table),
593 .table = TPS65020_LDO2_VSEL_table,
597 static const struct tps_info tps65021_regs[] = {
599 .name = "VDCDC1",
600 .min_uV = 3300000,
601 .max_uV = 3300000,
602 .fixed = 1,
605 .name = "VDCDC2",
606 .min_uV = 1800000,
607 .max_uV = 1800000,
608 .fixed = 1,
611 .name = "VDCDC3",
612 .min_uV = 800000,
613 .max_uV = 1600000,
614 .table_len = ARRAY_SIZE(VCORE_VSEL_table),
615 .table = VCORE_VSEL_table,
618 .name = "LDO1",
619 .min_uV = 1000000,
620 .max_uV = 3150000,
621 .table_len = ARRAY_SIZE(TPS65023_LDO1_VSEL_table),
622 .table = TPS65023_LDO1_VSEL_table,
625 .name = "LDO2",
626 .min_uV = 1050000,
627 .max_uV = 3300000,
628 .table_len = ARRAY_SIZE(TPS65023_LDO2_VSEL_table),
629 .table = TPS65023_LDO2_VSEL_table,
633 static const struct tps_info tps65023_regs[] = {
635 .name = "VDCDC1",
636 .min_uV = 800000,
637 .max_uV = 1600000,
638 .table_len = ARRAY_SIZE(VCORE_VSEL_table),
639 .table = VCORE_VSEL_table,
642 .name = "VDCDC2",
643 .min_uV = 3300000,
644 .max_uV = 3300000,
645 .fixed = 1,
648 .name = "VDCDC3",
649 .min_uV = 1800000,
650 .max_uV = 1800000,
651 .fixed = 1,
654 .name = "LDO1",
655 .min_uV = 1000000,
656 .max_uV = 3150000,
657 .table_len = ARRAY_SIZE(TPS65023_LDO1_VSEL_table),
658 .table = TPS65023_LDO1_VSEL_table,
661 .name = "LDO2",
662 .min_uV = 1050000,
663 .max_uV = 3300000,
664 .table_len = ARRAY_SIZE(TPS65023_LDO2_VSEL_table),
665 .table = TPS65023_LDO2_VSEL_table,
669 static struct tps_driver_data tps65020_drv_data = {
670 .info = tps65020_regs,
671 .core_regulator = TPS65023_DCDC_3,
674 static struct tps_driver_data tps65021_drv_data = {
675 .info = tps65021_regs,
676 .core_regulator = TPS65023_DCDC_3,
679 static struct tps_driver_data tps65023_drv_data = {
680 .info = tps65023_regs,
681 .core_regulator = TPS65023_DCDC_1,
684 static const struct i2c_device_id tps_65023_id[] = {
685 {.name = "tps65023",
686 .driver_data = (unsigned long) &tps65023_drv_data},
687 {.name = "tps65021",
688 .driver_data = (unsigned long) &tps65021_drv_data,},
689 {.name = "tps65020",
690 .driver_data = (unsigned long) &tps65020_drv_data},
691 { },
694 MODULE_DEVICE_TABLE(i2c, tps_65023_id);
696 static struct i2c_driver tps_65023_i2c_driver = {
697 .driver = {
698 .name = "tps65023",
699 .owner = THIS_MODULE,
701 .probe = tps_65023_probe,
702 .remove = __devexit_p(tps_65023_remove),
703 .id_table = tps_65023_id,
707 * tps_65023_init
709 * Module init function
711 static int __init tps_65023_init(void)
713 return i2c_add_driver(&tps_65023_i2c_driver);
715 subsys_initcall(tps_65023_init);
718 * tps_65023_cleanup
720 * Module exit function
722 static void __exit tps_65023_cleanup(void)
724 i2c_del_driver(&tps_65023_i2c_driver);
726 module_exit(tps_65023_cleanup);
728 MODULE_AUTHOR("Texas Instruments");
729 MODULE_DESCRIPTION("TPS65023 voltage regulator driver");
730 MODULE_LICENSE("GPL v2");