aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:48:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:48:31 -0400
commitb57ab7632b8fc1eef139bbbb7a89002be61f99e1 (patch)
tree19d4eeea0dbf721312c4e33a423ed29ff70aff88 /drivers/i2c/chips
parentf12c03722045882a50c270f6332cf2c7b16a83d2 (diff)
parent3760f736716f74bdc62a4ba5406934338da93eb2 (diff)
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Convert most new-style drivers to use module aliasing i2c: Add support for device alias names i2c-amd756-s4882: Fix an error path i2c: Drop unused RTC driver IDs i2c/tps65010: Add missing intialization of client data i2c-sis5595: Minor cleanups in sis5595_access i2c-piix4: Minor cleanups i2c: Spelling fix (successful) i2c-stub: No newline in parameter description
Diffstat (limited to 'drivers/i2c/chips')
-rw-r--r--drivers/i2c/chips/ds1682.c10
-rw-r--r--drivers/i2c/chips/menelaus.c10
-rw-r--r--drivers/i2c/chips/tps65010.c34
-rw-r--r--drivers/i2c/chips/tsl2550.c10
4 files changed, 42 insertions, 22 deletions
diff --git a/drivers/i2c/chips/ds1682.c b/drivers/i2c/chips/ds1682.c
index 9e94542c18a2..23be4d42cb02 100644
--- a/drivers/i2c/chips/ds1682.c
+++ b/drivers/i2c/chips/ds1682.c
@@ -200,7 +200,8 @@ static struct bin_attribute ds1682_eeprom_attr = {
200/* 200/*
201 * Called when a ds1682 device is matched with this driver 201 * Called when a ds1682 device is matched with this driver
202 */ 202 */
203static int ds1682_probe(struct i2c_client *client) 203static int ds1682_probe(struct i2c_client *client,
204 const struct i2c_device_id *id)
204{ 205{
205 int rc; 206 int rc;
206 207
@@ -234,12 +235,19 @@ static int ds1682_remove(struct i2c_client *client)
234 return 0; 235 return 0;
235} 236}
236 237
238static const struct i2c_device_id ds1682_id[] = {
239 { "ds1682", 0 },
240 { }
241};
242MODULE_DEVICE_TABLE(i2c, ds1682_id);
243
237static struct i2c_driver ds1682_driver = { 244static struct i2c_driver ds1682_driver = {
238 .driver = { 245 .driver = {
239 .name = "ds1682", 246 .name = "ds1682",
240 }, 247 },
241 .probe = ds1682_probe, 248 .probe = ds1682_probe,
242 .remove = ds1682_remove, 249 .remove = ds1682_remove,
250 .id_table = ds1682_id,
243}; 251};
244 252
245static int __init ds1682_init(void) 253static int __init ds1682_init(void)
diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c
index 2dea0123a958..b36db1797c11 100644
--- a/drivers/i2c/chips/menelaus.c
+++ b/drivers/i2c/chips/menelaus.c
@@ -1149,7 +1149,8 @@ static inline void menelaus_rtc_init(struct menelaus_chip *m)
1149 1149
1150static struct i2c_driver menelaus_i2c_driver; 1150static struct i2c_driver menelaus_i2c_driver;
1151 1151
1152static int menelaus_probe(struct i2c_client *client) 1152static int menelaus_probe(struct i2c_client *client,
1153 const struct i2c_device_id *id)
1153{ 1154{
1154 struct menelaus_chip *menelaus; 1155 struct menelaus_chip *menelaus;
1155 int rev = 0, val; 1156 int rev = 0, val;
@@ -1242,12 +1243,19 @@ static int __exit menelaus_remove(struct i2c_client *client)
1242 return 0; 1243 return 0;
1243} 1244}
1244 1245
1246static const struct i2c_device_id menelaus_id[] = {
1247 { "menelaus", 0 },
1248 { }
1249};
1250MODULE_DEVICE_TABLE(i2c, menelaus_id);
1251
1245static struct i2c_driver menelaus_i2c_driver = { 1252static struct i2c_driver menelaus_i2c_driver = {
1246 .driver = { 1253 .driver = {
1247 .name = DRIVER_NAME, 1254 .name = DRIVER_NAME,
1248 }, 1255 },
1249 .probe = menelaus_probe, 1256 .probe = menelaus_probe,
1250 .remove = __exit_p(menelaus_remove), 1257 .remove = __exit_p(menelaus_remove),
1258 .id_table = menelaus_id,
1251}; 1259};
1252 1260
1253static int __init menelaus_init(void) 1261static int __init menelaus_init(void)
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c
index b67f69c2e7f3..85949685191b 100644
--- a/drivers/i2c/chips/tps65010.c
+++ b/drivers/i2c/chips/tps65010.c
@@ -64,7 +64,6 @@ static struct i2c_driver tps65010_driver;
64 * as part of board setup by a bootloader. 64 * as part of board setup by a bootloader.
65 */ 65 */
66enum tps_model { 66enum tps_model {
67 TPS_UNKNOWN = 0,
68 TPS65010, 67 TPS65010,
69 TPS65011, 68 TPS65011,
70 TPS65012, 69 TPS65012,
@@ -527,11 +526,13 @@ static int __exit tps65010_remove(struct i2c_client *client)
527 flush_scheduled_work(); 526 flush_scheduled_work();
528 debugfs_remove(tps->file); 527 debugfs_remove(tps->file);
529 kfree(tps); 528 kfree(tps);
529 i2c_set_clientdata(client, NULL);
530 the_tps = NULL; 530 the_tps = NULL;
531 return 0; 531 return 0;
532} 532}
533 533
534static int tps65010_probe(struct i2c_client *client) 534static int tps65010_probe(struct i2c_client *client,
535 const struct i2c_device_id *id)
535{ 536{
536 struct tps65010 *tps; 537 struct tps65010 *tps;
537 int status; 538 int status;
@@ -552,20 +553,7 @@ static int tps65010_probe(struct i2c_client *client)
552 mutex_init(&tps->lock); 553 mutex_init(&tps->lock);
553 INIT_DELAYED_WORK(&tps->work, tps65010_work); 554 INIT_DELAYED_WORK(&tps->work, tps65010_work);
554 tps->client = client; 555 tps->client = client;
555 556 tps->model = id->driver_data;
556 if (strcmp(client->name, "tps65010") == 0)
557 tps->model = TPS65010;
558 else if (strcmp(client->name, "tps65011") == 0)
559 tps->model = TPS65011;
560 else if (strcmp(client->name, "tps65012") == 0)
561 tps->model = TPS65012;
562 else if (strcmp(client->name, "tps65013") == 0)
563 tps->model = TPS65013;
564 else {
565 dev_warn(&client->dev, "unknown chip '%s'\n", client->name);
566 status = -ENODEV;
567 goto fail1;
568 }
569 557
570 /* the IRQ is active low, but many gpio lines can't support that 558 /* the IRQ is active low, but many gpio lines can't support that
571 * so this driver uses falling-edge triggers instead. 559 * so this driver uses falling-edge triggers instead.
@@ -594,9 +582,6 @@ static int tps65010_probe(struct i2c_client *client)
594 case TPS65012: 582 case TPS65012:
595 tps->por = 1; 583 tps->por = 1;
596 break; 584 break;
597 case TPS_UNKNOWN:
598 printk(KERN_WARNING "%s: unknown TPS chip\n", DRIVER_NAME);
599 break;
600 /* else CHGCONFIG.POR is replaced by AUA, enabling a WAIT mode */ 585 /* else CHGCONFIG.POR is replaced by AUA, enabling a WAIT mode */
601 } 586 }
602 tps->chgconf = i2c_smbus_read_byte_data(client, TPS_CHGCONFIG); 587 tps->chgconf = i2c_smbus_read_byte_data(client, TPS_CHGCONFIG);
@@ -615,6 +600,7 @@ static int tps65010_probe(struct i2c_client *client)
615 i2c_smbus_read_byte_data(client, TPS_DEFGPIO), 600 i2c_smbus_read_byte_data(client, TPS_DEFGPIO),
616 i2c_smbus_read_byte_data(client, TPS_MASK3)); 601 i2c_smbus_read_byte_data(client, TPS_MASK3));
617 602
603 i2c_set_clientdata(client, tps);
618 the_tps = tps; 604 the_tps = tps;
619 605
620#if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG) 606#if defined(CONFIG_USB_GADGET) && !defined(CONFIG_USB_OTG)
@@ -682,12 +668,22 @@ fail1:
682 return status; 668 return status;
683} 669}
684 670
671static const struct i2c_device_id tps65010_id[] = {
672 { "tps65010", TPS65010 },
673 { "tps65011", TPS65011 },
674 { "tps65012", TPS65012 },
675 { "tps65013", TPS65013 },
676 { }
677};
678MODULE_DEVICE_TABLE(i2c, tps65010_id);
679
685static struct i2c_driver tps65010_driver = { 680static struct i2c_driver tps65010_driver = {
686 .driver = { 681 .driver = {
687 .name = "tps65010", 682 .name = "tps65010",
688 }, 683 },
689 .probe = tps65010_probe, 684 .probe = tps65010_probe,
690 .remove = __exit_p(tps65010_remove), 685 .remove = __exit_p(tps65010_remove),
686 .id_table = tps65010_id,
691}; 687};
692 688
693/*-------------------------------------------------------------------------*/ 689/*-------------------------------------------------------------------------*/
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index a10fd2791a69..1a9cc135219f 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -364,7 +364,8 @@ static int tsl2550_init_client(struct i2c_client *client)
364 */ 364 */
365 365
366static struct i2c_driver tsl2550_driver; 366static struct i2c_driver tsl2550_driver;
367static int __devinit tsl2550_probe(struct i2c_client *client) 367static int __devinit tsl2550_probe(struct i2c_client *client,
368 const struct i2c_device_id *id)
368{ 369{
369 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 370 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
370 struct tsl2550_data *data; 371 struct tsl2550_data *data;
@@ -451,6 +452,12 @@ static int tsl2550_resume(struct i2c_client *client)
451 452
452#endif /* CONFIG_PM */ 453#endif /* CONFIG_PM */
453 454
455static const struct i2c_device_id tsl2550_id[] = {
456 { "tsl2550", 0 },
457 { }
458};
459MODULE_DEVICE_TABLE(i2c, tsl2550_id);
460
454static struct i2c_driver tsl2550_driver = { 461static struct i2c_driver tsl2550_driver = {
455 .driver = { 462 .driver = {
456 .name = TSL2550_DRV_NAME, 463 .name = TSL2550_DRV_NAME,
@@ -460,6 +467,7 @@ static struct i2c_driver tsl2550_driver = {
460 .resume = tsl2550_resume, 467 .resume = tsl2550_resume,
461 .probe = tsl2550_probe, 468 .probe = tsl2550_probe,
462 .remove = __devexit_p(tsl2550_remove), 469 .remove = __devexit_p(tsl2550_remove),
470 .id_table = tsl2550_id,
463}; 471};
464 472
465static int __init tsl2550_init(void) 473static int __init tsl2550_init(void)