diff options
author | Balaji T K <balajitk@ti.com> | 2009-12-13 15:23:33 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-12-13 15:23:33 -0500 |
commit | fc7b92fca4e546184557f1c53f84ad57c66b7695 (patch) | |
tree | f15b37df7d34f525d877d33186b840947aa65b4d /drivers/mfd/twl-core.c | |
parent | b07682b6056eb6701f8cb86aa5800e6f2ea7919b (diff) |
mfd: Rename all twl4030_i2c*
This patch renames function names like twl4030_i2c_write_u8,
twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8
and also common variable in twl-core.c
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r-- | drivers/mfd/twl-core.c | 136 |
1 files changed, 73 insertions, 63 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 44714f5cf495..9021f44de2a4 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * twl4030_core.c - driver for TWL4030/TPS659x0 PM and audio CODEC devices | 2 | * twl_core.c - driver for TWL4030/TWL5030/TWL60X0/TPS659x0 PM |
3 | * and audio CODEC devices | ||
3 | * | 4 | * |
4 | * Copyright (C) 2005-2006 Texas Instruments, Inc. | 5 | * Copyright (C) 2005-2006 Texas Instruments, Inc. |
5 | * | 6 | * |
@@ -55,7 +56,7 @@ | |||
55 | * (and associated registers). | 56 | * (and associated registers). |
56 | */ | 57 | */ |
57 | 58 | ||
58 | #define DRIVER_NAME "twl4030" | 59 | #define DRIVER_NAME "twl" |
59 | 60 | ||
60 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 61 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
61 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 62 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |
@@ -125,7 +126,7 @@ | |||
125 | /* Last - for index max*/ | 126 | /* Last - for index max*/ |
126 | #define TWL4030_MODULE_LAST TWL4030_MODULE_SECURED_REG | 127 | #define TWL4030_MODULE_LAST TWL4030_MODULE_SECURED_REG |
127 | 128 | ||
128 | #define TWL4030_NUM_SLAVES 4 | 129 | #define TWL_NUM_SLAVES 4 |
129 | 130 | ||
130 | #if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \ | 131 | #if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \ |
131 | || defined(CONFIG_INPUT_TWL4030_PWBUTTON_MODULE) | 132 | || defined(CONFIG_INPUT_TWL4030_PWBUTTON_MODULE) |
@@ -134,6 +135,13 @@ | |||
134 | #define twl_has_pwrbutton() false | 135 | #define twl_has_pwrbutton() false |
135 | #endif | 136 | #endif |
136 | 137 | ||
138 | #define SUB_CHIP_ID0 0 | ||
139 | #define SUB_CHIP_ID1 1 | ||
140 | #define SUB_CHIP_ID2 2 | ||
141 | #define SUB_CHIP_ID3 3 | ||
142 | |||
143 | #define TWL_MODULE_LAST TWL4030_MODULE_LAST | ||
144 | |||
137 | /* Base Address defns for twl4030_map[] */ | 145 | /* Base Address defns for twl4030_map[] */ |
138 | 146 | ||
139 | /* subchip/slave 0 - USB ID */ | 147 | /* subchip/slave 0 - USB ID */ |
@@ -201,7 +209,7 @@ | |||
201 | static bool inuse; | 209 | static bool inuse; |
202 | 210 | ||
203 | /* Structure for each TWL4030 Slave */ | 211 | /* Structure for each TWL4030 Slave */ |
204 | struct twl4030_client { | 212 | struct twl_client { |
205 | struct i2c_client *client; | 213 | struct i2c_client *client; |
206 | u8 address; | 214 | u8 address; |
207 | 215 | ||
@@ -212,16 +220,16 @@ struct twl4030_client { | |||
212 | struct mutex xfer_lock; | 220 | struct mutex xfer_lock; |
213 | }; | 221 | }; |
214 | 222 | ||
215 | static struct twl4030_client twl4030_modules[TWL4030_NUM_SLAVES]; | 223 | static struct twl_client twl_modules[TWL_NUM_SLAVES]; |
216 | 224 | ||
217 | 225 | ||
218 | /* mapping the module id to slave id and base address */ | 226 | /* mapping the module id to slave id and base address */ |
219 | struct twl4030mapping { | 227 | struct twl_mapping { |
220 | unsigned char sid; /* Slave ID */ | 228 | unsigned char sid; /* Slave ID */ |
221 | unsigned char base; /* base address */ | 229 | unsigned char base; /* base address */ |
222 | }; | 230 | }; |
223 | 231 | ||
224 | static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = { | 232 | static struct twl_mapping twl4030_map[TWL4030_MODULE_LAST + 1] = { |
225 | /* | 233 | /* |
226 | * NOTE: don't change this table without updating the | 234 | * NOTE: don't change this table without updating the |
227 | * <linux/i2c/twl4030.h> defines for TWL4030_MODULE_* | 235 | * <linux/i2c/twl4030.h> defines for TWL4030_MODULE_* |
@@ -262,7 +270,7 @@ static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = { | |||
262 | /* Exported Functions */ | 270 | /* Exported Functions */ |
263 | 271 | ||
264 | /** | 272 | /** |
265 | * twl4030_i2c_write - Writes a n bit register in TWL4030 | 273 | * twl_i2c_write - Writes a n bit register in TWL4030/TWL5030/TWL60X0 |
266 | * @mod_no: module number | 274 | * @mod_no: module number |
267 | * @value: an array of num_bytes+1 containing data to write | 275 | * @value: an array of num_bytes+1 containing data to write |
268 | * @reg: register address (just offset will do) | 276 | * @reg: register address (just offset will do) |
@@ -273,19 +281,19 @@ static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = { | |||
273 | * | 281 | * |
274 | * Returns the result of operation - 0 is success | 282 | * Returns the result of operation - 0 is success |
275 | */ | 283 | */ |
276 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | 284 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) |
277 | { | 285 | { |
278 | int ret; | 286 | int ret; |
279 | int sid; | 287 | int sid; |
280 | struct twl4030_client *twl; | 288 | struct twl_client *twl; |
281 | struct i2c_msg *msg; | 289 | struct i2c_msg *msg; |
282 | 290 | ||
283 | if (unlikely(mod_no > TWL4030_MODULE_LAST)) { | 291 | if (unlikely(mod_no > TWL_MODULE_LAST)) { |
284 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); | 292 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); |
285 | return -EPERM; | 293 | return -EPERM; |
286 | } | 294 | } |
287 | sid = twl4030_map[mod_no].sid; | 295 | sid = twl4030_map[mod_no].sid; |
288 | twl = &twl4030_modules[sid]; | 296 | twl = &twl_modules[sid]; |
289 | 297 | ||
290 | if (unlikely(!inuse)) { | 298 | if (unlikely(!inuse)) { |
291 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); | 299 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); |
@@ -318,10 +326,10 @@ int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | |||
318 | return 0; | 326 | return 0; |
319 | } | 327 | } |
320 | } | 328 | } |
321 | EXPORT_SYMBOL(twl4030_i2c_write); | 329 | EXPORT_SYMBOL(twl_i2c_write); |
322 | 330 | ||
323 | /** | 331 | /** |
324 | * twl4030_i2c_read - Reads a n bit register in TWL4030 | 332 | * twl_i2c_read - Reads a n bit register in TWL4030/TWL5030/TWL60X0 |
325 | * @mod_no: module number | 333 | * @mod_no: module number |
326 | * @value: an array of num_bytes containing data to be read | 334 | * @value: an array of num_bytes containing data to be read |
327 | * @reg: register address (just offset will do) | 335 | * @reg: register address (just offset will do) |
@@ -329,20 +337,20 @@ EXPORT_SYMBOL(twl4030_i2c_write); | |||
329 | * | 337 | * |
330 | * Returns result of operation - num_bytes is success else failure. | 338 | * Returns result of operation - num_bytes is success else failure. |
331 | */ | 339 | */ |
332 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | 340 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) |
333 | { | 341 | { |
334 | int ret; | 342 | int ret; |
335 | u8 val; | 343 | u8 val; |
336 | int sid; | 344 | int sid; |
337 | struct twl4030_client *twl; | 345 | struct twl_client *twl; |
338 | struct i2c_msg *msg; | 346 | struct i2c_msg *msg; |
339 | 347 | ||
340 | if (unlikely(mod_no > TWL4030_MODULE_LAST)) { | 348 | if (unlikely(mod_no > TWL_MODULE_LAST)) { |
341 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); | 349 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); |
342 | return -EPERM; | 350 | return -EPERM; |
343 | } | 351 | } |
344 | sid = twl4030_map[mod_no].sid; | 352 | sid = twl4030_map[mod_no].sid; |
345 | twl = &twl4030_modules[sid]; | 353 | twl = &twl_modules[sid]; |
346 | 354 | ||
347 | if (unlikely(!inuse)) { | 355 | if (unlikely(!inuse)) { |
348 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); | 356 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); |
@@ -377,40 +385,40 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | |||
377 | return 0; | 385 | return 0; |
378 | } | 386 | } |
379 | } | 387 | } |
380 | EXPORT_SYMBOL(twl4030_i2c_read); | 388 | EXPORT_SYMBOL(twl_i2c_read); |
381 | 389 | ||
382 | /** | 390 | /** |
383 | * twl4030_i2c_write_u8 - Writes a 8 bit register in TWL4030 | 391 | * twl_i2c_write_u8 - Writes a 8 bit register in TWL4030/TWL5030/TWL60X0 |
384 | * @mod_no: module number | 392 | * @mod_no: module number |
385 | * @value: the value to be written 8 bit | 393 | * @value: the value to be written 8 bit |
386 | * @reg: register address (just offset will do) | 394 | * @reg: register address (just offset will do) |
387 | * | 395 | * |
388 | * Returns result of operation - 0 is success | 396 | * Returns result of operation - 0 is success |
389 | */ | 397 | */ |
390 | int twl4030_i2c_write_u8(u8 mod_no, u8 value, u8 reg) | 398 | int twl_i2c_write_u8(u8 mod_no, u8 value, u8 reg) |
391 | { | 399 | { |
392 | 400 | ||
393 | /* 2 bytes offset 1 contains the data offset 0 is used by i2c_write */ | 401 | /* 2 bytes offset 1 contains the data offset 0 is used by i2c_write */ |
394 | u8 temp_buffer[2] = { 0 }; | 402 | u8 temp_buffer[2] = { 0 }; |
395 | /* offset 1 contains the data */ | 403 | /* offset 1 contains the data */ |
396 | temp_buffer[1] = value; | 404 | temp_buffer[1] = value; |
397 | return twl4030_i2c_write(mod_no, temp_buffer, reg, 1); | 405 | return twl_i2c_write(mod_no, temp_buffer, reg, 1); |
398 | } | 406 | } |
399 | EXPORT_SYMBOL(twl4030_i2c_write_u8); | 407 | EXPORT_SYMBOL(twl_i2c_write_u8); |
400 | 408 | ||
401 | /** | 409 | /** |
402 | * twl4030_i2c_read_u8 - Reads a 8 bit register from TWL4030 | 410 | * twl_i2c_read_u8 - Reads a 8 bit register from TWL4030/TWL5030/TWL60X0 |
403 | * @mod_no: module number | 411 | * @mod_no: module number |
404 | * @value: the value read 8 bit | 412 | * @value: the value read 8 bit |
405 | * @reg: register address (just offset will do) | 413 | * @reg: register address (just offset will do) |
406 | * | 414 | * |
407 | * Returns result of operation - 0 is success | 415 | * Returns result of operation - 0 is success |
408 | */ | 416 | */ |
409 | int twl4030_i2c_read_u8(u8 mod_no, u8 *value, u8 reg) | 417 | int twl_i2c_read_u8(u8 mod_no, u8 *value, u8 reg) |
410 | { | 418 | { |
411 | return twl4030_i2c_read(mod_no, value, reg, 1); | 419 | return twl_i2c_read(mod_no, value, reg, 1); |
412 | } | 420 | } |
413 | EXPORT_SYMBOL(twl4030_i2c_read_u8); | 421 | EXPORT_SYMBOL(twl_i2c_read_u8); |
414 | 422 | ||
415 | /*----------------------------------------------------------------------*/ | 423 | /*----------------------------------------------------------------------*/ |
416 | 424 | ||
@@ -420,7 +428,7 @@ add_numbered_child(unsigned chip, const char *name, int num, | |||
420 | bool can_wakeup, int irq0, int irq1) | 428 | bool can_wakeup, int irq0, int irq1) |
421 | { | 429 | { |
422 | struct platform_device *pdev; | 430 | struct platform_device *pdev; |
423 | struct twl4030_client *twl = &twl4030_modules[chip]; | 431 | struct twl_client *twl = &twl_modules[chip]; |
424 | int status; | 432 | int status; |
425 | 433 | ||
426 | pdev = platform_device_alloc(name, num); | 434 | pdev = platform_device_alloc(name, num); |
@@ -515,23 +523,24 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
515 | pdata->bci, sizeof(*pdata->bci), | 523 | pdata->bci, sizeof(*pdata->bci), |
516 | false, | 524 | false, |
517 | /* irq0 = CHG_PRES, irq1 = BCI */ | 525 | /* irq0 = CHG_PRES, irq1 = BCI */ |
518 | pdata->irq_base + 8 + 1, pdata->irq_base + 2); | 526 | pdata->irq_base + BCI_PRES_INTR_OFFSET, |
527 | pdata->irq_base + BCI_INTR_OFFSET); | ||
519 | if (IS_ERR(child)) | 528 | if (IS_ERR(child)) |
520 | return PTR_ERR(child); | 529 | return PTR_ERR(child); |
521 | } | 530 | } |
522 | 531 | ||
523 | if (twl_has_gpio() && pdata->gpio) { | 532 | if (twl_has_gpio() && pdata->gpio) { |
524 | child = add_child(1, "twl4030_gpio", | 533 | child = add_child(SUB_CHIP_ID1, "twl4030_gpio", |
525 | pdata->gpio, sizeof(*pdata->gpio), | 534 | pdata->gpio, sizeof(*pdata->gpio), |
526 | false, pdata->irq_base + 0, 0); | 535 | false, pdata->irq_base + GPIO_INTR_OFFSET, 0); |
527 | if (IS_ERR(child)) | 536 | if (IS_ERR(child)) |
528 | return PTR_ERR(child); | 537 | return PTR_ERR(child); |
529 | } | 538 | } |
530 | 539 | ||
531 | if (twl_has_keypad() && pdata->keypad) { | 540 | if (twl_has_keypad() && pdata->keypad) { |
532 | child = add_child(2, "twl4030_keypad", | 541 | child = add_child(SUB_CHIP_ID2, "twl4030_keypad", |
533 | pdata->keypad, sizeof(*pdata->keypad), | 542 | pdata->keypad, sizeof(*pdata->keypad), |
534 | true, pdata->irq_base + 1, 0); | 543 | true, pdata->irq_base + KEYPAD_INTR_OFFSET, 0); |
535 | if (IS_ERR(child)) | 544 | if (IS_ERR(child)) |
536 | return PTR_ERR(child); | 545 | return PTR_ERR(child); |
537 | } | 546 | } |
@@ -539,7 +548,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
539 | if (twl_has_madc() && pdata->madc) { | 548 | if (twl_has_madc() && pdata->madc) { |
540 | child = add_child(2, "twl4030_madc", | 549 | child = add_child(2, "twl4030_madc", |
541 | pdata->madc, sizeof(*pdata->madc), | 550 | pdata->madc, sizeof(*pdata->madc), |
542 | true, pdata->irq_base + 3, 0); | 551 | true, pdata->irq_base + MADC_INTR_OFFSET, 0); |
543 | if (IS_ERR(child)) | 552 | if (IS_ERR(child)) |
544 | return PTR_ERR(child); | 553 | return PTR_ERR(child); |
545 | } | 554 | } |
@@ -554,7 +563,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
554 | */ | 563 | */ |
555 | child = add_child(3, "twl4030_rtc", | 564 | child = add_child(3, "twl4030_rtc", |
556 | NULL, 0, | 565 | NULL, 0, |
557 | true, pdata->irq_base + 8 + 3, 0); | 566 | true, pdata->irq_base + RTC_INTR_OFFSET, 0); |
558 | if (IS_ERR(child)) | 567 | if (IS_ERR(child)) |
559 | return PTR_ERR(child); | 568 | return PTR_ERR(child); |
560 | } | 569 | } |
@@ -604,7 +613,8 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
604 | pdata->usb, sizeof(*pdata->usb), | 613 | pdata->usb, sizeof(*pdata->usb), |
605 | true, | 614 | true, |
606 | /* irq0 = USB_PRES, irq1 = USB */ | 615 | /* irq0 = USB_PRES, irq1 = USB */ |
607 | pdata->irq_base + 8 + 2, pdata->irq_base + 4); | 616 | pdata->irq_base + USB_PRES_INTR_OFFSET, |
617 | pdata->irq_base + USB_INTR_OFFSET); | ||
608 | 618 | ||
609 | if (IS_ERR(child)) | 619 | if (IS_ERR(child)) |
610 | return PTR_ERR(child); | 620 | return PTR_ERR(child); |
@@ -724,7 +734,7 @@ static inline int __init protect_pm_master(void) | |||
724 | { | 734 | { |
725 | int e = 0; | 735 | int e = 0; |
726 | 736 | ||
727 | e = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_LOCK, | 737 | e = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_LOCK, |
728 | R_PROTECT_KEY); | 738 | R_PROTECT_KEY); |
729 | return e; | 739 | return e; |
730 | } | 740 | } |
@@ -733,9 +743,9 @@ static inline int __init unprotect_pm_master(void) | |||
733 | { | 743 | { |
734 | int e = 0; | 744 | int e = 0; |
735 | 745 | ||
736 | e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_UNLOCK1, | 746 | e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_UNLOCK1, |
737 | R_PROTECT_KEY); | 747 | R_PROTECT_KEY); |
738 | e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_UNLOCK2, | 748 | e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_UNLOCK2, |
739 | R_PROTECT_KEY); | 749 | R_PROTECT_KEY); |
740 | return e; | 750 | return e; |
741 | } | 751 | } |
@@ -755,7 +765,7 @@ static void clocks_init(struct device *dev, | |||
755 | osc = clk_get(dev, "osc_sys_ck"); | 765 | osc = clk_get(dev, "osc_sys_ck"); |
756 | 766 | ||
757 | if (IS_ERR(osc)) { | 767 | if (IS_ERR(osc)) { |
758 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " | 768 | printk(KERN_WARNING "Skipping twl internal clock init and " |
759 | "using bootloader value (unknown osc rate)\n"); | 769 | "using bootloader value (unknown osc rate)\n"); |
760 | return; | 770 | return; |
761 | } | 771 | } |
@@ -769,7 +779,7 @@ static void clocks_init(struct device *dev, | |||
769 | */ | 779 | */ |
770 | osc = ERR_PTR(-EIO); | 780 | osc = ERR_PTR(-EIO); |
771 | 781 | ||
772 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " | 782 | printk(KERN_WARNING "Skipping twl internal clock init and " |
773 | "using bootloader value (unknown osc rate)\n"); | 783 | "using bootloader value (unknown osc rate)\n"); |
774 | 784 | ||
775 | return; | 785 | return; |
@@ -793,7 +803,7 @@ static void clocks_init(struct device *dev, | |||
793 | 803 | ||
794 | e |= unprotect_pm_master(); | 804 | e |= unprotect_pm_master(); |
795 | /* effect->MADC+USB ck en */ | 805 | /* effect->MADC+USB ck en */ |
796 | e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT); | 806 | e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, ctrl, R_CFG_BOOT); |
797 | e |= protect_pm_master(); | 807 | e |= protect_pm_master(); |
798 | 808 | ||
799 | if (e < 0) | 809 | if (e < 0) |
@@ -806,7 +816,7 @@ int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end); | |||
806 | int twl_exit_irq(void); | 816 | int twl_exit_irq(void); |
807 | int twl_init_chip_irq(const char *chip); | 817 | int twl_init_chip_irq(const char *chip); |
808 | 818 | ||
809 | static int twl4030_remove(struct i2c_client *client) | 819 | static int twl_remove(struct i2c_client *client) |
810 | { | 820 | { |
811 | unsigned i; | 821 | unsigned i; |
812 | int status; | 822 | int status; |
@@ -815,12 +825,12 @@ static int twl4030_remove(struct i2c_client *client) | |||
815 | if (status < 0) | 825 | if (status < 0) |
816 | return status; | 826 | return status; |
817 | 827 | ||
818 | for (i = 0; i < TWL4030_NUM_SLAVES; i++) { | 828 | for (i = 0; i < TWL_NUM_SLAVES; i++) { |
819 | struct twl4030_client *twl = &twl4030_modules[i]; | 829 | struct twl_client *twl = &twl_modules[i]; |
820 | 830 | ||
821 | if (twl->client && twl->client != client) | 831 | if (twl->client && twl->client != client) |
822 | i2c_unregister_device(twl->client); | 832 | i2c_unregister_device(twl->client); |
823 | twl4030_modules[i].client = NULL; | 833 | twl_modules[i].client = NULL; |
824 | } | 834 | } |
825 | inuse = false; | 835 | inuse = false; |
826 | return 0; | 836 | return 0; |
@@ -828,7 +838,7 @@ static int twl4030_remove(struct i2c_client *client) | |||
828 | 838 | ||
829 | /* NOTE: this driver only handles a single twl4030/tps659x0 chip */ | 839 | /* NOTE: this driver only handles a single twl4030/tps659x0 chip */ |
830 | static int __init | 840 | static int __init |
831 | twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | 841 | twl_probe(struct i2c_client *client, const struct i2c_device_id *id) |
832 | { | 842 | { |
833 | int status; | 843 | int status; |
834 | unsigned i; | 844 | unsigned i; |
@@ -849,8 +859,8 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
849 | return -EBUSY; | 859 | return -EBUSY; |
850 | } | 860 | } |
851 | 861 | ||
852 | for (i = 0; i < TWL4030_NUM_SLAVES; i++) { | 862 | for (i = 0; i < TWL_NUM_SLAVES; i++) { |
853 | struct twl4030_client *twl = &twl4030_modules[i]; | 863 | struct twl_client *twl = &twl_modules[i]; |
854 | 864 | ||
855 | twl->address = client->addr + i; | 865 | twl->address = client->addr + i; |
856 | if (i == 0) | 866 | if (i == 0) |
@@ -889,11 +899,11 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
889 | status = add_children(pdata, id->driver_data); | 899 | status = add_children(pdata, id->driver_data); |
890 | fail: | 900 | fail: |
891 | if (status < 0) | 901 | if (status < 0) |
892 | twl4030_remove(client); | 902 | twl_remove(client); |
893 | return status; | 903 | return status; |
894 | } | 904 | } |
895 | 905 | ||
896 | static const struct i2c_device_id twl4030_ids[] = { | 906 | static const struct i2c_device_id twl_ids[] = { |
897 | { "twl4030", TWL4030_VAUX2 }, /* "Triton 2" */ | 907 | { "twl4030", TWL4030_VAUX2 }, /* "Triton 2" */ |
898 | { "twl5030", 0 }, /* T2 updated */ | 908 | { "twl5030", 0 }, /* T2 updated */ |
899 | { "twl5031", TWL5031 }, /* TWL5030 updated */ | 909 | { "twl5031", TWL5031 }, /* TWL5030 updated */ |
@@ -902,28 +912,28 @@ static const struct i2c_device_id twl4030_ids[] = { | |||
902 | { "tps65920", TPS_SUBSET }, /* fewer LDOs; no codec or charger */ | 912 | { "tps65920", TPS_SUBSET }, /* fewer LDOs; no codec or charger */ |
903 | { /* end of list */ }, | 913 | { /* end of list */ }, |
904 | }; | 914 | }; |
905 | MODULE_DEVICE_TABLE(i2c, twl4030_ids); | 915 | MODULE_DEVICE_TABLE(i2c, twl_ids); |
906 | 916 | ||
907 | /* One Client Driver , 4 Clients */ | 917 | /* One Client Driver , 4 Clients */ |
908 | static struct i2c_driver twl4030_driver = { | 918 | static struct i2c_driver twl_driver = { |
909 | .driver.name = DRIVER_NAME, | 919 | .driver.name = DRIVER_NAME, |
910 | .id_table = twl4030_ids, | 920 | .id_table = twl_ids, |
911 | .probe = twl4030_probe, | 921 | .probe = twl_probe, |
912 | .remove = twl4030_remove, | 922 | .remove = twl_remove, |
913 | }; | 923 | }; |
914 | 924 | ||
915 | static int __init twl4030_init(void) | 925 | static int __init twl_init(void) |
916 | { | 926 | { |
917 | return i2c_add_driver(&twl4030_driver); | 927 | return i2c_add_driver(&twl_driver); |
918 | } | 928 | } |
919 | subsys_initcall(twl4030_init); | 929 | subsys_initcall(twl_init); |
920 | 930 | ||
921 | static void __exit twl4030_exit(void) | 931 | static void __exit twl_exit(void) |
922 | { | 932 | { |
923 | i2c_del_driver(&twl4030_driver); | 933 | i2c_del_driver(&twl_driver); |
924 | } | 934 | } |
925 | module_exit(twl4030_exit); | 935 | module_exit(twl_exit); |
926 | 936 | ||
927 | MODULE_AUTHOR("Texas Instruments, Inc."); | 937 | MODULE_AUTHOR("Texas Instruments, Inc."); |
928 | MODULE_DESCRIPTION("I2C Core interface for TWL4030"); | 938 | MODULE_DESCRIPTION("I2C Core interface for TWL"); |
929 | MODULE_LICENSE("GPL"); | 939 | MODULE_LICENSE("GPL"); |