diff options
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-ds1307.c | 66 | ||||
| -rw-r--r-- | drivers/rtc/rtc-ds1374.c | 10 | ||||
| -rw-r--r-- | drivers/rtc/rtc-isl1208.c | 9 | ||||
| -rw-r--r-- | drivers/rtc/rtc-m41t80.c | 81 | ||||
| -rw-r--r-- | drivers/rtc/rtc-pcf8563.c | 10 | ||||
| -rw-r--r-- | drivers/rtc/rtc-rs5c372.c | 27 | ||||
| -rw-r--r-- | drivers/rtc/rtc-s35390a.c | 10 | ||||
| -rw-r--r-- | drivers/rtc/rtc-x1205.c | 10 |
8 files changed, 105 insertions, 118 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index f389a28720d2..bbf97e65202a 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
| @@ -99,45 +99,38 @@ struct ds1307 { | |||
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | struct chip_desc { | 101 | struct chip_desc { |
| 102 | char name[9]; | ||
| 103 | unsigned nvram56:1; | 102 | unsigned nvram56:1; |
| 104 | unsigned alarm:1; | 103 | unsigned alarm:1; |
| 105 | enum ds_type type; | ||
| 106 | }; | 104 | }; |
| 107 | 105 | ||
| 108 | static const struct chip_desc chips[] = { { | 106 | static const struct chip_desc chips[] = { |
| 109 | .name = "ds1307", | 107 | [ds_1307] = { |
| 110 | .type = ds_1307, | ||
| 111 | .nvram56 = 1, | 108 | .nvram56 = 1, |
| 112 | }, { | 109 | }, |
| 113 | .name = "ds1337", | 110 | [ds_1337] = { |
| 114 | .type = ds_1337, | ||
| 115 | .alarm = 1, | 111 | .alarm = 1, |
| 116 | }, { | 112 | }, |
| 117 | .name = "ds1338", | 113 | [ds_1338] = { |
| 118 | .type = ds_1338, | ||
| 119 | .nvram56 = 1, | 114 | .nvram56 = 1, |
| 120 | }, { | 115 | }, |
| 121 | .name = "ds1339", | 116 | [ds_1339] = { |
| 122 | .type = ds_1339, | ||
| 123 | .alarm = 1, | 117 | .alarm = 1, |
| 124 | }, { | 118 | }, |
| 125 | .name = "ds1340", | 119 | [ds_1340] = { |
| 126 | .type = ds_1340, | 120 | }, |
| 127 | }, { | 121 | [m41t00] = { |
| 128 | .name = "m41t00", | ||
| 129 | .type = m41t00, | ||
| 130 | }, }; | 122 | }, }; |
| 131 | 123 | ||
| 132 | static inline const struct chip_desc *find_chip(const char *s) | 124 | static const struct i2c_device_id ds1307_id[] = { |
| 133 | { | 125 | { "ds1307", ds_1307 }, |
| 134 | unsigned i; | 126 | { "ds1337", ds_1337 }, |
| 135 | 127 | { "ds1338", ds_1338 }, | |
| 136 | for (i = 0; i < ARRAY_SIZE(chips); i++) | 128 | { "ds1339", ds_1339 }, |
| 137 | if (strnicmp(s, chips[i].name, sizeof chips[i].name) == 0) | 129 | { "ds1340", ds_1340 }, |
| 138 | return &chips[i]; | 130 | { "m41t00", m41t00 }, |
| 139 | return NULL; | 131 | { } |
| 140 | } | 132 | }; |
| 133 | MODULE_DEVICE_TABLE(i2c, ds1307_id); | ||
| 141 | 134 | ||
| 142 | static int ds1307_get_time(struct device *dev, struct rtc_time *t) | 135 | static int ds1307_get_time(struct device *dev, struct rtc_time *t) |
| 143 | { | 136 | { |
| @@ -326,21 +319,15 @@ static struct bin_attribute nvram = { | |||
| 326 | 319 | ||
| 327 | static struct i2c_driver ds1307_driver; | 320 | static struct i2c_driver ds1307_driver; |
| 328 | 321 | ||
| 329 | static int __devinit ds1307_probe(struct i2c_client *client) | 322 | static int __devinit ds1307_probe(struct i2c_client *client, |
| 323 | const struct i2c_device_id *id) | ||
| 330 | { | 324 | { |
| 331 | struct ds1307 *ds1307; | 325 | struct ds1307 *ds1307; |
| 332 | int err = -ENODEV; | 326 | int err = -ENODEV; |
| 333 | int tmp; | 327 | int tmp; |
| 334 | const struct chip_desc *chip; | 328 | const struct chip_desc *chip = &chips[id->driver_data]; |
| 335 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | 329 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
| 336 | 330 | ||
| 337 | chip = find_chip(client->name); | ||
| 338 | if (!chip) { | ||
| 339 | dev_err(&client->dev, "unknown chip type '%s'\n", | ||
| 340 | client->name); | ||
| 341 | return -ENODEV; | ||
| 342 | } | ||
| 343 | |||
| 344 | if (!i2c_check_functionality(adapter, | 331 | if (!i2c_check_functionality(adapter, |
| 345 | I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) | 332 | I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) |
| 346 | return -EIO; | 333 | return -EIO; |
| @@ -361,7 +348,7 @@ static int __devinit ds1307_probe(struct i2c_client *client) | |||
| 361 | ds1307->msg[1].len = sizeof(ds1307->regs); | 348 | ds1307->msg[1].len = sizeof(ds1307->regs); |
| 362 | ds1307->msg[1].buf = ds1307->regs; | 349 | ds1307->msg[1].buf = ds1307->regs; |
| 363 | 350 | ||
| 364 | ds1307->type = chip->type; | 351 | ds1307->type = id->driver_data; |
| 365 | 352 | ||
| 366 | switch (ds1307->type) { | 353 | switch (ds1307->type) { |
| 367 | case ds_1337: | 354 | case ds_1337: |
| @@ -550,6 +537,7 @@ static struct i2c_driver ds1307_driver = { | |||
| 550 | }, | 537 | }, |
| 551 | .probe = ds1307_probe, | 538 | .probe = ds1307_probe, |
| 552 | .remove = __devexit_p(ds1307_remove), | 539 | .remove = __devexit_p(ds1307_remove), |
| 540 | .id_table = ds1307_id, | ||
| 553 | }; | 541 | }; |
| 554 | 542 | ||
| 555 | static int __init ds1307_init(void) | 543 | static int __init ds1307_init(void) |
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 45bda186befc..fa2d2f8b3f4d 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
| @@ -41,6 +41,12 @@ | |||
| 41 | #define DS1374_REG_SR_AF 0x01 /* Alarm Flag */ | 41 | #define DS1374_REG_SR_AF 0x01 /* Alarm Flag */ |
| 42 | #define DS1374_REG_TCR 0x09 /* Trickle Charge */ | 42 | #define DS1374_REG_TCR 0x09 /* Trickle Charge */ |
| 43 | 43 | ||
| 44 | static const struct i2c_device_id ds1374_id[] = { | ||
| 45 | { "rtc-ds1374", 0 }, | ||
| 46 | { } | ||
| 47 | }; | ||
| 48 | MODULE_DEVICE_TABLE(i2c, ds1374_id); | ||
| 49 | |||
| 44 | struct ds1374 { | 50 | struct ds1374 { |
| 45 | struct i2c_client *client; | 51 | struct i2c_client *client; |
| 46 | struct rtc_device *rtc; | 52 | struct rtc_device *rtc; |
| @@ -355,7 +361,8 @@ static const struct rtc_class_ops ds1374_rtc_ops = { | |||
| 355 | .ioctl = ds1374_ioctl, | 361 | .ioctl = ds1374_ioctl, |
| 356 | }; | 362 | }; |
| 357 | 363 | ||
| 358 | static int ds1374_probe(struct i2c_client *client) | 364 | static int ds1374_probe(struct i2c_client *client, |
| 365 | const struct i2c_device_id *id) | ||
| 359 | { | 366 | { |
| 360 | struct ds1374 *ds1374; | 367 | struct ds1374 *ds1374; |
| 361 | int ret; | 368 | int ret; |
| @@ -429,6 +436,7 @@ static struct i2c_driver ds1374_driver = { | |||
| 429 | }, | 436 | }, |
| 430 | .probe = ds1374_probe, | 437 | .probe = ds1374_probe, |
| 431 | .remove = __devexit_p(ds1374_remove), | 438 | .remove = __devexit_p(ds1374_remove), |
| 439 | .id_table = ds1374_id, | ||
| 432 | }; | 440 | }; |
| 433 | 441 | ||
| 434 | static int __init ds1374_init(void) | 442 | static int __init ds1374_init(void) |
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index fb15e3fb4ce2..fbb90b1e4098 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c | |||
| @@ -490,7 +490,7 @@ isl1208_sysfs_unregister(struct device *dev) | |||
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | static int | 492 | static int |
| 493 | isl1208_probe(struct i2c_client *client) | 493 | isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) |
| 494 | { | 494 | { |
| 495 | int rc = 0; | 495 | int rc = 0; |
| 496 | struct rtc_device *rtc; | 496 | struct rtc_device *rtc; |
| @@ -545,12 +545,19 @@ isl1208_remove(struct i2c_client *client) | |||
| 545 | return 0; | 545 | return 0; |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | static const struct i2c_device_id isl1208_id[] = { | ||
| 549 | { "isl1208", 0 }, | ||
| 550 | { } | ||
| 551 | }; | ||
| 552 | MODULE_DEVICE_TABLE(i2c, isl1208_id); | ||
| 553 | |||
| 548 | static struct i2c_driver isl1208_driver = { | 554 | static struct i2c_driver isl1208_driver = { |
| 549 | .driver = { | 555 | .driver = { |
| 550 | .name = "rtc-isl1208", | 556 | .name = "rtc-isl1208", |
| 551 | }, | 557 | }, |
| 552 | .probe = isl1208_probe, | 558 | .probe = isl1208_probe, |
| 553 | .remove = isl1208_remove, | 559 | .remove = isl1208_remove, |
| 560 | .id_table = isl1208_id, | ||
| 554 | }; | 561 | }; |
| 555 | 562 | ||
| 556 | static int __init | 563 | static int __init |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 1cb33cac1237..316bfaa80872 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
| @@ -60,48 +60,21 @@ | |||
| 60 | 60 | ||
| 61 | #define DRV_VERSION "0.05" | 61 | #define DRV_VERSION "0.05" |
| 62 | 62 | ||
| 63 | struct m41t80_chip_info { | 63 | static const struct i2c_device_id m41t80_id[] = { |
| 64 | const char *name; | 64 | { "m41t80", 0 }, |
| 65 | u8 features; | 65 | { "m41t81", M41T80_FEATURE_HT }, |
| 66 | }; | 66 | { "m41t81s", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, |
| 67 | 67 | { "m41t82", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, | |
| 68 | static const struct m41t80_chip_info m41t80_chip_info_tbl[] = { | 68 | { "m41t83", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, |
| 69 | { | 69 | { "m41st84", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, |
| 70 | .name = "m41t80", | 70 | { "m41st85", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, |
| 71 | .features = 0, | 71 | { "m41st87", M41T80_FEATURE_HT | M41T80_FEATURE_BL }, |
| 72 | }, | 72 | { } |
| 73 | { | ||
| 74 | .name = "m41t81", | ||
| 75 | .features = M41T80_FEATURE_HT, | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | .name = "m41t81s", | ||
| 79 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 80 | }, | ||
| 81 | { | ||
| 82 | .name = "m41t82", | ||
| 83 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 84 | }, | ||
| 85 | { | ||
| 86 | .name = "m41t83", | ||
| 87 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 88 | }, | ||
| 89 | { | ||
| 90 | .name = "m41st84", | ||
| 91 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 92 | }, | ||
| 93 | { | ||
| 94 | .name = "m41st85", | ||
| 95 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 96 | }, | ||
| 97 | { | ||
| 98 | .name = "m41st87", | ||
| 99 | .features = M41T80_FEATURE_HT | M41T80_FEATURE_BL, | ||
| 100 | }, | ||
| 101 | }; | 73 | }; |
| 74 | MODULE_DEVICE_TABLE(i2c, m41t80_id); | ||
| 102 | 75 | ||
| 103 | struct m41t80_data { | 76 | struct m41t80_data { |
| 104 | const struct m41t80_chip_info *chip; | 77 | u8 features; |
| 105 | struct rtc_device *rtc; | 78 | struct rtc_device *rtc; |
| 106 | }; | 79 | }; |
| 107 | 80 | ||
| @@ -208,7 +181,7 @@ static int m41t80_rtc_proc(struct device *dev, struct seq_file *seq) | |||
| 208 | struct m41t80_data *clientdata = i2c_get_clientdata(client); | 181 | struct m41t80_data *clientdata = i2c_get_clientdata(client); |
| 209 | u8 reg; | 182 | u8 reg; |
| 210 | 183 | ||
| 211 | if (clientdata->chip->features & M41T80_FEATURE_BL) { | 184 | if (clientdata->features & M41T80_FEATURE_BL) { |
| 212 | reg = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); | 185 | reg = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); |
| 213 | seq_printf(seq, "battery\t\t: %s\n", | 186 | seq_printf(seq, "battery\t\t: %s\n", |
| 214 | (reg & M41T80_FLAGS_BATT_LOW) ? "exhausted" : "ok"); | 187 | (reg & M41T80_FLAGS_BATT_LOW) ? "exhausted" : "ok"); |
| @@ -756,12 +729,12 @@ static struct notifier_block wdt_notifier = { | |||
| 756 | * | 729 | * |
| 757 | ***************************************************************************** | 730 | ***************************************************************************** |
| 758 | */ | 731 | */ |
| 759 | static int m41t80_probe(struct i2c_client *client) | 732 | static int m41t80_probe(struct i2c_client *client, |
| 733 | const struct i2c_device_id *id) | ||
| 760 | { | 734 | { |
| 761 | int i, rc = 0; | 735 | int rc = 0; |
| 762 | struct rtc_device *rtc = NULL; | 736 | struct rtc_device *rtc = NULL; |
| 763 | struct rtc_time tm; | 737 | struct rtc_time tm; |
| 764 | const struct m41t80_chip_info *chip; | ||
| 765 | struct m41t80_data *clientdata = NULL; | 738 | struct m41t80_data *clientdata = NULL; |
| 766 | 739 | ||
| 767 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | 740 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
| @@ -773,19 +746,6 @@ static int m41t80_probe(struct i2c_client *client) | |||
| 773 | dev_info(&client->dev, | 746 | dev_info(&client->dev, |
| 774 | "chip found, driver version " DRV_VERSION "\n"); | 747 | "chip found, driver version " DRV_VERSION "\n"); |
| 775 | 748 | ||
| 776 | chip = NULL; | ||
| 777 | for (i = 0; i < ARRAY_SIZE(m41t80_chip_info_tbl); i++) { | ||
| 778 | if (!strcmp(m41t80_chip_info_tbl[i].name, client->name)) { | ||
| 779 | chip = &m41t80_chip_info_tbl[i]; | ||
| 780 | break; | ||
| 781 | } | ||
| 782 | } | ||
| 783 | if (!chip) { | ||
| 784 | dev_err(&client->dev, "%s is not supported\n", client->name); | ||
| 785 | rc = -ENODEV; | ||
| 786 | goto exit; | ||
| 787 | } | ||
| 788 | |||
| 789 | clientdata = kzalloc(sizeof(*clientdata), GFP_KERNEL); | 749 | clientdata = kzalloc(sizeof(*clientdata), GFP_KERNEL); |
| 790 | if (!clientdata) { | 750 | if (!clientdata) { |
| 791 | rc = -ENOMEM; | 751 | rc = -ENOMEM; |
| @@ -801,7 +761,7 @@ static int m41t80_probe(struct i2c_client *client) | |||
| 801 | } | 761 | } |
| 802 | 762 | ||
| 803 | clientdata->rtc = rtc; | 763 | clientdata->rtc = rtc; |
| 804 | clientdata->chip = chip; | 764 | clientdata->features = id->driver_data; |
| 805 | i2c_set_clientdata(client, clientdata); | 765 | i2c_set_clientdata(client, clientdata); |
| 806 | 766 | ||
| 807 | /* Make sure HT (Halt Update) bit is cleared */ | 767 | /* Make sure HT (Halt Update) bit is cleared */ |
| @@ -810,7 +770,7 @@ static int m41t80_probe(struct i2c_client *client) | |||
| 810 | goto ht_err; | 770 | goto ht_err; |
| 811 | 771 | ||
| 812 | if (rc & M41T80_ALHOUR_HT) { | 772 | if (rc & M41T80_ALHOUR_HT) { |
| 813 | if (chip->features & M41T80_FEATURE_HT) { | 773 | if (clientdata->features & M41T80_FEATURE_HT) { |
| 814 | m41t80_get_datetime(client, &tm); | 774 | m41t80_get_datetime(client, &tm); |
| 815 | dev_info(&client->dev, "HT bit was set!\n"); | 775 | dev_info(&client->dev, "HT bit was set!\n"); |
| 816 | dev_info(&client->dev, | 776 | dev_info(&client->dev, |
| @@ -842,7 +802,7 @@ static int m41t80_probe(struct i2c_client *client) | |||
| 842 | goto exit; | 802 | goto exit; |
| 843 | 803 | ||
| 844 | #ifdef CONFIG_RTC_DRV_M41T80_WDT | 804 | #ifdef CONFIG_RTC_DRV_M41T80_WDT |
| 845 | if (chip->features & M41T80_FEATURE_HT) { | 805 | if (clientdata->features & M41T80_FEATURE_HT) { |
| 846 | rc = misc_register(&wdt_dev); | 806 | rc = misc_register(&wdt_dev); |
| 847 | if (rc) | 807 | if (rc) |
| 848 | goto exit; | 808 | goto exit; |
| @@ -878,7 +838,7 @@ static int m41t80_remove(struct i2c_client *client) | |||
| 878 | struct rtc_device *rtc = clientdata->rtc; | 838 | struct rtc_device *rtc = clientdata->rtc; |
| 879 | 839 | ||
| 880 | #ifdef CONFIG_RTC_DRV_M41T80_WDT | 840 | #ifdef CONFIG_RTC_DRV_M41T80_WDT |
| 881 | if (clientdata->chip->features & M41T80_FEATURE_HT) { | 841 | if (clientdata->features & M41T80_FEATURE_HT) { |
| 882 | misc_deregister(&wdt_dev); | 842 | misc_deregister(&wdt_dev); |
| 883 | unregister_reboot_notifier(&wdt_notifier); | 843 | unregister_reboot_notifier(&wdt_notifier); |
| 884 | } | 844 | } |
| @@ -896,6 +856,7 @@ static struct i2c_driver m41t80_driver = { | |||
| 896 | }, | 856 | }, |
| 897 | .probe = m41t80_probe, | 857 | .probe = m41t80_probe, |
| 898 | .remove = m41t80_remove, | 858 | .remove = m41t80_remove, |
| 859 | .id_table = m41t80_id, | ||
| 899 | }; | 860 | }; |
| 900 | 861 | ||
| 901 | static int __init m41t80_rtc_init(void) | 862 | static int __init m41t80_rtc_init(void) |
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index a41681d26eba..0fc4c3630780 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c | |||
| @@ -246,7 +246,8 @@ static const struct rtc_class_ops pcf8563_rtc_ops = { | |||
| 246 | .set_time = pcf8563_rtc_set_time, | 246 | .set_time = pcf8563_rtc_set_time, |
| 247 | }; | 247 | }; |
| 248 | 248 | ||
| 249 | static int pcf8563_probe(struct i2c_client *client) | 249 | static int pcf8563_probe(struct i2c_client *client, |
| 250 | const struct i2c_device_id *id) | ||
| 250 | { | 251 | { |
| 251 | struct pcf8563 *pcf8563; | 252 | struct pcf8563 *pcf8563; |
| 252 | 253 | ||
| @@ -299,12 +300,19 @@ static int pcf8563_remove(struct i2c_client *client) | |||
| 299 | return 0; | 300 | return 0; |
| 300 | } | 301 | } |
| 301 | 302 | ||
| 303 | static const struct i2c_device_id pcf8563_id[] = { | ||
| 304 | { "pcf8563", 0 }, | ||
| 305 | { } | ||
| 306 | }; | ||
| 307 | MODULE_DEVICE_TABLE(i2c, pcf8563_id); | ||
| 308 | |||
| 302 | static struct i2c_driver pcf8563_driver = { | 309 | static struct i2c_driver pcf8563_driver = { |
| 303 | .driver = { | 310 | .driver = { |
| 304 | .name = "rtc-pcf8563", | 311 | .name = "rtc-pcf8563", |
| 305 | }, | 312 | }, |
| 306 | .probe = pcf8563_probe, | 313 | .probe = pcf8563_probe, |
| 307 | .remove = pcf8563_remove, | 314 | .remove = pcf8563_remove, |
| 315 | .id_table = pcf8563_id, | ||
| 308 | }; | 316 | }; |
| 309 | 317 | ||
| 310 | static int __init pcf8563_init(void) | 318 | static int __init pcf8563_init(void) |
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index 7e63074708eb..56caf6b2c3e5 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c | |||
| @@ -69,6 +69,15 @@ enum rtc_type { | |||
| 69 | rtc_rv5c387a, | 69 | rtc_rv5c387a, |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | static const struct i2c_device_id rs5c372_id[] = { | ||
| 73 | { "rs5c372a", rtc_rs5c372a }, | ||
| 74 | { "rs5c372b", rtc_rs5c372b }, | ||
| 75 | { "rv5c386", rtc_rv5c386 }, | ||
| 76 | { "rv5c387a", rtc_rv5c387a }, | ||
| 77 | { } | ||
| 78 | }; | ||
| 79 | MODULE_DEVICE_TABLE(i2c, rs5c372_id); | ||
| 80 | |||
| 72 | /* REVISIT: this assumes that: | 81 | /* REVISIT: this assumes that: |
| 73 | * - we're in the 21st century, so it's safe to ignore the century | 82 | * - we're in the 21st century, so it's safe to ignore the century |
| 74 | * bit for rv5c38[67] (REG_MONTH bit 7); | 83 | * bit for rv5c38[67] (REG_MONTH bit 7); |
| @@ -494,7 +503,8 @@ static void rs5c_sysfs_unregister(struct device *dev) | |||
| 494 | 503 | ||
| 495 | static struct i2c_driver rs5c372_driver; | 504 | static struct i2c_driver rs5c372_driver; |
| 496 | 505 | ||
| 497 | static int rs5c372_probe(struct i2c_client *client) | 506 | static int rs5c372_probe(struct i2c_client *client, |
| 507 | const struct i2c_device_id *id) | ||
| 498 | { | 508 | { |
| 499 | int err = 0; | 509 | int err = 0; |
| 500 | struct rs5c372 *rs5c372; | 510 | struct rs5c372 *rs5c372; |
| @@ -514,6 +524,7 @@ static int rs5c372_probe(struct i2c_client *client) | |||
| 514 | 524 | ||
| 515 | rs5c372->client = client; | 525 | rs5c372->client = client; |
| 516 | i2c_set_clientdata(client, rs5c372); | 526 | i2c_set_clientdata(client, rs5c372); |
| 527 | rs5c372->type = id->driver_data; | ||
| 517 | 528 | ||
| 518 | /* we read registers 0x0f then 0x00-0x0f; skip the first one */ | 529 | /* we read registers 0x0f then 0x00-0x0f; skip the first one */ |
| 519 | rs5c372->regs = &rs5c372->buf[1]; | 530 | rs5c372->regs = &rs5c372->buf[1]; |
| @@ -522,19 +533,6 @@ static int rs5c372_probe(struct i2c_client *client) | |||
| 522 | if (err < 0) | 533 | if (err < 0) |
| 523 | goto exit_kfree; | 534 | goto exit_kfree; |
| 524 | 535 | ||
| 525 | if (strcmp(client->name, "rs5c372a") == 0) | ||
| 526 | rs5c372->type = rtc_rs5c372a; | ||
| 527 | else if (strcmp(client->name, "rs5c372b") == 0) | ||
| 528 | rs5c372->type = rtc_rs5c372b; | ||
| 529 | else if (strcmp(client->name, "rv5c386") == 0) | ||
| 530 | rs5c372->type = rtc_rv5c386; | ||
| 531 | else if (strcmp(client->name, "rv5c387a") == 0) | ||
| 532 | rs5c372->type = rtc_rv5c387a; | ||
| 533 | else { | ||
| 534 | rs5c372->type = rtc_rs5c372b; | ||
| 535 | dev_warn(&client->dev, "assuming rs5c372b\n"); | ||
| 536 | } | ||
| 537 | |||
| 538 | /* clock may be set for am/pm or 24 hr time */ | 536 | /* clock may be set for am/pm or 24 hr time */ |
| 539 | switch (rs5c372->type) { | 537 | switch (rs5c372->type) { |
| 540 | case rtc_rs5c372a: | 538 | case rtc_rs5c372a: |
| @@ -651,6 +649,7 @@ static struct i2c_driver rs5c372_driver = { | |||
| 651 | }, | 649 | }, |
| 652 | .probe = rs5c372_probe, | 650 | .probe = rs5c372_probe, |
| 653 | .remove = rs5c372_remove, | 651 | .remove = rs5c372_remove, |
| 652 | .id_table = rs5c372_id, | ||
| 654 | }; | 653 | }; |
| 655 | 654 | ||
| 656 | static __init int rs5c372_init(void) | 655 | static __init int rs5c372_init(void) |
diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c index e8abc90c32c5..29f47bacfc77 100644 --- a/drivers/rtc/rtc-s35390a.c +++ b/drivers/rtc/rtc-s35390a.c | |||
| @@ -34,6 +34,12 @@ | |||
| 34 | #define S35390A_FLAG_RESET 0x80 | 34 | #define S35390A_FLAG_RESET 0x80 |
| 35 | #define S35390A_FLAG_TEST 0x01 | 35 | #define S35390A_FLAG_TEST 0x01 |
| 36 | 36 | ||
| 37 | static const struct i2c_device_id s35390a_id[] = { | ||
| 38 | { "s35390a", 0 }, | ||
| 39 | { } | ||
| 40 | }; | ||
| 41 | MODULE_DEVICE_TABLE(i2c, s35390a_id); | ||
| 42 | |||
| 37 | struct s35390a { | 43 | struct s35390a { |
| 38 | struct i2c_client *client[8]; | 44 | struct i2c_client *client[8]; |
| 39 | struct rtc_device *rtc; | 45 | struct rtc_device *rtc; |
| @@ -195,7 +201,8 @@ static const struct rtc_class_ops s35390a_rtc_ops = { | |||
| 195 | 201 | ||
| 196 | static struct i2c_driver s35390a_driver; | 202 | static struct i2c_driver s35390a_driver; |
| 197 | 203 | ||
| 198 | static int s35390a_probe(struct i2c_client *client) | 204 | static int s35390a_probe(struct i2c_client *client, |
| 205 | const struct i2c_device_id *id) | ||
| 199 | { | 206 | { |
| 200 | int err; | 207 | int err; |
| 201 | unsigned int i; | 208 | unsigned int i; |
| @@ -296,6 +303,7 @@ static struct i2c_driver s35390a_driver = { | |||
| 296 | }, | 303 | }, |
| 297 | .probe = s35390a_probe, | 304 | .probe = s35390a_probe, |
| 298 | .remove = s35390a_remove, | 305 | .remove = s35390a_remove, |
| 306 | .id_table = s35390a_id, | ||
| 299 | }; | 307 | }; |
| 300 | 308 | ||
| 301 | static int __init s35390a_rtc_init(void) | 309 | static int __init s35390a_rtc_init(void) |
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index 095282f63523..eaf55945f21b 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c | |||
| @@ -494,7 +494,8 @@ static void x1205_sysfs_unregister(struct device *dev) | |||
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | 496 | ||
| 497 | static int x1205_probe(struct i2c_client *client) | 497 | static int x1205_probe(struct i2c_client *client, |
| 498 | const struct i2c_device_id *id) | ||
| 498 | { | 499 | { |
| 499 | int err = 0; | 500 | int err = 0; |
| 500 | unsigned char sr; | 501 | unsigned char sr; |
| @@ -552,12 +553,19 @@ static int x1205_remove(struct i2c_client *client) | |||
| 552 | return 0; | 553 | return 0; |
| 553 | } | 554 | } |
| 554 | 555 | ||
| 556 | static const struct i2c_device_id x1205_id[] = { | ||
| 557 | { "x1205", 0 }, | ||
| 558 | { } | ||
| 559 | }; | ||
| 560 | MODULE_DEVICE_TABLE(i2c, x1205_id); | ||
| 561 | |||
| 555 | static struct i2c_driver x1205_driver = { | 562 | static struct i2c_driver x1205_driver = { |
| 556 | .driver = { | 563 | .driver = { |
| 557 | .name = "rtc-x1205", | 564 | .name = "rtc-x1205", |
| 558 | }, | 565 | }, |
| 559 | .probe = x1205_probe, | 566 | .probe = x1205_probe, |
| 560 | .remove = x1205_remove, | 567 | .remove = x1205_remove, |
| 568 | .id_table = x1205_id, | ||
| 561 | }; | 569 | }; |
| 562 | 570 | ||
| 563 | static int __init x1205_init(void) | 571 | static int __init x1205_init(void) |
