All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: [PATCH] i2c driver fixes for 2.6.0
Date: Thu, 19 May 2005 06:24:32 +0000	[thread overview]
Message-ID: <1072821970727@kroah.com> (raw)
In-Reply-To: <1072821970466@kroah.com>
In-Reply-To: <10728219692713@kroah.com>

ChangeSet 1.1496.23.2, 2003/12/19 11:37:00-08:00, trini@kernel.crashing.org

[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 files changed, 18 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
--- a/drivers/i2c/busses/i2c-piix4.c	Tue Dec 30 12:29:37 2003
+++ b/drivers/i2c/busses/i2c-piix4.c	Tue Dec 30 12:29:37 2003
@@ -99,6 +99,13 @@
 		 "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 @@
 	/* 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


WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver fixes for 2.6.0
Date: Tue, 30 Dec 2003 14:06:10 -0800	[thread overview]
Message-ID: <1072821970727@kroah.com> (raw)
In-Reply-To: <1072821970466@kroah.com>

ChangeSet 1.1496.23.2, 2003/12/19 11:37:00-08:00, trini@kernel.crashing.org

[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 files changed, 18 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
--- a/drivers/i2c/busses/i2c-piix4.c	Tue Dec 30 12:29:37 2003
+++ b/drivers/i2c/busses/i2c-piix4.c	Tue Dec 30 12:29:37 2003
@@ -99,6 +99,13 @@
 		 "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 @@
 	/* 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


  parent reply	other threads:[~2005-05-19  6:24 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-30 22:02 [BK PATCH] i2c driver fixes for 2.6.0 Greg KH
2005-05-19  6:24 ` Greg KH
2003-12-30 22:06 ` [PATCH] " Greg KH
2005-05-19  6:24   ` Greg KH
2003-12-30 22:06   ` Greg KH
2005-05-19  6:24     ` Greg KH
2003-12-30 22:06     ` Greg KH
2005-05-19  6:24       ` Greg KH
2003-12-30 22:06       ` Greg KH [this message]
2005-05-19  6:24         ` Greg KH
2003-12-30 22:06         ` Greg KH
2005-05-19  6:24           ` Greg KH
2003-12-30 22:06           ` Greg KH
2005-05-19  6:24             ` Greg KH
2003-12-30 22:06             ` Greg KH
2005-05-19  6:24               ` Greg KH
2003-12-30 22:06               ` Greg KH
2005-05-19  6:24                 ` Greg KH
2003-12-30 22:06                 ` Greg KH
2005-05-19  6:24                   ` Greg KH
2003-12-30 22:06                   ` Greg KH
2005-05-19  6:24                     ` Greg KH
2003-12-30 22:06                     ` Greg KH
2005-05-19  6:24                       ` Greg KH
2003-12-30 22:06                       ` Greg KH
2005-05-19  6:24                         ` Greg KH
2003-12-30 22:06                         ` Greg KH
2005-05-19  6:24                           ` Greg KH
2003-12-30 22:06                           ` Greg KH
2005-05-19  6:24                             ` Greg KH
2003-12-30 22:06                             ` Greg KH
2005-05-19  6:24                               ` Greg KH
2003-12-30 22:06                               ` Greg KH
2005-05-19  6:24                                 ` Greg KH
2003-12-30 22:06                                 ` Greg KH
2005-05-19  6:24                                   ` Greg KH
2003-12-30 22:06                                   ` Greg KH
2005-05-19  6:24                                     ` Greg KH
2003-12-30 22:06                                     ` Greg KH
2005-05-19  6:24                                       ` Greg KH
2003-12-30 22:06                                       ` Greg KH
2005-05-19  6:24                                         ` Greg KH
2003-12-30 22:06                                         ` Greg KH
2005-05-19  6:24                                           ` Greg KH
2003-12-30 22:06                                           ` Greg KH
2005-05-19  6:24                                             ` Greg KH
2003-12-30 22:06                                             ` Greg KH
2005-05-19  6:24                                               ` Greg KH
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Jean Delvare
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Rusty Russell
2005-05-19  6:24   ` Tom Rini
2005-05-19  6:24   ` Greg KH
2005-05-19  6:24   ` Jean Delvare
2005-05-19  6:24   ` Greg KH
2005-05-19  6:24   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1072821970727@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.