diff options
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport-light.c | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.h | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis96x.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 18 |
7 files changed, 36 insertions, 20 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 089c6f5b24de..d6d44946a283 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -286,7 +286,10 @@ config I2C_PARPORT | |||
286 | This driver is a replacement for (and was inspired by) an older | 286 | This driver is a replacement for (and was inspired by) an older |
287 | driver named i2c-philips-par. The new driver supports more devices, | 287 | driver named i2c-philips-par. The new driver supports more devices, |
288 | and makes it easier to add support for new devices. | 288 | and makes it easier to add support for new devices. |
289 | 289 | ||
290 | An adapter type parameter is now mandatory. Please read the file | ||
291 | Documentation/i2c/busses/i2c-parport for details. | ||
292 | |||
290 | Another driver exists, named i2c-parport-light, which doesn't depend | 293 | Another driver exists, named i2c-parport-light, which doesn't depend |
291 | on the parport driver. This is meant for embedded systems. Don't say | 294 | on the parport driver. This is meant for embedded systems. Don't say |
292 | Y here if you intend to say Y or M there. | 295 | Y here if you intend to say Y or M there. |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 8e0f3158215f..dfca74933625 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -478,6 +478,11 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, | |||
478 | ret = i801_transaction(); | 478 | ret = i801_transaction(); |
479 | } | 479 | } |
480 | 480 | ||
481 | /* Some BIOSes don't like it when PEC is enabled at reboot or resume | ||
482 | time, so we forcibly disable it after every transaction. */ | ||
483 | if (hwpec) | ||
484 | outb_p(0, SMBAUXCTL); | ||
485 | |||
481 | if(block) | 486 | if(block) |
482 | return ret; | 487 | return ret; |
483 | if(ret) | 488 | if(ret) |
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c index c63025a4c861..e09ebbb2f9f0 100644 --- a/drivers/i2c/busses/i2c-parport-light.c +++ b/drivers/i2c/busses/i2c-parport-light.c | |||
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = { | |||
121 | 121 | ||
122 | static int __init i2c_parport_init(void) | 122 | static int __init i2c_parport_init(void) |
123 | { | 123 | { |
124 | if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { | 124 | if (type < 0) { |
125 | printk(KERN_WARNING "i2c-parport: adapter type unspecified\n"); | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | if (type >= ARRAY_SIZE(adapter_parm)) { | ||
125 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); | 130 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); |
126 | type = 0; | 131 | return -ENODEV; |
127 | } | 132 | } |
128 | 133 | ||
129 | if (base == 0) { | 134 | if (base == 0) { |
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 7e2e8cd1c14a..934bd55bae15 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = { | |||
241 | 241 | ||
242 | static int __init i2c_parport_init(void) | 242 | static int __init i2c_parport_init(void) |
243 | { | 243 | { |
244 | if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { | 244 | if (type < 0) { |
245 | printk(KERN_WARNING "i2c-parport: adapter type unspecified\n"); | ||
246 | return -ENODEV; | ||
247 | } | ||
248 | |||
249 | if (type >= ARRAY_SIZE(adapter_parm)) { | ||
245 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); | 250 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); |
246 | type = 0; | 251 | return -ENODEV; |
247 | } | 252 | } |
248 | 253 | ||
249 | return parport_register_driver(&i2c_parport_driver); | 254 | return parport_register_driver(&i2c_parport_driver); |
diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h index d702e5e0388d..9ddd816d5d0f 100644 --- a/drivers/i2c/busses/i2c-parport.h +++ b/drivers/i2c/busses/i2c-parport.h | |||
@@ -90,7 +90,7 @@ static struct adapter_parm adapter_parm[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static int type; | 93 | static int type = -1; |
94 | module_param(type, int, 0); | 94 | module_param(type, int, 0); |
95 | MODULE_PARM_DESC(type, | 95 | MODULE_PARM_DESC(type, |
96 | "Type of adapter:\n" | 96 | "Type of adapter:\n" |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index 3024907cdafe..1a73c0532fc7 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
@@ -43,13 +43,6 @@ | |||
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <asm/io.h> | 44 | #include <asm/io.h> |
45 | 45 | ||
46 | /* | ||
47 | HISTORY: | ||
48 | 2003-05-11 1.0.0 Updated from lm_sensors project for kernel 2.5 | ||
49 | (was i2c-sis645.c from lm_sensors 2.7.0) | ||
50 | */ | ||
51 | #define SIS96x_VERSION "1.0.0" | ||
52 | |||
53 | /* base address register in PCI config space */ | 46 | /* base address register in PCI config space */ |
54 | #define SIS96x_BAR 0x04 | 47 | #define SIS96x_BAR 0x04 |
55 | 48 | ||
@@ -337,7 +330,6 @@ static struct pci_driver sis96x_driver = { | |||
337 | 330 | ||
338 | static int __init i2c_sis96x_init(void) | 331 | static int __init i2c_sis96x_init(void) |
339 | { | 332 | { |
340 | printk(KERN_INFO "i2c-sis96x version %s\n", SIS96x_VERSION); | ||
341 | return pci_register_driver(&sis96x_driver); | 333 | return pci_register_driver(&sis96x_driver); |
342 | } | 334 | } |
343 | 335 | ||
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 8bd305e47f0d..766cc969c4d0 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -133,6 +133,9 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status) | |||
133 | 133 | ||
134 | outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); | 134 | outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); |
135 | outb(ACBST_STASTR | ACBST_NEGACK, ACBST); | 135 | outb(ACBST_STASTR | ACBST_NEGACK, ACBST); |
136 | |||
137 | /* Reset the status register */ | ||
138 | outb(0, ACBST); | ||
136 | return; | 139 | return; |
137 | } | 140 | } |
138 | 141 | ||
@@ -228,6 +231,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface) | |||
228 | timeout = jiffies + POLL_TIMEOUT; | 231 | timeout = jiffies + POLL_TIMEOUT; |
229 | while (time_before(jiffies, timeout)) { | 232 | while (time_before(jiffies, timeout)) { |
230 | status = inb(ACBST); | 233 | status = inb(ACBST); |
234 | |||
235 | /* Reset the status register to avoid the hang */ | ||
236 | outb(0, ACBST); | ||
237 | |||
231 | if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) { | 238 | if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) { |
232 | scx200_acb_machine(iface, status); | 239 | scx200_acb_machine(iface, status); |
233 | return; | 240 | return; |
@@ -415,7 +422,6 @@ static int __init scx200_acb_create(const char *text, int base, int index) | |||
415 | struct scx200_acb_iface *iface; | 422 | struct scx200_acb_iface *iface; |
416 | struct i2c_adapter *adapter; | 423 | struct i2c_adapter *adapter; |
417 | int rc; | 424 | int rc; |
418 | char description[64]; | ||
419 | 425 | ||
420 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); | 426 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); |
421 | if (!iface) { | 427 | if (!iface) { |
@@ -434,10 +440,7 @@ static int __init scx200_acb_create(const char *text, int base, int index) | |||
434 | 440 | ||
435 | mutex_init(&iface->mutex); | 441 | mutex_init(&iface->mutex); |
436 | 442 | ||
437 | snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", | 443 | if (!request_region(base, 8, adapter->name)) { |
438 | text, adapter->name); | ||
439 | |||
440 | if (request_region(base, 8, description) == 0) { | ||
441 | printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n", | 444 | printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n", |
442 | base, base + 8-1); | 445 | base, base + 8-1); |
443 | rc = -EBUSY; | 446 | rc = -EBUSY; |
@@ -488,7 +491,7 @@ static struct pci_device_id divil_pci[] = { | |||
488 | 491 | ||
489 | #define MSR_LBAR_SMB 0x5140000B | 492 | #define MSR_LBAR_SMB 0x5140000B |
490 | 493 | ||
491 | static int scx200_add_cs553x(void) | 494 | static __init int scx200_add_cs553x(void) |
492 | { | 495 | { |
493 | u32 low, hi; | 496 | u32 low, hi; |
494 | u32 smb_base; | 497 | u32 smb_base; |
@@ -524,6 +527,9 @@ static int __init scx200_acb_init(void) | |||
524 | } else if (pci_dev_present(divil_pci)) | 527 | } else if (pci_dev_present(divil_pci)) |
525 | rc = scx200_add_cs553x(); | 528 | rc = scx200_add_cs553x(); |
526 | 529 | ||
530 | /* If at least one bus was created, init must succeed */ | ||
531 | if (scx200_acb_list) | ||
532 | return 0; | ||
527 | return rc; | 533 | return rc; |
528 | } | 534 | } |
529 | 535 | ||