From 8685b02d0acd0ebed19b91b6f16049f3fdc98777 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 18 Dec 2003 19:37:00 -0800 Subject: [PATCH] [PATCH] I2C: make i2c-piix4 fix optional On Thu, Dec 18, 2003 at 10:26:40AM -0800, Greg KH wrote: --- drivers/i2c/busses/i2c-piix4.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index c46252bffd5e8..4c224e37a7535 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -99,6 +99,13 @@ MODULE_PARM_DESC(force_addr, "Forcibly enable the PIIX4 at the given address. " "EXTREMELY DANGEROUS!"); +/* If fix_hstcfg is set to anything different from 0, we reset one of the + registers to be a valid value. */ +static int fix_hstcfg = 0; +MODULE_PARM(fix_hstcfg, "i"); +MODULE_PARM_DESC(fix_hstcfg, + "Fix config register. Needed on some boards (Force CPCI735)."); + static int piix4_transaction(void); @@ -164,9 +171,17 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id /* Some BIOS will set up the chipset incorrectly and leave a register in an undefined state (causing I2C to act very strangely). */ if (temp & 0x02) { - dev_info(&PIIX4_dev->dev, "Worked around buggy BIOS (I2C)\n"); - temp = temp & 0xfd; - pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp); + if (fix_hstcfg) { + dev_info(&PIIX4_dev->dev, "Working around buggy BIOS " + "(I2C)\n"); + temp &= 0xfd; + pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp); + } else { + dev_info(&PIIX4_dev->dev, "Unusual config register " + "value\n"); + dev_info(&PIIX4_dev->dev, "Try using fix_hstcfg=1 if " + "you experience problems\n"); + } } /* If force_addr is set, we program the new address here. Just to make -- 2.53.0