aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/Kconfig8
-rw-r--r--drivers/i2c/busses/i2c-ali1535.c2
-rw-r--r--drivers/i2c/busses/i2c-ali1563.c2
-rw-r--r--drivers/i2c/busses/i2c-ali15x3.c2
-rw-r--r--drivers/i2c/busses/i2c-amd756.c2
-rw-r--r--drivers/i2c/busses/i2c-amd8111.c2
-rw-r--r--drivers/i2c/busses/i2c-au1550.c2
-rw-r--r--drivers/i2c/busses/i2c-i801.c2
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c4
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c2
-rw-r--r--drivers/i2c/busses/i2c-isa.c161
-rw-r--r--drivers/i2c/busses/i2c-keywest.c15
-rw-r--r--drivers/i2c/busses/i2c-mpc.c4
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c12
-rw-r--r--drivers/i2c/busses/i2c-nforce2.c33
-rw-r--r--drivers/i2c/busses/i2c-piix4.c2
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c1
-rw-r--r--drivers/i2c/busses/i2c-sis5595.c2
-rw-r--r--drivers/i2c/busses/i2c-sis630.c2
-rw-r--r--drivers/i2c/busses/i2c-sis96x.c2
-rw-r--r--drivers/i2c/busses/i2c-stub.c2
-rw-r--r--drivers/i2c/busses/i2c-viapro.c2
-rw-r--r--drivers/i2c/busses/scx200_acb.c4
23 files changed, 161 insertions, 109 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 916ba5e40a96..6e9da1372225 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -182,14 +182,8 @@ config I2C_IOP3XX
182 will be called i2c-iop3xx. 182 will be called i2c-iop3xx.
183 183
184config I2C_ISA 184config I2C_ISA
185 tristate "ISA Bus support" 185 tristate
186 depends on I2C 186 depends on I2C
187 help
188 If you say yes to this option, support will be included for i2c
189 interfaces that are on the ISA bus.
190
191 This driver can also be built as a module. If so, the module
192 will be called i2c-isa.
193 187
194config I2C_ITE 188config I2C_ITE
195 tristate "ITE I2C Adapter" 189 tristate "ITE I2C Adapter"
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
index f634a0780cf0..f021acd2674e 100644
--- a/drivers/i2c/busses/i2c-ali1535.c
+++ b/drivers/i2c/busses/i2c-ali1535.c
@@ -472,8 +472,6 @@ static u32 ali1535_func(struct i2c_adapter *adapter)
472} 472}
473 473
474static struct i2c_algorithm smbus_algorithm = { 474static struct i2c_algorithm smbus_algorithm = {
475 .name = "Non-i2c SMBus adapter",
476 .id = I2C_ALGO_SMBUS,
477 .smbus_xfer = ali1535_access, 475 .smbus_xfer = ali1535_access,
478 .functionality = ali1535_func, 476 .functionality = ali1535_func,
479}; 477};
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c
index fdd881aee618..86947504aea1 100644
--- a/drivers/i2c/busses/i2c-ali1563.c
+++ b/drivers/i2c/busses/i2c-ali1563.c
@@ -366,8 +366,6 @@ static void ali1563_shutdown(struct pci_dev *dev)
366} 366}
367 367
368static struct i2c_algorithm ali1563_algorithm = { 368static struct i2c_algorithm ali1563_algorithm = {
369 .name = "Non-i2c SMBus adapter",
370 .id = I2C_ALGO_SMBUS,
371 .smbus_xfer = ali1563_access, 369 .smbus_xfer = ali1563_access,
372 .functionality = ali1563_func, 370 .functionality = ali1563_func,
373}; 371};
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
index 0f781a1a3323..b3f50bff39a0 100644
--- a/drivers/i2c/busses/i2c-ali15x3.c
+++ b/drivers/i2c/busses/i2c-ali15x3.c
@@ -462,8 +462,6 @@ static u32 ali15x3_func(struct i2c_adapter *adapter)
462} 462}
463 463
464static struct i2c_algorithm smbus_algorithm = { 464static struct i2c_algorithm smbus_algorithm = {
465 .name = "Non-I2C SMBus adapter",
466 .id = I2C_ALGO_SMBUS,
467 .smbus_xfer = ali15x3_access, 465 .smbus_xfer = ali15x3_access,
468 .functionality = ali15x3_func, 466 .functionality = ali15x3_func,
469}; 467};
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index 6347ebc6fb53..6ad0603384b8 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -295,8 +295,6 @@ static u32 amd756_func(struct i2c_adapter *adapter)
295} 295}
296 296
297static struct i2c_algorithm smbus_algorithm = { 297static struct i2c_algorithm smbus_algorithm = {
298 .name = "Non-I2C SMBus adapter",
299 .id = I2C_ALGO_SMBUS,
300 .smbus_xfer = amd756_access, 298 .smbus_xfer = amd756_access,
301 .functionality = amd756_func, 299 .functionality = amd756_func,
302}; 300};
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index d6644481d2a0..45ea24ba14d5 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -323,8 +323,6 @@ static u32 amd8111_func(struct i2c_adapter *adapter)
323} 323}
324 324
325static struct i2c_algorithm smbus_algorithm = { 325static struct i2c_algorithm smbus_algorithm = {
326 .name = "Non-I2C SMBus 2.0 adapter",
327 .id = I2C_ALGO_SMBUS,
328 .smbus_xfer = amd8111_access, 326 .smbus_xfer = amd8111_access,
329 .functionality = amd8111_func, 327 .functionality = amd8111_func,
330}; 328};
diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
index a7ff112e49bf..d06edce03bf4 100644
--- a/drivers/i2c/busses/i2c-au1550.c
+++ b/drivers/i2c/busses/i2c-au1550.c
@@ -283,8 +283,6 @@ au1550_func(struct i2c_adapter *adap)
283} 283}
284 284
285static struct i2c_algorithm au1550_algo = { 285static struct i2c_algorithm au1550_algo = {
286 .name = "Au1550 algorithm",
287 .id = I2C_ALGO_AU1550,
288 .master_xfer = au1550_xfer, 286 .master_xfer = au1550_xfer,
289 .functionality = au1550_func, 287 .functionality = au1550_func,
290}; 288};
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 1ab41313ce51..709beab76609 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -535,8 +535,6 @@ static u32 i801_func(struct i2c_adapter *adapter)
535} 535}
536 536
537static struct i2c_algorithm smbus_algorithm = { 537static struct i2c_algorithm smbus_algorithm = {
538 .name = "Non-I2C SMBus adapter",
539 .id = I2C_ALGO_SMBUS,
540 .smbus_xfer = i801_access, 538 .smbus_xfer = i801_access,
541 .functionality = i801_func, 539 .functionality = i801_func,
542}; 540};
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 93ca36dc777e..a3ed9590f028 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -627,8 +627,6 @@ static u32 iic_func(struct i2c_adapter *adap)
627} 627}
628 628
629static struct i2c_algorithm iic_algo = { 629static struct i2c_algorithm iic_algo = {
630 .name = "IBM IIC algorithm",
631 .id = I2C_ALGO_OCP,
632 .master_xfer = iic_xfer, 630 .master_xfer = iic_xfer,
633 .functionality = iic_func 631 .functionality = iic_func
634}; 632};
@@ -727,7 +725,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){
727 adap = &dev->adap; 725 adap = &dev->adap;
728 strcpy(adap->name, "IBM IIC"); 726 strcpy(adap->name, "IBM IIC");
729 i2c_set_adapdata(adap, dev); 727 i2c_set_adapdata(adap, dev);
730 adap->id = I2C_HW_OCP | iic_algo.id; 728 adap->id = I2C_HW_OCP;
731 adap->algo = &iic_algo; 729 adap->algo = &iic_algo;
732 adap->client_register = NULL; 730 adap->client_register = NULL;
733 adap->client_unregister = NULL; 731 adap->client_unregister = NULL;
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 6b682e903f09..7bd9102db701 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -399,8 +399,6 @@ iop3xx_i2c_func(struct i2c_adapter *adap)
399} 399}
400 400
401static struct i2c_algorithm iop3xx_i2c_algo = { 401static struct i2c_algorithm iop3xx_i2c_algo = {
402 .name = "IOP3xx I2C algorithm",
403 .id = I2C_ALGO_IOP3XX,
404 .master_xfer = iop3xx_i2c_master_xfer, 402 .master_xfer = iop3xx_i2c_master_xfer,
405 .algo_control = iop3xx_i2c_algo_control, 403 .algo_control = iop3xx_i2c_algo_control,
406 .functionality = iop3xx_i2c_func, 404 .functionality = iop3xx_i2c_func,
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index 00e7f7157b75..bdc6806dafae 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -1,6 +1,8 @@
1/* 1/*
2 i2c-isa.c - Part of lm_sensors, Linux kernel modules for hardware 2 i2c-isa.c - an i2c-core-like thing for ISA hardware monitoring chips
3 monitoring 3 Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
4
5 Based on the i2c-isa pseudo-adapter from the lm_sensors project
4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> 6 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
5 7
6 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
@@ -18,30 +20,36 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 21*/
20 22
21/* This implements an i2c algorithm/adapter for ISA bus. Not that this is 23/* This implements an i2c-core-like thing for ISA hardware monitoring
22 on first sight very useful; almost no functionality is preserved. 24 chips. Such chips are linked to the i2c subsystem for historical
23 Except that it makes writing drivers for chips which can be on both 25 reasons (because the early ISA hardware monitoring chips such as the
24 the SMBus and the ISA bus very much easier. See lm78.c for an example 26 LM78 had both an I2C and an ISA interface). They used to be
25 of this. */ 27 registered with the main i2c-core, but as a first step in the
28 direction of a clean separation between I2C and ISA chip drivers,
29 we now have this separate core for ISA ones. It is significantly
30 more simple than the real one, of course, because we don't have to
31 handle multiple busses: there is only one (fake) ISA adapter.
32 It is worth noting that we still rely on i2c-core for some things
33 at the moment - but hopefully this won't last. */
26 34
27#include <linux/init.h> 35#include <linux/init.h>
28#include <linux/module.h> 36#include <linux/module.h>
29#include <linux/kernel.h> 37#include <linux/kernel.h>
30#include <linux/errno.h> 38#include <linux/errno.h>
31#include <linux/i2c.h> 39#include <linux/i2c.h>
40#include <linux/i2c-isa.h>
32 41
33static u32 isa_func(struct i2c_adapter *adapter); 42static u32 isa_func(struct i2c_adapter *adapter);
34 43
35/* This is the actual algorithm we define */ 44/* This is the actual algorithm we define */
36static struct i2c_algorithm isa_algorithm = { 45static struct i2c_algorithm isa_algorithm = {
37 .name = "ISA bus algorithm",
38 .id = I2C_ALGO_ISA,
39 .functionality = isa_func, 46 .functionality = isa_func,
40}; 47};
41 48
42/* There can only be one... */ 49/* There can only be one... */
43static struct i2c_adapter isa_adapter = { 50static struct i2c_adapter isa_adapter = {
44 .owner = THIS_MODULE, 51 .owner = THIS_MODULE,
52 .id = I2C_HW_ISA,
45 .class = I2C_CLASS_HWMON, 53 .class = I2C_CLASS_HWMON,
46 .algo = &isa_algorithm, 54 .algo = &isa_algorithm,
47 .name = "ISA main adapter", 55 .name = "ISA main adapter",
@@ -53,17 +61,146 @@ static u32 isa_func(struct i2c_adapter *adapter)
53 return 0; 61 return 0;
54} 62}
55 63
64
65/* Copied from i2c-core */
66static ssize_t show_adapter_name(struct device *dev,
67 struct device_attribute *attr, char *buf)
68{
69 struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
70 return sprintf(buf, "%s\n", adap->name);
71}
72static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
73
74static int i2c_isa_device_probe(struct device *dev)
75{
76 return -ENODEV;
77}
78
79static int i2c_isa_device_remove(struct device *dev)
80{
81 return 0;
82}
83
84
85/* We implement an interface which resembles i2c_{add,del}_driver,
86 but for i2c-isa drivers. We don't have to remember and handle lists
87 of drivers and adapters so this is much more simple, of course. */
88
89int i2c_isa_add_driver(struct i2c_driver *driver)
90{
91 int res;
92
93 /* Add the driver to the list of i2c drivers in the driver core */
94 driver->driver.name = driver->name;
95 driver->driver.bus = &i2c_bus_type;
96 driver->driver.probe = i2c_isa_device_probe;
97 driver->driver.remove = i2c_isa_device_remove;
98 res = driver_register(&driver->driver);
99 if (res)
100 return res;
101 dev_dbg(&isa_adapter.dev, "Driver %s registered\n", driver->name);
102
103 /* Now look for clients */
104 driver->attach_adapter(&isa_adapter);
105
106 return 0;
107}
108
109int i2c_isa_del_driver(struct i2c_driver *driver)
110{
111 struct list_head *item, *_n;
112 struct i2c_client *client;
113 int res;
114
115 /* Detach all clients belonging to this one driver */
116 list_for_each_safe(item, _n, &isa_adapter.clients) {
117 client = list_entry(item, struct i2c_client, list);
118 if (client->driver != driver)
119 continue;
120 dev_dbg(&isa_adapter.dev, "Detaching client %s at 0x%x\n",
121 client->name, client->addr);
122 if ((res = driver->detach_client(client))) {
123 dev_err(&isa_adapter.dev, "Failed, driver "
124 "%s not unregistered!\n",
125 driver->name);
126 return res;
127 }
128 }
129
130 /* Get the driver off the core list */
131 driver_unregister(&driver->driver);
132 dev_dbg(&isa_adapter.dev, "Driver %s unregistered\n", driver->name);
133
134 return 0;
135}
136
137
56static int __init i2c_isa_init(void) 138static int __init i2c_isa_init(void)
57{ 139{
58 return i2c_add_adapter(&isa_adapter); 140 init_MUTEX(&isa_adapter.clist_lock);
141 INIT_LIST_HEAD(&isa_adapter.clients);
142
143 isa_adapter.nr = ANY_I2C_ISA_BUS;
144 isa_adapter.dev.parent = &platform_bus;
145 sprintf(isa_adapter.dev.bus_id, "i2c-%d", isa_adapter.nr);
146 isa_adapter.dev.driver = &i2c_adapter_driver;
147 isa_adapter.dev.release = &i2c_adapter_dev_release;
148 device_register(&isa_adapter.dev);
149 device_create_file(&isa_adapter.dev, &dev_attr_name);
150
151 /* Add this adapter to the i2c_adapter class */
152 memset(&isa_adapter.class_dev, 0x00, sizeof(struct class_device));
153 isa_adapter.class_dev.dev = &isa_adapter.dev;
154 isa_adapter.class_dev.class = &i2c_adapter_class;
155 strlcpy(isa_adapter.class_dev.class_id, isa_adapter.dev.bus_id,
156 BUS_ID_SIZE);
157 class_device_register(&isa_adapter.class_dev);
158
159 dev_dbg(&isa_adapter.dev, "%s registered\n", isa_adapter.name);
160
161 return 0;
59} 162}
60 163
61static void __exit i2c_isa_exit(void) 164static void __exit i2c_isa_exit(void)
62{ 165{
63 i2c_del_adapter(&isa_adapter); 166#ifdef DEBUG
167 struct list_head *item, *_n;
168 struct i2c_client *client = NULL;
169#endif
170
171 /* There should be no more active client */
172#ifdef DEBUG
173 dev_dbg(&isa_adapter.dev, "Looking for clients\n");
174 list_for_each_safe(item, _n, &isa_adapter.clients) {
175 client = list_entry(item, struct i2c_client, list);
176 dev_err(&isa_adapter.dev, "Driver %s still has an active "
177 "ISA client at 0x%x\n", client->driver->name,
178 client->addr);
179 }
180 if (client != NULL)
181 return;
182#endif
183
184 /* Clean up the sysfs representation */
185 dev_dbg(&isa_adapter.dev, "Unregistering from sysfs\n");
186 init_completion(&isa_adapter.dev_released);
187 init_completion(&isa_adapter.class_dev_released);
188 class_device_unregister(&isa_adapter.class_dev);
189 device_remove_file(&isa_adapter.dev, &dev_attr_name);
190 device_unregister(&isa_adapter.dev);
191
192 /* Wait for sysfs to drop all references */
193 dev_dbg(&isa_adapter.dev, "Waiting for sysfs completion\n");
194 wait_for_completion(&isa_adapter.dev_released);
195 wait_for_completion(&isa_adapter.class_dev_released);
196
197 dev_dbg(&isa_adapter.dev, "%s unregistered\n", isa_adapter.name);
64} 198}
65 199
66MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"); 200EXPORT_SYMBOL(i2c_isa_add_driver);
201EXPORT_SYMBOL(i2c_isa_del_driver);
202
203MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
67MODULE_DESCRIPTION("ISA bus access through i2c"); 204MODULE_DESCRIPTION("ISA bus access through i2c");
68MODULE_LICENSE("GPL"); 205MODULE_LICENSE("GPL");
69 206
diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
index 94ae808314f7..37b49c2daf5f 100644
--- a/drivers/i2c/busses/i2c-keywest.c
+++ b/drivers/i2c/busses/i2c-keywest.c
@@ -87,12 +87,9 @@ static const char *__kw_state_names[] = {
87}; 87};
88#endif /* DEBUG */ 88#endif /* DEBUG */
89 89
90static int probe;
91
92MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 90MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
93MODULE_DESCRIPTION("I2C driver for Apple's Keywest"); 91MODULE_DESCRIPTION("I2C driver for Apple's Keywest");
94MODULE_LICENSE("GPL"); 92MODULE_LICENSE("GPL");
95module_param(probe, bool, 0);
96 93
97#ifdef POLLED_MODE 94#ifdef POLLED_MODE
98/* Don't schedule, the g5 fan controller is too 95/* Don't schedule, the g5 fan controller is too
@@ -498,8 +495,6 @@ keywest_func(struct i2c_adapter * adapter)
498 495
499/* For now, we only handle combined mode (smbus) */ 496/* For now, we only handle combined mode (smbus) */
500static struct i2c_algorithm keywest_algorithm = { 497static struct i2c_algorithm keywest_algorithm = {
501 .name = "Keywest i2c",
502 .id = I2C_ALGO_SMBUS,
503 .smbus_xfer = keywest_smbus_xfer, 498 .smbus_xfer = keywest_smbus_xfer,
504 .master_xfer = keywest_xfer, 499 .master_xfer = keywest_xfer,
505 .functionality = keywest_func, 500 .functionality = keywest_func,
@@ -621,7 +616,6 @@ create_iface(struct device_node *np, struct device *dev)
621 sprintf(chan->adapter.name, "%s %d", np->parent->name, i); 616 sprintf(chan->adapter.name, "%s %d", np->parent->name, i);
622 chan->iface = iface; 617 chan->iface = iface;
623 chan->chan_no = i; 618 chan->chan_no = i;
624 chan->adapter.id = I2C_ALGO_SMBUS;
625 chan->adapter.algo = &keywest_algorithm; 619 chan->adapter.algo = &keywest_algorithm;
626 chan->adapter.algo_data = NULL; 620 chan->adapter.algo_data = NULL;
627 chan->adapter.client_register = NULL; 621 chan->adapter.client_register = NULL;
@@ -635,15 +629,6 @@ create_iface(struct device_node *np, struct device *dev)
635 chan->adapter.name); 629 chan->adapter.name);
636 i2c_set_adapdata(&chan->adapter, NULL); 630 i2c_set_adapdata(&chan->adapter, NULL);
637 } 631 }
638 if (probe) {
639 printk("Probe: ");
640 for (addr = 0x00; addr <= 0x7f; addr++) {
641 if (i2c_smbus_xfer(&chan->adapter,addr,
642 0,0,0,I2C_SMBUS_QUICK,NULL) >= 0)
643 printk("%02x ", addr);
644 }
645 printk("\n");
646 }
647 } 632 }
648 633
649 printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n", 634 printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 9ad3e9262e8a..f065583ddcf1 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -272,8 +272,6 @@ static u32 mpc_functionality(struct i2c_adapter *adap)
272} 272}
273 273
274static struct i2c_algorithm mpc_algo = { 274static struct i2c_algorithm mpc_algo = {
275 .name = "MPC algorithm",
276 .id = I2C_ALGO_MPC107,
277 .master_xfer = mpc_xfer, 275 .master_xfer = mpc_xfer,
278 .functionality = mpc_functionality, 276 .functionality = mpc_functionality,
279}; 277};
@@ -281,7 +279,7 @@ static struct i2c_algorithm mpc_algo = {
281static struct i2c_adapter mpc_ops = { 279static struct i2c_adapter mpc_ops = {
282 .owner = THIS_MODULE, 280 .owner = THIS_MODULE,
283 .name = "MPC adapter", 281 .name = "MPC adapter",
284 .id = I2C_ALGO_MPC107 | I2C_HW_MPC107, 282 .id = I2C_HW_MPC107,
285 .algo = &mpc_algo, 283 .algo = &mpc_algo,
286 .class = I2C_CLASS_HWMON, 284 .class = I2C_CLASS_HWMON,
287 .timeout = 1, 285 .timeout = 1,
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 5b852782d2f5..99abca45fece 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -423,18 +423,16 @@ static int
423mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) 423mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
424{ 424{
425 struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap); 425 struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap);
426 int i, rc = 0; 426 int i, rc;
427 427
428 for (i=0; i<num; i++) 428 for (i=0; i<num; i++)
429 if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) != 0) 429 if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) < 0)
430 break; 430 return rc;
431 431
432 return rc; 432 return num;
433} 433}
434 434
435static struct i2c_algorithm mv64xxx_i2c_algo = { 435static struct i2c_algorithm mv64xxx_i2c_algo = {
436 .name = MV64XXX_I2C_CTLR_NAME " algorithm",
437 .id = I2C_ALGO_MV64XXX,
438 .master_xfer = mv64xxx_i2c_xfer, 436 .master_xfer = mv64xxx_i2c_xfer,
439 .functionality = mv64xxx_i2c_functionality, 437 .functionality = mv64xxx_i2c_functionality,
440}; 438};
@@ -523,7 +521,7 @@ mv64xxx_i2c_probe(struct device *dev)
523 drv_data->freq_m = pdata->freq_m; 521 drv_data->freq_m = pdata->freq_m;
524 drv_data->freq_n = pdata->freq_n; 522 drv_data->freq_n = pdata->freq_n;
525 drv_data->irq = platform_get_irq(pd, 0); 523 drv_data->irq = platform_get_irq(pd, 0);
526 drv_data->adapter.id = I2C_ALGO_MV64XXX | I2C_HW_MV64XXX; 524 drv_data->adapter.id = I2C_HW_MV64XXX;
527 drv_data->adapter.algo = &mv64xxx_i2c_algo; 525 drv_data->adapter.algo = &mv64xxx_i2c_algo;
528 drv_data->adapter.owner = THIS_MODULE; 526 drv_data->adapter.owner = THIS_MODULE;
529 drv_data->adapter.class = I2C_CLASS_HWMON; 527 drv_data->adapter.class = I2C_CLASS_HWMON;
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 74eb89aa9350..e0b7a913431e 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -110,8 +110,6 @@ static u32 nforce2_func(struct i2c_adapter *adapter);
110 110
111 111
112static struct i2c_algorithm smbus_algorithm = { 112static struct i2c_algorithm smbus_algorithm = {
113 .name = "Non-I2C SMBus adapter",
114 .id = I2C_ALGO_SMBUS,
115 .smbus_xfer = nforce2_access, 113 .smbus_xfer = nforce2_access,
116 .functionality = nforce2_func, 114 .functionality = nforce2_func,
117}; 115};
@@ -131,7 +129,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
131 struct nforce2_smbus *smbus = adap->algo_data; 129 struct nforce2_smbus *smbus = adap->algo_data;
132 unsigned char protocol, pec, temp; 130 unsigned char protocol, pec, temp;
133 unsigned char len = 0; /* to keep the compiler quiet */ 131 unsigned char len = 0; /* to keep the compiler quiet */
134 int timeout = 0;
135 int i; 132 int i;
136 133
137 protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ : 134 protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ :
@@ -191,29 +188,10 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
191 case I2C_SMBUS_PROC_CALL: 188 case I2C_SMBUS_PROC_CALL:
192 dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n"); 189 dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n");
193 return -1; 190 return -1;
194 /*
195 outb_p(command, NVIDIA_SMB_CMD);
196 outb_p(data->word, NVIDIA_SMB_DATA);
197 outb_p(data->word >> 8, NVIDIA_SMB_DATA + 1);
198 protocol = NVIDIA_SMB_PRTCL_PROC_CALL | pec;
199 read_write = I2C_SMBUS_READ;
200 break;
201 */
202 191
203 case I2C_SMBUS_BLOCK_PROC_CALL: 192 case I2C_SMBUS_BLOCK_PROC_CALL:
204 dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n"); 193 dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n");
205 return -1; 194 return -1;
206 /*
207 protocol |= pec;
208 len = min_t(u8, data->block[0], 31);
209 outb_p(command, NVIDIA_SMB_CMD);
210 outb_p(len, NVIDIA_SMB_BCNT);
211 for (i = 0; i < len; i++)
212 outb_p(data->block[i + 1], NVIDIA_SMB_DATA + i);
213 protocol = NVIDIA_SMB_PRTCL_BLOCK_PROC_CALL | pec;
214 read_write = I2C_SMBUS_READ;
215 break;
216 */
217 195
218 case I2C_SMBUS_WORD_DATA_PEC: 196 case I2C_SMBUS_WORD_DATA_PEC:
219 case I2C_SMBUS_BLOCK_DATA_PEC: 197 case I2C_SMBUS_BLOCK_DATA_PEC:
@@ -232,12 +210,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
232 210
233 temp = inb_p(NVIDIA_SMB_STS); 211 temp = inb_p(NVIDIA_SMB_STS);
234 212
235#if 0
236 do {
237 i2c_do_pause(1);
238 temp = inb_p(NVIDIA_SMB_STS);
239 } while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));
240#endif
241 if (~temp & NVIDIA_SMB_STS_DONE) { 213 if (~temp & NVIDIA_SMB_STS_DONE) {
242 udelay(500); 214 udelay(500);
243 temp = inb_p(NVIDIA_SMB_STS); 215 temp = inb_p(NVIDIA_SMB_STS);
@@ -247,9 +219,10 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
247 temp = inb_p(NVIDIA_SMB_STS); 219 temp = inb_p(NVIDIA_SMB_STS);
248 } 220 }
249 221
250 if ((timeout >= MAX_TIMEOUT) || (~temp & NVIDIA_SMB_STS_DONE) 222 if ((~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) {
251 || (temp & NVIDIA_SMB_STS_STATUS)) 223 dev_dbg(&adap->dev, "SMBus Timeout! (0x%02x)\n", temp);
252 return -1; 224 return -1;
225 }
253 226
254 if (read_write == I2C_SMBUS_WRITE) 227 if (read_write == I2C_SMBUS_WRITE)
255 return 0; 228 return 0;
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 6d34ee381ce1..6d48a4da7bed 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -399,8 +399,6 @@ static u32 piix4_func(struct i2c_adapter *adapter)
399} 399}
400 400
401static struct i2c_algorithm smbus_algorithm = { 401static struct i2c_algorithm smbus_algorithm = {
402 .name = "Non-I2C SMBus adapter",
403 .id = I2C_ALGO_SMBUS,
404 .smbus_xfer = piix4_access, 402 .smbus_xfer = piix4_access,
405 .functionality = piix4_func, 403 .functionality = piix4_func,
406}; 404};
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index a3b38257cc3d..73a092fb0e7e 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -568,7 +568,6 @@ static u32 s3c24xx_i2c_func(struct i2c_adapter *adap)
568/* i2c bus registration info */ 568/* i2c bus registration info */
569 569
570static struct i2c_algorithm s3c24xx_i2c_algorithm = { 570static struct i2c_algorithm s3c24xx_i2c_algorithm = {
571 .name = "S3C2410-I2C-Algorithm",
572 .master_xfer = s3c24xx_i2c_xfer, 571 .master_xfer = s3c24xx_i2c_xfer,
573 .functionality = s3c24xx_i2c_func, 572 .functionality = s3c24xx_i2c_func,
574}; 573};
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
index bbd5e4e52f09..080318d6f54b 100644
--- a/drivers/i2c/busses/i2c-sis5595.c
+++ b/drivers/i2c/busses/i2c-sis5595.c
@@ -357,8 +357,6 @@ static u32 sis5595_func(struct i2c_adapter *adapter)
357} 357}
358 358
359static struct i2c_algorithm smbus_algorithm = { 359static struct i2c_algorithm smbus_algorithm = {
360 .name = "Non-I2C SMBus adapter",
361 .id = I2C_ALGO_SMBUS,
362 .smbus_xfer = sis5595_access, 360 .smbus_xfer = sis5595_access,
363 .functionality = sis5595_func, 361 .functionality = sis5595_func,
364}; 362};
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
index f58455e7689e..86f0f448fa0b 100644
--- a/drivers/i2c/busses/i2c-sis630.c
+++ b/drivers/i2c/busses/i2c-sis630.c
@@ -448,8 +448,6 @@ exit:
448 448
449 449
450static struct i2c_algorithm smbus_algorithm = { 450static struct i2c_algorithm smbus_algorithm = {
451 .name = "Non-I2C SMBus adapter",
452 .id = I2C_ALGO_SMBUS,
453 .smbus_xfer = sis630_access, 451 .smbus_xfer = sis630_access,
454 .functionality = sis630_func, 452 .functionality = sis630_func,
455}; 453};
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
index 6484792e23a1..ead2ff3cf60e 100644
--- a/drivers/i2c/busses/i2c-sis96x.c
+++ b/drivers/i2c/busses/i2c-sis96x.c
@@ -249,8 +249,6 @@ static u32 sis96x_func(struct i2c_adapter *adapter)
249} 249}
250 250
251static struct i2c_algorithm smbus_algorithm = { 251static struct i2c_algorithm smbus_algorithm = {
252 .name = "Non-I2C SMBus adapter",
253 .id = I2C_ALGO_SMBUS,
254 .smbus_xfer = sis96x_access, 252 .smbus_xfer = sis96x_access,
255 .functionality = sis96x_func, 253 .functionality = sis96x_func,
256}; 254};
diff --git a/drivers/i2c/busses/i2c-stub.c b/drivers/i2c/busses/i2c-stub.c
index 00d94e886955..73f481e93a36 100644
--- a/drivers/i2c/busses/i2c-stub.c
+++ b/drivers/i2c/busses/i2c-stub.c
@@ -109,8 +109,6 @@ static u32 stub_func(struct i2c_adapter *adapter)
109} 109}
110 110
111static struct i2c_algorithm smbus_algorithm = { 111static struct i2c_algorithm smbus_algorithm = {
112 .name = "Non-I2C SMBus adapter",
113 .id = I2C_ALGO_SMBUS,
114 .functionality = stub_func, 112 .functionality = stub_func,
115 .smbus_xfer = stub_xfer, 113 .smbus_xfer = stub_xfer,
116}; 114};
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index 6b5008005c6f..99d209e0485a 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -286,8 +286,6 @@ static u32 vt596_func(struct i2c_adapter *adapter)
286} 286}
287 287
288static struct i2c_algorithm smbus_algorithm = { 288static struct i2c_algorithm smbus_algorithm = {
289 .name = "Non-I2C SMBus adapter",
290 .id = I2C_ALGO_SMBUS,
291 .smbus_xfer = vt596_access, 289 .smbus_xfer = vt596_access,
292 .functionality = vt596_func, 290 .functionality = vt596_func,
293}; 291};
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index a18bdd9aa7ba..a1d580e05361 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -395,8 +395,6 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter)
395 395
396/* For now, we only handle combined mode (smbus) */ 396/* For now, we only handle combined mode (smbus) */
397static struct i2c_algorithm scx200_acb_algorithm = { 397static struct i2c_algorithm scx200_acb_algorithm = {
398 .name = "NatSemi SCx200 ACCESS.bus",
399 .id = I2C_ALGO_SMBUS,
400 .smbus_xfer = scx200_acb_smbus_xfer, 398 .smbus_xfer = scx200_acb_smbus_xfer,
401 .functionality = scx200_acb_func, 399 .functionality = scx200_acb_func,
402}; 400};
@@ -456,7 +454,7 @@ static int __init scx200_acb_create(int base, int index)
456 i2c_set_adapdata(adapter, iface); 454 i2c_set_adapdata(adapter, iface);
457 snprintf(adapter->name, I2C_NAME_SIZE, "SCx200 ACB%d", index); 455 snprintf(adapter->name, I2C_NAME_SIZE, "SCx200 ACB%d", index);
458 adapter->owner = THIS_MODULE; 456 adapter->owner = THIS_MODULE;
459 adapter->id = I2C_ALGO_SMBUS; 457 adapter->id = I2C_HW_SMBUS_SCX200;
460 adapter->algo = &scx200_acb_algorithm; 458 adapter->algo = &scx200_acb_algorithm;
461 adapter->class = I2C_CLASS_HWMON; 459 adapter->class = I2C_CLASS_HWMON;
462 460