diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-ali1563.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd756-s4882.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-at91.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-bfin-twi.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 50 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sh7760.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sh_mobile.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis5595.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis630.c | 4 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 8 |
13 files changed, 71 insertions, 22 deletions
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c index fc3e5b026423..dd9e796fad69 100644 --- a/drivers/i2c/busses/i2c-ali1563.c +++ b/drivers/i2c/busses/i2c-ali1563.c | |||
@@ -399,8 +399,8 @@ static int __devinit ali1563_probe(struct pci_dev * dev, | |||
399 | if ((error = ali1563_setup(dev))) | 399 | if ((error = ali1563_setup(dev))) |
400 | goto exit; | 400 | goto exit; |
401 | ali1563_adapter.dev.parent = &dev->dev; | 401 | ali1563_adapter.dev.parent = &dev->dev; |
402 | sprintf(ali1563_adapter.name,"SMBus ALi 1563 Adapter @ %04x", | 402 | snprintf(ali1563_adapter.name, sizeof(ali1563_adapter.name), |
403 | ali1563_smba); | 403 | "SMBus ALi 1563 Adapter @ %04x", ali1563_smba); |
404 | if ((error = i2c_add_adapter(&ali1563_adapter))) | 404 | if ((error = i2c_add_adapter(&ali1563_adapter))) |
405 | goto exit_shutdown; | 405 | goto exit_shutdown; |
406 | return 0; | 406 | return 0; |
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 8ba2bcf727d3..378fcb5d5783 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c | |||
@@ -197,8 +197,8 @@ static int __init amd756_s4882_init(void) | |||
197 | for (i = 1; i < 5; i++) { | 197 | for (i = 1; i < 5; i++) { |
198 | s4882_algo[i] = *(amd756_smbus.algo); | 198 | s4882_algo[i] = *(amd756_smbus.algo); |
199 | s4882_adapter[i] = amd756_smbus; | 199 | s4882_adapter[i] = amd756_smbus; |
200 | sprintf(s4882_adapter[i].name, | 200 | snprintf(s4882_adapter[i].name, sizeof(s4882_adapter[i].name), |
201 | "SMBus 8111 adapter (CPU%d)", i-1); | 201 | "SMBus 8111 adapter (CPU%d)", i-1); |
202 | s4882_adapter[i].algo = s4882_algo+i; | 202 | s4882_adapter[i].algo = s4882_algo+i; |
203 | s4882_adapter[i].dev.parent = amd756_smbus.dev.parent; | 203 | s4882_adapter[i].dev.parent = amd756_smbus.dev.parent; |
204 | } | 204 | } |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 424dad6f18d8..36bee5b9c952 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -380,8 +380,9 @@ static int __devinit amd756_probe(struct pci_dev *pdev, | |||
380 | /* set up the sysfs linkage to our parent device */ | 380 | /* set up the sysfs linkage to our parent device */ |
381 | amd756_smbus.dev.parent = &pdev->dev; | 381 | amd756_smbus.dev.parent = &pdev->dev; |
382 | 382 | ||
383 | sprintf(amd756_smbus.name, "SMBus %s adapter at %04x", | 383 | snprintf(amd756_smbus.name, sizeof(amd756_smbus.name), |
384 | chipname[id->driver_data], amd756_ioport); | 384 | "SMBus %s adapter at %04x", chipname[id->driver_data], |
385 | amd756_ioport); | ||
385 | 386 | ||
386 | error = i2c_add_adapter(&amd756_smbus); | 387 | error = i2c_add_adapter(&amd756_smbus); |
387 | if (error) { | 388 | if (error) { |
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 9efb02137254..67d9dc5b351b 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c | |||
@@ -222,7 +222,7 @@ static int __devinit at91_i2c_probe(struct platform_device *pdev) | |||
222 | rc = -ENOMEM; | 222 | rc = -ENOMEM; |
223 | goto fail2; | 223 | goto fail2; |
224 | } | 224 | } |
225 | sprintf(adapter->name, "AT91"); | 225 | snprintf(adapter->name, sizeof(adapter->name), "AT91"); |
226 | adapter->algo = &at91_algorithm; | 226 | adapter->algo = &at91_algorithm; |
227 | adapter->class = I2C_CLASS_HWMON; | 227 | adapter->class = I2C_CLASS_HWMON; |
228 | adapter->dev.parent = &pdev->dev; | 228 | adapter->dev.parent = &pdev->dev; |
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 3c855ff2992f..3fd2c417c1e0 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -656,7 +656,7 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev) | |||
656 | strlcpy(p_adap->name, pdev->name, sizeof(p_adap->name)); | 656 | strlcpy(p_adap->name, pdev->name, sizeof(p_adap->name)); |
657 | p_adap->algo = &bfin_twi_algorithm; | 657 | p_adap->algo = &bfin_twi_algorithm; |
658 | p_adap->algo_data = iface; | 658 | p_adap->algo_data = iface; |
659 | p_adap->class = I2C_CLASS_ALL; | 659 | p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; |
660 | p_adap->dev.parent = &pdev->dev; | 660 | p_adap->dev.parent = &pdev->dev; |
661 | 661 | ||
662 | rc = peripheral_request_list(pin_req[pdev->id], "i2c-bfin-twi"); | 662 | rc = peripheral_request_list(pin_req[pdev->id], "i2c-bfin-twi"); |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 5123eb69a971..526625eaa84b 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -64,7 +64,7 @@ | |||
64 | #include <linux/init.h> | 64 | #include <linux/init.h> |
65 | #include <linux/i2c.h> | 65 | #include <linux/i2c.h> |
66 | #include <linux/acpi.h> | 66 | #include <linux/acpi.h> |
67 | #include <asm/io.h> | 67 | #include <linux/io.h> |
68 | 68 | ||
69 | /* I801 SMBus address offsets */ | 69 | /* I801 SMBus address offsets */ |
70 | #define SMBHSTSTS (0 + i801_smba) | 70 | #define SMBHSTSTS (0 + i801_smba) |
@@ -583,6 +583,40 @@ static struct pci_device_id i801_ids[] = { | |||
583 | 583 | ||
584 | MODULE_DEVICE_TABLE (pci, i801_ids); | 584 | MODULE_DEVICE_TABLE (pci, i801_ids); |
585 | 585 | ||
586 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE | ||
587 | static unsigned char apanel_addr; | ||
588 | |||
589 | /* Scan the system ROM for the signature "FJKEYINF" */ | ||
590 | static __init const void __iomem *bios_signature(const void __iomem *bios) | ||
591 | { | ||
592 | ssize_t offset; | ||
593 | const unsigned char signature[] = "FJKEYINF"; | ||
594 | |||
595 | for (offset = 0; offset < 0x10000; offset += 0x10) { | ||
596 | if (check_signature(bios + offset, signature, | ||
597 | sizeof(signature)-1)) | ||
598 | return bios + offset; | ||
599 | } | ||
600 | return NULL; | ||
601 | } | ||
602 | |||
603 | static void __init input_apanel_init(void) | ||
604 | { | ||
605 | void __iomem *bios; | ||
606 | const void __iomem *p; | ||
607 | |||
608 | bios = ioremap(0xF0000, 0x10000); /* Can't fail */ | ||
609 | p = bios_signature(bios); | ||
610 | if (p) { | ||
611 | /* just use the first address */ | ||
612 | apanel_addr = readb(p + 8 + 3) >> 1; | ||
613 | } | ||
614 | iounmap(bios); | ||
615 | } | ||
616 | #else | ||
617 | static void __init input_apanel_init(void) {} | ||
618 | #endif | ||
619 | |||
586 | static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id *id) | 620 | static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id *id) |
587 | { | 621 | { |
588 | unsigned char temp; | 622 | unsigned char temp; |
@@ -667,6 +701,19 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
667 | dev_err(&dev->dev, "Failed to add SMBus adapter\n"); | 701 | dev_err(&dev->dev, "Failed to add SMBus adapter\n"); |
668 | goto exit_release; | 702 | goto exit_release; |
669 | } | 703 | } |
704 | |||
705 | /* Register optional slaves */ | ||
706 | #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE | ||
707 | if (apanel_addr) { | ||
708 | struct i2c_board_info info; | ||
709 | |||
710 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
711 | info.addr = apanel_addr; | ||
712 | strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); | ||
713 | i2c_new_device(&i801_adapter, &info); | ||
714 | } | ||
715 | #endif | ||
716 | |||
670 | return 0; | 717 | return 0; |
671 | 718 | ||
672 | exit_release: | 719 | exit_release: |
@@ -717,6 +764,7 @@ static struct pci_driver i801_driver = { | |||
717 | 764 | ||
718 | static int __init i2c_i801_init(void) | 765 | static int __init i2c_i801_init(void) |
719 | { | 766 | { |
767 | input_apanel_init(); | ||
720 | return pci_register_driver(&i801_driver); | 768 | return pci_register_driver(&i801_driver); |
721 | } | 769 | } |
722 | 770 | ||
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 587f5b2380d4..6af68146c342 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -1076,10 +1076,10 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1076 | 1076 | ||
1077 | #ifdef CONFIG_I2C_PXA_SLAVE | 1077 | #ifdef CONFIG_I2C_PXA_SLAVE |
1078 | printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", | 1078 | printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", |
1079 | i2c->adap.dev.bus_id, i2c->slave_addr); | 1079 | dev_name(&i2c->adap.dev), i2c->slave_addr); |
1080 | #else | 1080 | #else |
1081 | printk(KERN_INFO "I2C: %s: PXA I2C adapter\n", | 1081 | printk(KERN_INFO "I2C: %s: PXA I2C adapter\n", |
1082 | i2c->adap.dev.bus_id); | 1082 | dev_name(&i2c->adap.dev)); |
1083 | #endif | 1083 | #endif |
1084 | return 0; | 1084 | return 0; |
1085 | 1085 | ||
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index f69f91ffb469..5b7f95641ba4 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -906,7 +906,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
906 | 906 | ||
907 | platform_set_drvdata(pdev, i2c); | 907 | platform_set_drvdata(pdev, i2c); |
908 | 908 | ||
909 | dev_info(&pdev->dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id); | 909 | dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev)); |
910 | return 0; | 910 | return 0; |
911 | 911 | ||
912 | err_cpufreq: | 912 | err_cpufreq: |
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index 5e0e254976de..baa28b73ae42 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c | |||
@@ -475,7 +475,7 @@ static int __devinit sh7760_i2c_probe(struct platform_device *pdev) | |||
475 | 475 | ||
476 | id->adap.nr = pdev->id; | 476 | id->adap.nr = pdev->id; |
477 | id->adap.algo = &sh7760_i2c_algo; | 477 | id->adap.algo = &sh7760_i2c_algo; |
478 | id->adap.class = I2C_CLASS_ALL; | 478 | id->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD; |
479 | id->adap.retries = 3; | 479 | id->adap.retries = 3; |
480 | id->adap.algo_data = id; | 480 | id->adap.algo_data = id; |
481 | id->adap.dev.parent = &pdev->dev; | 481 | id->adap.dev.parent = &pdev->dev; |
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 6c3d60b939bf..1c01083b01b5 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -500,7 +500,7 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, int hook) | |||
500 | while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { | 500 | while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { |
501 | for (n = res->start; hook && n <= res->end; n++) { | 501 | for (n = res->start; hook && n <= res->end; n++) { |
502 | if (request_irq(n, sh_mobile_i2c_isr, IRQF_DISABLED, | 502 | if (request_irq(n, sh_mobile_i2c_isr, IRQF_DISABLED, |
503 | dev->dev.bus_id, dev)) | 503 | dev_name(&dev->dev), dev)) |
504 | goto rollback; | 504 | goto rollback; |
505 | } | 505 | } |
506 | k++; | 506 | k++; |
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index dfc2d5eb6a68..8ce2daff985c 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c | |||
@@ -389,8 +389,8 @@ static int __devinit sis5595_probe(struct pci_dev *dev, const struct pci_device_ | |||
389 | /* set up the sysfs linkage to our parent device */ | 389 | /* set up the sysfs linkage to our parent device */ |
390 | sis5595_adapter.dev.parent = &dev->dev; | 390 | sis5595_adapter.dev.parent = &dev->dev; |
391 | 391 | ||
392 | sprintf(sis5595_adapter.name, "SMBus SIS5595 adapter at %04x", | 392 | snprintf(sis5595_adapter.name, sizeof(sis5595_adapter.name), |
393 | sis5595_base + SMB_INDEX); | 393 | "SMBus SIS5595 adapter at %04x", sis5595_base + SMB_INDEX); |
394 | err = i2c_add_adapter(&sis5595_adapter); | 394 | err = i2c_add_adapter(&sis5595_adapter); |
395 | if (err) { | 395 | if (err) { |
396 | release_region(sis5595_base + SMB_INDEX, 2); | 396 | release_region(sis5595_base + SMB_INDEX, 2); |
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index e7c4b790da54..9c9c016ff2b5 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -487,8 +487,8 @@ static int __devinit sis630_probe(struct pci_dev *dev, const struct pci_device_i | |||
487 | /* set up the sysfs linkage to our parent device */ | 487 | /* set up the sysfs linkage to our parent device */ |
488 | sis630_adapter.dev.parent = &dev->dev; | 488 | sis630_adapter.dev.parent = &dev->dev; |
489 | 489 | ||
490 | sprintf(sis630_adapter.name, "SMBus SIS630 adapter at %04x", | 490 | snprintf(sis630_adapter.name, sizeof(sis630_adapter.name), |
491 | acpi_base + SMB_STS); | 491 | "SMBus SIS630 adapter at %04x", acpi_base + SMB_STS); |
492 | 492 | ||
493 | return i2c_add_adapter(&sis630_adapter); | 493 | return i2c_add_adapter(&sis630_adapter); |
494 | } | 494 | } |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index c6a63f46bc15..b1c9abe24c7b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -459,7 +459,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
459 | pr_debug("I2C adapter driver [%s] forgot to specify " | 459 | pr_debug("I2C adapter driver [%s] forgot to specify " |
460 | "physical device\n", adap->name); | 460 | "physical device\n", adap->name); |
461 | } | 461 | } |
462 | sprintf(adap->dev.bus_id, "i2c-%d", adap->nr); | 462 | dev_set_name(&adap->dev, "i2c-%d", adap->nr); |
463 | adap->dev.release = &i2c_adapter_dev_release; | 463 | adap->dev.release = &i2c_adapter_dev_release; |
464 | adap->dev.class = &i2c_adapter_class; | 464 | adap->dev.class = &i2c_adapter_class; |
465 | res = device_register(&adap->dev); | 465 | res = device_register(&adap->dev); |
@@ -845,8 +845,8 @@ int i2c_attach_client(struct i2c_client *client) | |||
845 | } else | 845 | } else |
846 | client->dev.release = i2c_client_dev_release; | 846 | client->dev.release = i2c_client_dev_release; |
847 | 847 | ||
848 | snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), | 848 | dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adapter), |
849 | "%d-%04x", i2c_adapter_id(adapter), client->addr); | 849 | client->addr); |
850 | res = device_register(&client->dev); | 850 | res = device_register(&client->dev); |
851 | if (res) | 851 | if (res) |
852 | goto out_err; | 852 | goto out_err; |
@@ -856,7 +856,7 @@ int i2c_attach_client(struct i2c_client *client) | |||
856 | mutex_unlock(&adapter->clist_lock); | 856 | mutex_unlock(&adapter->clist_lock); |
857 | 857 | ||
858 | dev_dbg(&adapter->dev, "client [%s] registered with bus id %s\n", | 858 | dev_dbg(&adapter->dev, "client [%s] registered with bus id %s\n", |
859 | client->name, client->dev.bus_id); | 859 | client->name, dev_name(&client->dev)); |
860 | 860 | ||
861 | if (adapter->client_register) { | 861 | if (adapter->client_register) { |
862 | if (adapter->client_register(client)) { | 862 | if (adapter->client_register(client)) { |