aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-01-27 12:14:50 -0500
committerJean Delvare <khali@hyperion.delvare>2008-01-27 12:14:50 -0500
commita0921b6c07dfbb59ac2d497e96438adaf4940f16 (patch)
tree46394853267af027c3520a1e8f94aa73df1cc4f5 /drivers/i2c
parent369f6f4aec5315012ff5d951e0179f860c35c181 (diff)
i2c-i801: Clear special mode bits as needed
Clear special mode bits (PEC, block buffer) at driver load time, you never know in which state the device was left by its last user. Also make sure that we reset the block buffer mode at the end of every transaction, not only when PEC was used. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-i801.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index c31699d8df3a..0b1b1ae5e228 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -502,7 +502,7 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
502 /* Some BIOSes don't like it when PEC is enabled at reboot or resume 502 /* Some BIOSes don't like it when PEC is enabled at reboot or resume
503 time, so we forcibly disable it after every transaction. Turn off 503 time, so we forcibly disable it after every transaction. Turn off
504 E32B for the same reason. */ 504 E32B for the same reason. */
505 if (hwpec) 505 if (hwpec || block)
506 outb_p(inb_p(SMBAUXCTL) & ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), 506 outb_p(inb_p(SMBAUXCTL) & ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B),
507 SMBAUXCTL); 507 SMBAUXCTL);
508 508
@@ -625,6 +625,11 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
625 else 625 else
626 dev_dbg(&dev->dev, "SMBus using PCI Interrupt\n"); 626 dev_dbg(&dev->dev, "SMBus using PCI Interrupt\n");
627 627
628 /* Clear special mode bits */
629 if (i801_features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER))
630 outb_p(inb_p(SMBAUXCTL) & ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B),
631 SMBAUXCTL);
632
628 /* set up the sysfs linkage to our parent device */ 633 /* set up the sysfs linkage to our parent device */
629 i801_adapter.dev.parent = &dev->dev; 634 i801_adapter.dev.parent = &dev->dev;
630 635