aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-i801.c10
-rw-r--r--drivers/i2c/busses/i2c-pca-isa.c7
-rw-r--r--drivers/i2c/busses/i2c-pmcmsp.c4
-rw-r--r--drivers/i2c/busses/i2c-pxa.c25
5 files changed, 33 insertions, 15 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index b61f56b6f31..476b0bb72d6 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -177,6 +177,8 @@ config I2C_I801
177 ESB2 177 ESB2
178 ICH8 178 ICH8
179 ICH9 179 ICH9
180 Tolapai
181 ICH10
180 182
181 This driver can also be built as a module. If so, the module 183 This driver can also be built as a module. If so, the module
182 will be called i2c-i801. 184 will be called i2c-i801.
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index aa9157913b9..b0f771fe432 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -40,7 +40,9 @@
40 82801G (ICH7) 0x27da 32 hard yes yes yes 40 82801G (ICH7) 0x27da 32 hard yes yes yes
41 82801H (ICH8) 0x283e 32 hard yes yes yes 41 82801H (ICH8) 0x283e 32 hard yes yes yes
42 82801I (ICH9) 0x2930 32 hard yes yes yes 42 82801I (ICH9) 0x2930 32 hard yes yes yes
43 Tolapai 0x5032 32 hard yes ? ? 43 Tolapai 0x5032 32 hard yes yes yes
44 ICH10 0x3a30 32 hard yes yes yes
45 ICH10 0x3a60 32 hard yes yes yes
44 46
45 Features supported by this driver: 47 Features supported by this driver:
46 Software PEC no 48 Software PEC no
@@ -588,6 +590,8 @@ static struct pci_device_id i801_ids[] = {
588 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) }, 590 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) },
589 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_6) }, 591 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_6) },
590 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) }, 592 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TOLAPAI_1) },
593 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) },
594 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) },
591 { 0, } 595 { 0, }
592}; 596};
593 597
@@ -608,10 +612,12 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
608 case PCI_DEVICE_ID_INTEL_ESB2_17: 612 case PCI_DEVICE_ID_INTEL_ESB2_17:
609 case PCI_DEVICE_ID_INTEL_ICH8_5: 613 case PCI_DEVICE_ID_INTEL_ICH8_5:
610 case PCI_DEVICE_ID_INTEL_ICH9_6: 614 case PCI_DEVICE_ID_INTEL_ICH9_6:
615 case PCI_DEVICE_ID_INTEL_TOLAPAI_1:
616 case PCI_DEVICE_ID_INTEL_ICH10_4:
617 case PCI_DEVICE_ID_INTEL_ICH10_5:
611 i801_features |= FEATURE_I2C_BLOCK_READ; 618 i801_features |= FEATURE_I2C_BLOCK_READ;
612 /* fall through */ 619 /* fall through */
613 case PCI_DEVICE_ID_INTEL_82801DB_3: 620 case PCI_DEVICE_ID_INTEL_82801DB_3:
614 case PCI_DEVICE_ID_INTEL_TOLAPAI_1:
615 i801_features |= FEATURE_SMBUS_PEC; 621 i801_features |= FEATURE_SMBUS_PEC;
616 i801_features |= FEATURE_BLOCK_BUFFER; 622 i801_features |= FEATURE_BLOCK_BUFFER;
617 break; 623 break;
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c
index 5161aaf9341..496ee875eb4 100644
--- a/drivers/i2c/busses/i2c-pca-isa.c
+++ b/drivers/i2c/busses/i2c-pca-isa.c
@@ -125,6 +125,13 @@ static int __devinit pca_isa_probe(struct device *dev, unsigned int id)
125 125
126 dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq); 126 dev_info(dev, "i/o base %#08lx. irq %d\n", base, irq);
127 127
128#ifdef CONFIG_PPC_MERGE
129 if (check_legacy_ioport(base)) {
130 dev_err(dev, "I/O address %#08lx is not available\n", base);
131 goto out;
132 }
133#endif
134
128 if (!request_region(base, IO_SIZE, "i2c-pca-isa")) { 135 if (!request_region(base, IO_SIZE, "i2c-pca-isa")) {
129 dev_err(dev, "I/O address %#08lx is in use\n", base); 136 dev_err(dev, "I/O address %#08lx is in use\n", base);
130 goto out; 137 goto out;
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
index be99c02ecac..b03af5653c6 100644
--- a/drivers/i2c/busses/i2c-pmcmsp.c
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -122,7 +122,7 @@ struct pmcmsptwi_data {
122}; 122};
123 123
124/* The default settings */ 124/* The default settings */
125const static struct pmcmsptwi_clockcfg pmcmsptwi_defclockcfg = { 125static const struct pmcmsptwi_clockcfg pmcmsptwi_defclockcfg = {
126 .standard = { 126 .standard = {
127 .filter = 0x3, 127 .filter = 0x3,
128 .clock = 0x1f, 128 .clock = 0x1f,
@@ -133,7 +133,7 @@ const static struct pmcmsptwi_clockcfg pmcmsptwi_defclockcfg = {
133 }, 133 },
134}; 134};
135 135
136const static struct pmcmsptwi_cfg pmcmsptwi_defcfg = { 136static const struct pmcmsptwi_cfg pmcmsptwi_defcfg = {
137 .arbf = 0x03, 137 .arbf = 0x03,
138 .nak = 0x03, 138 .nak = 0x03,
139 .add10 = 0x00, 139 .add10 = 0x00,
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 2b557bfd7f7..2d2087ad708 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -999,7 +999,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
999 spin_lock_init(&i2c->lock); 999 spin_lock_init(&i2c->lock);
1000 init_waitqueue_head(&i2c->wait); 1000 init_waitqueue_head(&i2c->wait);
1001 1001
1002 sprintf(i2c->adap.name, "pxa_i2c-i2c.%u", dev->id); 1002 /*
1003 * If "dev->id" is negative we consider it as zero.
1004 * The reason to do so is to avoid sysfs names that only make
1005 * sense when there are multiple adapters.
1006 */
1007 i2c->adap.nr = dev->id != -1 ? dev->id : 0;
1008 snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
1009 i2c->adap.nr);
1003 1010
1004 i2c->clk = clk_get(&dev->dev, "I2CCLK"); 1011 i2c->clk = clk_get(&dev->dev, "I2CCLK");
1005 if (IS_ERR(i2c->clk)) { 1012 if (IS_ERR(i2c->clk)) {
@@ -1050,13 +1057,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
1050 i2c->adap.algo_data = i2c; 1057 i2c->adap.algo_data = i2c;
1051 i2c->adap.dev.parent = &dev->dev; 1058 i2c->adap.dev.parent = &dev->dev;
1052 1059
1053 /*
1054 * If "dev->id" is negative we consider it as zero.
1055 * The reason to do so is to avoid sysfs names that only make
1056 * sense when there are multiple adapters.
1057 */
1058 i2c->adap.nr = dev->id != -1 ? dev->id : 0;
1059
1060 ret = i2c_add_numbered_adapter(&i2c->adap); 1060 ret = i2c_add_numbered_adapter(&i2c->adap);
1061 if (ret < 0) { 1061 if (ret < 0) {
1062 printk(KERN_INFO "I2C: Failed to add bus\n"); 1062 printk(KERN_INFO "I2C: Failed to add bus\n");
@@ -1080,6 +1080,7 @@ eadapt:
1080ereqirq: 1080ereqirq:
1081 clk_disable(i2c->clk); 1081 clk_disable(i2c->clk);
1082 i2c_pxa_disable(dev); 1082 i2c_pxa_disable(dev);
1083 iounmap(i2c->reg_base);
1083eremap: 1084eremap:
1084 clk_put(i2c->clk); 1085 clk_put(i2c->clk);
1085eclk: 1086eclk:
@@ -1089,7 +1090,7 @@ emalloc:
1089 return ret; 1090 return ret;
1090} 1091}
1091 1092
1092static int i2c_pxa_remove(struct platform_device *dev) 1093static int __exit i2c_pxa_remove(struct platform_device *dev)
1093{ 1094{
1094 struct pxa_i2c *i2c = platform_get_drvdata(dev); 1095 struct pxa_i2c *i2c = platform_get_drvdata(dev);
1095 1096
@@ -1103,6 +1104,7 @@ static int i2c_pxa_remove(struct platform_device *dev)
1103 clk_put(i2c->clk); 1104 clk_put(i2c->clk);
1104 i2c_pxa_disable(dev); 1105 i2c_pxa_disable(dev);
1105 1106
1107 iounmap(i2c->reg_base);
1106 release_mem_region(i2c->iobase, i2c->iosize); 1108 release_mem_region(i2c->iobase, i2c->iosize);
1107 kfree(i2c); 1109 kfree(i2c);
1108 1110
@@ -1111,9 +1113,10 @@ static int i2c_pxa_remove(struct platform_device *dev)
1111 1113
1112static struct platform_driver i2c_pxa_driver = { 1114static struct platform_driver i2c_pxa_driver = {
1113 .probe = i2c_pxa_probe, 1115 .probe = i2c_pxa_probe,
1114 .remove = i2c_pxa_remove, 1116 .remove = __exit_p(i2c_pxa_remove),
1115 .driver = { 1117 .driver = {
1116 .name = "pxa2xx-i2c", 1118 .name = "pxa2xx-i2c",
1119 .owner = THIS_MODULE,
1117 }, 1120 },
1118}; 1121};
1119 1122
@@ -1122,7 +1125,7 @@ static int __init i2c_adap_pxa_init(void)
1122 return platform_driver_register(&i2c_pxa_driver); 1125 return platform_driver_register(&i2c_pxa_driver);
1123} 1126}
1124 1127
1125static void i2c_adap_pxa_exit(void) 1128static void __exit i2c_adap_pxa_exit(void)
1126{ 1129{
1127 platform_driver_unregister(&i2c_pxa_driver); 1130 platform_driver_unregister(&i2c_pxa_driver);
1128} 1131}