Skip to contentSkip to conversation

I2C patches for 2.6.13-rc2

PATCH New Greg KH 1 participant 16 messages Jul 11, 2005

Subsystems (6)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 I2C patches for 2.6.13-rc2

Here are some i2c patches that have been in the -mm tree for a while. They fix a number of different bugs. But the majority of this patchest (in diffstat volume) is moving the i2c chip drivers into the hwmon directory. I used your 'dotest' script to acomplish this, but don't know if git registered that these files were just renamed or not. If I should do it a different way, please let me know and I'll regenerate the tree.

Please pull from:

	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git/
or from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git/

if it isn't synced up yet.

The full patch series will sent to the linux-kernel and sensors mailing lists, if anyone wants to see them.

thanks,

greg k-h

 Documentation/hwmon/adm1021         |  111 ++
 Documentation/hwmon/adm1025         |   51 +
 Documentation/hwmon/adm1026         |   93 +
 Documentation/hwmon/adm1031         |   35 
 Documentation/hwmon/adm9240         |  177 +++
 Documentation/hwmon/asb100          |   72 +
 Documentation/hwmon/ds1621          |  108 ++
 Documentation/hwmon/fscher          |  169 +++
 Documentation/hwmon/gl518sm         |   74 +
 Documentation/hwmon/it87            |   96 ++
 Documentation/hwmon/lm63            |   57 +
 Documentation/hwmon/lm75            |   65 +
 Documentation/hwmon/lm77            |   22 
 Documentation/hwmon/lm78            |   82 +
 Documentation/hwmon/lm80            |   56 +
 Documentation/hwmon/lm83            |   76 +
 Documentation/hwmon/lm85            |  221 ++++
 Documentation/hwmon/lm87            |   73 +
 Documentation/hwmon/lm90            |  121 ++
 Documentation/hwmon/lm92            |   37 
 Documentation/hwmon/max1619         |   29 
 Documentation/hwmon/pc87360         |  189 +++
 Documentation/hwmon/sis5595         |  106 ++
 Documentation/hwmon/smsc47b397      |  158 +++
 Documentation/hwmon/smsc47m1        |   52 +
 Documentation/hwmon/sysfs-interface |  274 +++++
 Documentation/hwmon/userspace-tools |   39 
 Documentation/hwmon/via686a         |   65 +
 Documentation/hwmon/w83627hf        |   66 +
 Documentation/hwmon/w83781d         |  402 ++++++++
 Documentation/hwmon/w83l785ts       |   39 
 Documentation/i2c/chips/adm1021     |  111 --
 Documentation/i2c/chips/adm1025     |   51 -
 Documentation/i2c/chips/adm1026     |   93 -
 Documentation/i2c/chips/adm1031     |   35 
 Documentation/i2c/chips/adm9240     |  177 ---
 Documentation/i2c/chips/asb100      |   72 -
 Documentation/i2c/chips/ds1621      |  108 --
 Documentation/i2c/chips/fscher      |  169 ---
 Documentation/i2c/chips/gl518sm     |   74 -
 Documentation/i2c/chips/it87        |   96 --
 Documentation/i2c/chips/lm63        |   57 -
 Documentation/i2c/chips/lm75        |   65 -
 Documentation/i2c/chips/lm77        |   22 
 Documentation/i2c/chips/lm78        |   82 -
 Documentation/i2c/chips/lm80        |   56 -
 Documentation/i2c/chips/lm83        |   76 -
 Documentation/i2c/chips/lm85        |  221 ----
 Documentation/i2c/chips/lm87        |   73 -
 Documentation/i2c/chips/lm90        |  121 --
 Documentation/i2c/chips/lm92        |   37 
 Documentation/i2c/chips/max1619     |   29 
 Documentation/i2c/chips/max6875     |   22 
 Documentation/i2c/chips/pc87360     |  189 ---
 Documentation/i2c/chips/sis5595     |  106 --
 Documentation/i2c/chips/smsc47b397  |  158 ---
 Documentation/i2c/chips/smsc47m1    |   52 -
 Documentation/i2c/chips/via686a     |   65 -
 Documentation/i2c/chips/w83627hf    |   66 -
 Documentation/i2c/chips/w83781d     |  402 --------
 Documentation/i2c/chips/w83l785ts   |   39 
 Documentation/i2c/dev-interface     |   15 
 Documentation/i2c/sysfs-interface   |  274 -----
 Documentation/i2c/userspace-tools   |   39 
 Documentation/i2c/writing-clients   |    7 
 arch/arm/Kconfig                    |    2 
 arch/h8300/Kconfig                  |    2 
 arch/sparc64/Kconfig                |    2 
 drivers/Kconfig                     |    2 
 drivers/Makefile                    |    1 
 drivers/hwmon/Kconfig               |  420 ++++++++
 drivers/hwmon/Makefile              |   44 
 drivers/hwmon/adm1021.c             |  402 ++++++++
 drivers/hwmon/adm1025.c             |  577 ++++++++++++
 drivers/hwmon/adm1026.c             | 1714 ++++++++++++++++++++++++++++++++++++
 drivers/hwmon/adm1031.c             |  977 ++++++++++++++++++++
 drivers/hwmon/adm9240.c             |  791 ++++++++++++++++
 drivers/hwmon/asb100.c              | 1065 ++++++++++++++++++++++
 drivers/hwmon/atxp1.c               |  361 +++++++
 drivers/hwmon/ds1621.c              |  341 +++++++
 drivers/hwmon/fscher.c              |  691 ++++++++++++++
 drivers/hwmon/fscpos.c              |  641 +++++++++++++
 drivers/hwmon/gl518sm.c             |  604 ++++++++++++
 drivers/hwmon/gl520sm.c             |  769 ++++++++++++++++
 drivers/hwmon/it87.c                | 1184 ++++++++++++++++++++++++
 drivers/hwmon/lm63.c                |  597 ++++++++++++
 drivers/hwmon/lm75.c                |  296 ++++++
 drivers/hwmon/lm75.h                |   49 +
 drivers/hwmon/lm77.c                |  420 ++++++++
 drivers/hwmon/lm78.c                |  795 ++++++++++++++++
 drivers/hwmon/lm80.c                |  601 ++++++++++++
 drivers/hwmon/lm83.c                |  408 ++++++++
 drivers/hwmon/lm85.c                | 1575 +++++++++++++++++++++++++++++++++
 drivers/hwmon/lm87.c                |  828 +++++++++++++++++
 drivers/hwmon/lm90.c                |  655 +++++++++++++
 drivers/hwmon/lm92.c                |  429 +++++++++
 drivers/hwmon/max1619.c             |  372 +++++++
 drivers/hwmon/pc87360.c             | 1348 ++++++++++++++++++++++++++++
 drivers/hwmon/sis5595.c             |  817 +++++++++++++++++
 drivers/hwmon/smsc47b397.c          |  352 +++++++
 drivers/hwmon/smsc47m1.c            |  593 ++++++++++++
 drivers/hwmon/via686a.c             |  875 ++++++++++++++++++
 drivers/hwmon/w83627ehf.c           |  846 +++++++++++++++++
 drivers/hwmon/w83627hf.c            | 1511 +++++++++++++++++++++++++++++++
 drivers/hwmon/w83781d.c             | 1632 ++++++++++++++++++++++++++++++++++
 drivers/hwmon/w83l785ts.c           |  328 ++++++
 drivers/i2c/algos/i2c-algo-ite.c    |    8 
 drivers/i2c/busses/i2c-i801.c       |    4 
 drivers/i2c/busses/i2c-piix4.c      |    2 
 drivers/i2c/busses/i2c-sis5595.c    |    2 
 drivers/i2c/chips/Kconfig           |  415 --------
 drivers/i2c/chips/Makefile          |   38 
 drivers/i2c/chips/adm1021.c         |  402 --------
 drivers/i2c/chips/adm1025.c         |  577 ------------
 drivers/i2c/chips/adm1026.c         | 1714 ------------------------------------
 drivers/i2c/chips/adm1031.c         |  977 --------------------
 drivers/i2c/chips/adm9240.c         |  791 ----------------
 drivers/i2c/chips/asb100.c          | 1065 ----------------------
 drivers/i2c/chips/atxp1.c           |  361 -------
 drivers/i2c/chips/ds1621.c          |  341 -------
 drivers/i2c/chips/eeprom.c          |    3 
 drivers/i2c/chips/fscher.c          |  691 --------------
 drivers/i2c/chips/fscpos.c          |  641 -------------
 drivers/i2c/chips/gl518sm.c         |  604 ------------
 drivers/i2c/chips/gl520sm.c         |  769 ----------------
 drivers/i2c/chips/it87.c            | 1184 ------------------------
 drivers/i2c/chips/lm63.c            |  597 ------------
 drivers/i2c/chips/lm75.c            |  296 ------
 drivers/i2c/chips/lm75.h            |   49 -
 drivers/i2c/chips/lm77.c            |  420 --------
 drivers/i2c/chips/lm78.c            |  795 ----------------
 drivers/i2c/chips/lm80.c            |  601 ------------
 drivers/i2c/chips/lm83.c            |  408 --------
 drivers/i2c/chips/lm85.c            | 1575 ---------------------------------
 drivers/i2c/chips/lm87.c            |  828 -----------------
 drivers/i2c/chips/lm90.c            |  655 -------------
 drivers/i2c/chips/lm92.c            |  429 ---------
 drivers/i2c/chips/m41t00.c          |    2 
 drivers/i2c/chips/max1619.c         |  372 -------
 drivers/i2c/chips/max6875.c         |    6 
 drivers/i2c/chips/pc87360.c         | 1348 ----------------------------
 drivers/i2c/chips/sis5595.c         |  817 -----------------
 drivers/i2c/chips/smsc47b397.c      |  352 -------
 drivers/i2c/chips/smsc47m1.c        |  593 ------------
 drivers/i2c/chips/tps65010.c        |   61 -
 drivers/i2c/chips/via686a.c         |  887 ------------------
 drivers/i2c/chips/w83627ehf.c       |  846 -----------------
 drivers/i2c/chips/w83627hf.c        | 1511 -------------------------------
 drivers/i2c/chips/w83781d.c         | 1632 ----------------------------------
 drivers/i2c/chips/w83l785ts.c       |  328 ------
 drivers/i2c/i2c-core.c              |   17 
 drivers/w1/w1.c                     |    5 
 152 files changed, 29226 insertions(+), 29184 deletions(-)

----------

Adrian Bunk:
I2C: SENSORS_ATXP1 must select I2C_SENSOR

[email protected]:
I2C: minor I2C doc cleanups
I2C: minor TPS6501x cleanups

Denis Vlasenko:
I2C: Coding style cleanups to via686a

Evgeniy Polyakov:
w1: fix CRC calculation on bigendian platforms.

Jan Veldeman:
I2C: Documentation fix

Jean Delvare:
I2C: Move hwmon drivers (3/3)
I2C: Move hwmon drivers (2/3)
I2C: Move hwmon drivers (1/3)
I2C: Clarify the usage of i2c-dev.h
I2C: New max6875 driver may corrupt EEPROMs
I2C: m41t00: fix incorrect kfree
I2C: Strip trailing whitespace from strings
I2C: drop bogus eeprom comment
I2C: max6875 Kconfig update
I2C: max6875 documentation update

Mark M. Hoffman:
i2c: make better use of IDR in i2c-core

author
#1 lore raw

PATCH 1/1 I2C: max6875 documentation update

[PATCH] I2C: max6875 documentation update

Here is a proposed documentation update for the new max6875 i2c chip driver.

---
commit 089bd86632769051f15cd7387eebe126d18f151f
tree 57637f07d7cb28543db158d2457804e968d2a021
parent 9ab1ee2ab7d65979c0f14a60ee1f29f8988f5811
author Jean Delvare <[email protected]> Thu, 23 Jun 2005 23:37:53 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 Documentation/i2c/chips/max6875 |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
Documentation/i2c/chips/max6875 +17 -5
@@ -2,10 +2,10 @@ Kernel driver max6875
 =====================
 
 Supported chips:
-  * Maxim max6874, max6875
-    Prefixes: 'max6875'
+  * Maxim MAX6874, MAX6875
+    Prefix: 'max6875'
     Addresses scanned: 0x50, 0x52
-    Datasheets:
+    Datasheet:
         http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf
 
 Author: Ben Gardner <[email protected]>
@@ -23,14 +23,26 @@ Module Parameters
 Description
 -----------
 
-The MAXIM max6875 is a EEPROM-programmable power-supply sequencer/supervisor.
+The Maxim MAX6875 is an EEPROM-programmable power-supply sequencer/supervisor.
 It provides timed outputs that can be used as a watchdog, if properly wired.
 It also provides 512 bytes of user EEPROM.
 
-At reset, the max6875 reads the configuration eeprom into its configuration
+At reset, the MAX6875 reads the configuration EEPROM into its configuration
 registers.  The chip then begins to operate according to the values in the
 registers.
 
+The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
+and outputs:
+
+             vin     gpi    vout
+MAX6874        6       4       8
+MAX6875        4       3       5
+
+MAX6874 chips can have four different addresses (as opposed to only two for
+the MAX6875). The additional addresses (0x54 and 0x56) are not probed by
+this driver by default, but the probe module parameter can be used if
+needed.
+
 See the datasheet for details on how to program the EEPROM.
 
 
author
#2 lore raw

PATCH 1/1 I2C: max6875 Kconfig update

[PATCH] I2C: max6875 Kconfig update

Here is a proposed Kconfig update for the new max6875 i2c chip driver.

---
commit 2146fec20c38d926f0d88413977f941f42a14588
tree daaf87a4ec6e6c70c9e1be8b2bd09257b3be092f
parent 089bd86632769051f15cd7387eebe126d18f151f
author Jean Delvare <[email protected]> Thu, 23 Jun 2005 23:41:39 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/Kconfig |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/i2c/chips/Kconfig +7 -4
@@ -519,13 +519,16 @@ config SENSORS_M41T00
 	  will be called m41t00.
 
 config SENSORS_MAX6875
-	tristate "MAXIM MAX6875 Power supply supervisor"
+	tristate "Maxim MAX6875 Power supply supervisor"
 	depends on I2C && EXPERIMENTAL
 	help
-	  If you say yes here you get support for the MAX6875
-	  EEPROM-Programmable, Hex/Quad, Power-Suppy Sequencers/Supervisors.
+	  If you say yes here you get support for the Maxim MAX6875
+	  EEPROM-programmable, quad power-supply sequencer/supervisor.
 
-          This provides a interface to program the EEPROM and reset the chip.
+	  This provides an interface to program the EEPROM and reset the chip.
+
+	  This driver also supports the Maxim MAX6874 hex power-supply
+	  sequencer/supervisor if found at a compatible address.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called max6875.
author
#3 lore raw

PATCH 1/1 I2C: drop bogus eeprom comment

[PATCH] I2C: drop bogus eeprom comment

This simple patch drops an out-of-date comment in the eeprom i2c chip driver.

---
commit 2db32767874fe53faff4f80de878ca19927efc1f
tree 4ac3024bd4e29e7770f96244b386429d991c58f7
parent a0920e10438e9fe8b22aba607083347c84458ed8
author Jean Delvare <[email protected]> Thu, 23 Jun 2005 23:43:00 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/eeprom.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/i2c/chips/eeprom.c +0 -3
@@ -173,9 +173,6 @@ int eeprom_detect(struct i2c_adapter *ad
 					    | I2C_FUNC_SMBUS_BYTE))
 		goto exit;
 
-	/* OK. For now, we presume we have a valid client. We now create the
-	   client structure, even though we cannot fill it completely yet.
-	   But it allows us to access eeprom_{read,write}_value. */
 	if (!(data = kmalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {
 		err = -ENOMEM;
 		goto exit;
author
#4 lore raw

PATCH 1/1 I2C: Strip trailing whitespace from strings

[PATCH] I2C: Strip trailing whitespace from strings

Here is a simple patch originally from Denis Vlasenko, which strips a useless trailing whitespace from 8 strings in 4 i2c drivers. Please apply, thanks.

From: Denis Vlasenko <[email protected]>

---
commit 541e6a02768404efb06bd1ea5f33d614732f41fc
tree 933f4e7b38580c69e61b8a0002d4e5c129c5abaa
parent 65fc50e50ff9f8b82c3756eccd7e7db6a267ffe9
author Jean Delvare <[email protected]> Thu, 23 Jun 2005 22:18:08 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/algos/i2c-algo-ite.c |    8 ++++----
 drivers/i2c/busses/i2c-i801.c    |    4 ++--
 drivers/i2c/busses/i2c-piix4.c   |    2 +-
 drivers/i2c/busses/i2c-sis5595.c |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/i2c/algos/i2c-algo-ite.c +4 -4
@@ -208,7 +208,7 @@ static int test_bus(struct i2c_algo_iic_
 		goto bailout;
 	}
 	sdalo(adap);
-	printk("test_bus:1 scl: %d  sda: %d \n",getscl(adap),
+	printk("test_bus:1 scl: %d  sda: %d\n", getscl(adap),
 	       getsda(adap));
 	if ( 0 != getsda(adap) ) {
 		printk("test_bus: %s SDA stuck high!\n",name);
@@ -221,7 +221,7 @@ static int test_bus(struct i2c_algo_iic_
 		goto bailout;
 	}		
 	sdahi(adap);
-	printk("test_bus:2 scl: %d  sda: %d \n",getscl(adap),
+	printk("test_bus:2 scl: %d  sda: %d\n", getscl(adap),
 	       getsda(adap));
 	if ( 0 == getsda(adap) ) {
 		printk("test_bus: %s SDA stuck low!\n",name);
@@ -234,7 +234,7 @@ static int test_bus(struct i2c_algo_iic_
 	goto bailout;
 	}
 	scllo(adap);
-	printk("test_bus:3 scl: %d  sda: %d \n",getscl(adap),
+	printk("test_bus:3 scl: %d  sda: %d\n", getscl(adap),
 	       getsda(adap));
 	if ( 0 != getscl(adap) ) {
 
@@ -247,7 +247,7 @@ static int test_bus(struct i2c_algo_iic_
 		goto bailout;
 	}
 	sclhi(adap);
-	printk("test_bus:4 scl: %d  sda: %d \n",getscl(adap),
+	printk("test_bus:4 scl: %d  sda: %d\n", getscl(adap),
 	       getsda(adap));
 	if ( 0 == getscl(adap) ) {
 		printk("test_bus: %s SCL stuck low!\n",name);
drivers/i2c/busses/i2c-i801.c +2 -2
@@ -194,7 +194,7 @@ static int i801_transaction(void)
 	/* Make sure the SMBus host is ready to start transmitting */
 	/* 0x1f = Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
 	if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
-		dev_dbg(&I801_dev->dev, "SMBus busy (%02x). Resetting... \n",
+		dev_dbg(&I801_dev->dev, "SMBus busy (%02x). Resetting...\n",
 			temp);
 		outb_p(temp, SMBHSTSTS);
 		if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
@@ -315,7 +315,7 @@ static int i801_block_transaction(union 
 		}
 		if (temp & errmask) {
 			dev_dbg(&I801_dev->dev, "SMBus busy (%02x). "
-				"Resetting... \n", temp);
+				"Resetting...\n", temp);
 			outb_p(temp, SMBHSTSTS);
 			if (((temp = inb_p(SMBHSTSTS)) & errmask) != 0x00) {
 				dev_err(&I801_dev->dev,
drivers/i2c/busses/i2c-piix4.c +1 -1
@@ -243,7 +243,7 @@ static int piix4_transaction(void)
 	/* Make sure the SMBus host is ready to start transmitting */
 	if ((temp = inb_p(SMBHSTSTS)) != 0x00) {
 		dev_dbg(&piix4_adapter.dev, "SMBus busy (%02x). "
-			"Resetting... \n", temp);
+			"Resetting...\n", temp);
 		outb_p(temp, SMBHSTSTS);
 		if ((temp = inb_p(SMBHSTSTS)) != 0x00) {
 			dev_err(&piix4_adapter.dev, "Failed! (%02x)\n", temp);
drivers/i2c/busses/i2c-sis5595.c +1 -1
@@ -228,7 +228,7 @@ static int sis5595_transaction(struct i2
 	/* Make sure the SMBus host is ready to start transmitting */
 	temp = sis5595_read(SMB_STS_LO) + (sis5595_read(SMB_STS_HI) << 8);
 	if (temp != 0x00) {
-		dev_dbg(&adap->dev, "SMBus busy (%04x). Resetting... \n", temp);
+		dev_dbg(&adap->dev, "SMBus busy (%04x). Resetting...\n", temp);
 		sis5595_write(SMB_STS_LO, temp & 0xff);
 		sis5595_write(SMB_STS_HI, temp >> 8);
 		if ((temp = sis5595_read(SMB_STS_LO) + (sis5595_read(SMB_STS_HI) << 8)) != 0x00) {
author
#5 lore raw

PATCH 1/1 I2C: m41t00: fix incorrect kfree

[PATCH] I2C: m41t00: fix incorrect kfree

Here is a simple path fixing an incorrect kfree in the m41t00 i2c chip driver. The current code happens to work by accident, but the freed pointer isn't the one which was allocated in the first place, which could cause problems later.

---
commit 5da69ba42aa42a479c0f5d8cb8351ebb6b51c12e
tree 3a0f32c3fbc961bb5f6b39c22c573fa8acd7c443
parent 2146fec20c38d926f0d88413977f941f42a14588
author Jean Delvare <[email protected]> Fri, 01 Jul 2005 14:28:15 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/m41t00.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/chips/m41t00.c +1 -1
@@ -207,7 +207,7 @@ m41t00_detach(struct i2c_client *client)
 	int	rc;
 
 	if ((rc = i2c_detach_client(client)) == 0) {
-		kfree(i2c_get_clientdata(client));
+		kfree(client);
 		tasklet_kill(&m41t00_tasklet);
 	}
 	return rc;
author
#6 lore raw

PATCH 1/1 I2C: Coding style cleanups to via686a

[PATCH] I2C: Coding style cleanups to via686a

Quoted 10 lines · Greg KH

[PATCH] I2C: Coding style cleanups to via686a

The via686a hardware monitoring driver has infamous coding style at the moment. I'd like to clean up the mess before I start working on other changes to this driver. Is the following patch acceptable? No code change, only coding style (indentation, alignments, trailing white space, a few parentheses and a typo).

Nice.

You missed some. This one is on top of your patch:

---
commit 6328c0e163abfce679b1beffb166f72900bf0a22
tree d5fa7087c5d18b12bd1b93797de2277bddcb6300
parent 200d481f28be4522464bb849dd0eb5f8cb6be781
author Denis Vlasenko <[email protected]> Wed, 22 Jun 2005 10:25:13 +0300 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/via686a.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/i2c/chips/via686a.c +6 -6
@@ -1,9 +1,9 @@
 /*
     via686a.c - Part of lm_sensors, Linux kernel modules
-                for hardware monitoring
+		for hardware monitoring
 
     Copyright (c) 1998 - 2002  Frodo Looijaard <[email protected]>,
-                        Kyösti Mälkki <[email protected]>,
+			Kyösti Mälkki <[email protected]>,
 			Mark Studebaker <[email protected]>,
 			and Bob Dougherty <[email protected]>
     (Some conversion-factor data were contributed by Jonathan Teh Soon Yew
@@ -171,18 +171,18 @@ static inline u8 FAN_TO_REG(long rpm, in
 /******** TEMP CONVERSIONS (Bob Dougherty) *********/
 /* linear fits from HWMon.cpp (Copyright 1998-2000 Jonathan Teh Soon Yew)
       if(temp<169)
-              return double(temp)*0.427-32.08;
+	      return double(temp)*0.427-32.08;
       else if(temp>=169 && temp<=202)
-              return double(temp)*0.582-58.16;
+	      return double(temp)*0.582-58.16;
       else
-              return double(temp)*0.924-127.33;
+	      return double(temp)*0.924-127.33;
 
  A fifth-order polynomial fits the unofficial data (provided by Alex van
  Kaam <[email protected]>) a bit better.  It also give more reasonable
  numbers on my machine (ie. they agree with what my BIOS tells me).
  Here's the fifth-order fit to the 8-bit data:
  temp = 1.625093e-10*val^5 - 1.001632e-07*val^4 + 2.457653e-05*val^3 -
-        2.967619e-03*val^2 + 2.175144e-01*val - 7.090067e+0.
+	2.967619e-03*val^2 + 2.175144e-01*val - 7.090067e+0.
 
  (2000-10-25- RFD: thanks to Uwe Andersen <[email protected]> for
  finding my typos in this formula!)
author
#7 lore raw

PATCH 1/1 I2C: minor TPS6501x cleanups

[PATCH] I2C: minor TPS6501x cleanups

This includes various small cleanups and fixes to the TPS 6501x driver that came mostly from review feedback by Jean Delvare; thanks Jean! Also some goofy whitespace gets fixed.

---
commit 65fc50e50ff9f8b82c3756eccd7e7db6a267ffe9
tree b78c1f954841ceb64732ebf355dc070b5ce79094
parent 6328c0e163abfce679b1beffb166f72900bf0a22
author [email protected] <[email protected]> Wed, 29 Jun 2005 07:13:00 -0700 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/Kconfig    |    1 -
 drivers/i2c/chips/tps65010.c |   61 ++++++++++++++++++++----------------------
 2 files changed, 29 insertions(+), 33 deletions(-)
drivers/i2c/chips/Kconfig +0 -1
@@ -509,7 +509,6 @@ config TPS65010
 	  This driver can also be built as a module.  If so, the module
 	  will be called tps65010.
 
-
 config SENSORS_M41T00
 	tristate "ST M41T00 RTC chip"
 	depends on I2C && PPC32
drivers/i2c/chips/tps65010.c +29 -32

193 lines not on this page · raw message

author
#8 lore raw

PATCH 1/1 I2C: New max6875 driver may corrupt EEPROMs

[PATCH] I2C: New max6875 driver may corrupt EEPROMs

After a careful code analysis on the new max6875 driver (drivers/i2c/chips/max6875.c), I have come to the conclusion that this driver may cause EEPROM corruptions if used on random systems.

The EEPROM part of the MAX6875 chip is accessed using rather uncommon I2C sequences. What is seen by the MAX6875 as reads can be seen by a standard EEPROM (24C02) as writes. If you check the detection method used by the driver, you'll find that the first SMBus command it will send on the bus is i2c_smbus_write_byte_data(client, 0x80, 0x40). For the MAX6875 it makes an internal pointer point to a specific offset of the EEPROM waiting for a subsequent read command, so it's not an actual data write operation, but for a standard EEPROM, this instead means writing value 0x40 to offset 0x80. Blame Philips and Intel for the obscure protocol.

Since the MAX6875 and the standard, common 24C02 EEPROMs share two I2C addresses (0x50 and 0x52), loading the max6875 driver on a system with standard EEPROMs at either address will trigger a write on these EEPROMs, which will lead to their corruption if they happen not to be write protected. This kind of EEPROMs can be found on memory modules (SPD), ethernet adapters (MAC address), laptops (proprietary data) and displays (EDID/DDC). Most of these are hopefully write-protected, but not all of them.

For this reason, I would recommend that the max6875 driver be neutralized, in a way that nobody can corrupt his/her EEPROMs by just loading the driver. This means either deleting the driver completely, or not listing any default address for it. I'd like this to be done before 2.6.13-rc1 is released.

Additionally, the max6875 driver lacks the 24RF08 corruption preventer present in the eeprom driver, which means that loading this driver in a system with such a chip would corrupt it as well.

Here is a proposed quick patch addressing the issue, although I wouldn't mind a complete removal if it makes everyone feel safer. I think Ben has plans to replace this driver by a much simplified one anyway.

---
commit 9ab1ee2ab7d65979c0f14a60ee1f29f8988f5811
tree 48ad06b033dfe8a673e026e7a219608b15733199
parent 541e6a02768404efb06bd1ea5f33d614732f41fc
author Jean Delvare <[email protected]> Fri, 24 Jun 2005 21:14:16 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/chips/max6875.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/i2c/chips/max6875.c +5 -1
@@ -37,7 +37,8 @@
 #include <linux/i2c-sensor.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = {0x50, 0x52, I2C_CLIENT_END};
+/* No address scanned by default, as this could corrupt standard EEPROMS. */
+static unsigned short normal_i2c[] = {I2C_CLIENT_END};
 static unsigned int normal_isa[] = {I2C_CLIENT_ISA_END};
 
 /* Insmod parameters */
@@ -369,6 +370,9 @@ static int max6875_detect(struct i2c_ada
 	new_client->driver = &max6875_driver;
 	new_client->flags = 0;
 
+	/* Prevent 24RF08 corruption */
+	i2c_smbus_write_quick(new_client, 0);
+
 	/* Setup the user section */
 	data->blocks[max6875_eeprom_user].type    = max6875_eeprom_user;
 	data->blocks[max6875_eeprom_user].slices  = USER_EEPROM_SLICES;
author
#9 lore raw

PATCH 1/1 i2c: make better use of IDR in i2c-core

[PATCH] i2c: make better use of IDR in i2c-core

This patch uses the already existing IDR mechanism to simplify and improve the i2c_get_adapter function in i2c-core.

---
commit a0920e10438e9fe8b22aba607083347c84458ed8
tree 8953a2c3c19cab0d4e67fc0e396c23711388403b
parent 5da69ba42aa42a479c0f5d8cb8351ebb6b51c12e
author Mark M. Hoffman <[email protected]> Tue, 28 Jun 2005 00:21:30 -0400 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:36 -0700

 drivers/i2c/i2c-core.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)
drivers/i2c/i2c-core.c +6 -11
@@ -156,7 +156,7 @@ int i2c_add_adapter(struct i2c_adapter *
 		goto out_unlock;
 	}
 
-	res = idr_get_new(&i2c_adapter_idr, NULL, &id);
+	res = idr_get_new(&i2c_adapter_idr, adap, &id);
 	if (res < 0) {
 		if (res == -EAGAIN)
 			res = -ENOMEM;
@@ -765,20 +765,15 @@ int i2c_adapter_id(struct i2c_adapter *a
 
 struct i2c_adapter* i2c_get_adapter(int id)
 {
-	struct list_head   *item;
 	struct i2c_adapter *adapter;
 	
 	down(&core_lists);
-	list_for_each(item,&adapters) {
-		adapter = list_entry(item, struct i2c_adapter, list);
-		if (id == adapter->nr &&
-		    try_module_get(adapter->owner)) {
-			up(&core_lists);
-			return adapter;
-		}
-	}
+	adapter = (struct i2c_adapter *)idr_find(&i2c_adapter_idr, id);
+	if (adapter && !try_module_get(adapter->owner))
+		adapter = NULL;
+
 	up(&core_lists);
-	return NULL;
+	return adapter;
 }
 
 void i2c_put_adapter(struct i2c_adapter *adap)
author
#10 lore raw

PATCH 1/1 w1: fix CRC calculation on bigendian platforms.

[PATCH] w1: fix CRC calculation on bigendian platforms.

In the 2.6.13-rc1 code the "rn" structure is in the wrong-endianness when passed to w1_attach_slave_device(). This causes problems like the family and crc being swapped around.

---
commit 0e65f82814e9828d3ff54988de9e7c0b36794daa
tree a4d5dfb9ab550160a453c6266fe67d18ace76857
parent 80efa8c72006a1c04004f8fb07b22073348e4bf2
author Evgeniy Polyakov <[email protected]> Thu, 30 Jun 2005 22:52:38 +0400 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:37 -0700

 drivers/w1/w1.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/w1/w1.c +2 -3
@@ -516,6 +516,7 @@ static void w1_slave_found(unsigned long
 	struct w1_reg_num *tmp;
 	int family_found = 0;
 	struct w1_master *dev;
+	u64 rn_le = cpu_to_le64(rn);
 
 	dev = w1_search_master(data);
 	if (!dev) {
@@ -544,10 +545,8 @@ static void w1_slave_found(unsigned long
 		slave_count++;
 	}
 
-	rn = cpu_to_le64(rn);
-
 	if (slave_count == dev->slave_count &&
-		rn && ((le64_to_cpu(rn) >> 56) & 0xff) == w1_calc_crc8((u8 *)&rn, 7)) {
+		rn && ((rn >> 56) & 0xff) == w1_calc_crc8((u8 *)&rn_le, 7)) {
 		w1_attach_slave_device(dev, tmp);
 	}
 
author
#11 lore raw

PATCH 1/1 I2C: Clarify the usage of i2c-dev.h

[PATCH] I2C: Clarify the usage of i2c-dev.h

Upon suggestion by Nils Roeder, here is an update to the i2c documentation to clarify which header files user-space applications relying on the i2c-dev interface should include.

---
commit 1d772e2587da3c8b0fb8610fcc1c91fd82f87e52
tree 816702c0b2b1a37f772b8884ce2177b88af4ab73
parent a68e2f4895070f3a449bfe5ae1174b73cc900642
author Jean Delvare <[email protected]> Sat, 25 Jun 2005 11:37:40 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:37 -0700

 Documentation/i2c/dev-interface |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
Documentation/i2c/dev-interface +7 -4
@@ -14,9 +14,12 @@ C example
 =========
 
 So let's say you want to access an i2c adapter from a C program. The
-first thing to do is `#include <linux/i2c.h>" and "#include <linux/i2c-dev.h>. 
-Yes, I know, you should never include kernel header files, but until glibc 
-knows about i2c, there is not much choice.
+first thing to do is "#include <linux/i2c-dev.h>". Please note that
+there are two files named "i2c-dev.h" out there, one is distributed
+with the Linux kernel and is meant to be included from kernel
+driver code, the other one is distributed with lm_sensors and is
+meant to be included from user-space programs. You obviously want
+the second one here.
 
 Now, you have to decide which adapter you want to access. You should
 inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned
@@ -78,7 +81,7 @@ Full interface description
 ==========================
 
 The following IOCTLs are defined and fully supported 
-(see also i2c-dev.h and i2c.h):
+(see also i2c-dev.h):
 
 ioctl(file,I2C_SLAVE,long addr)
   Change slave address. The address is passed in the 7 lower bits of the
author
#12 lore raw

PATCH 1/1 I2C: minor I2C doc cleanups

[PATCH] I2C: minor I2C doc cleanups

The I2C stack has long had "id" fields, of rather dubious utility, in many data structures. This removes mention of one of them from the documentation about how to write an I2C driver, so that only drivers that really need to use them (probably old/legacy code) will have any reason to use this field.

---
commit 61f5809d3ebce9d5433b8696048e91405b681023
tree bcb41c29d36b3b6f84d34c7bac05b38855e90742
parent 2db32767874fe53faff4f80de878ca19927efc1f
author [email protected] <[email protected]> Wed, 29 Jun 2005 07:14:06 -0700 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:37 -0700

 Documentation/i2c/writing-clients |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
Documentation/i2c/writing-clients +0 -7
@@ -27,7 +27,6 @@ address.
 static struct i2c_driver foo_driver = {
 	.owner		= THIS_MODULE,
 	.name		= "Foo version 2.3 driver",
-	.id		= I2C_DRIVERID_FOO, /* from i2c-id.h, optional */
 	.flags		= I2C_DF_NOTIFY,
 	.attach_adapter	= &foo_attach_adapter,
 	.detach_client	= &foo_detach_client,
@@ -37,12 +36,6 @@ static struct i2c_driver foo_driver = {
 The name can be chosen freely, and may be upto 40 characters long. Please
 use something descriptive here.
 
-If used, the id should be a unique ID. The range 0xf000 to 0xffff is
-reserved for local use, and you can use one of those until you start
-distributing the driver, at which time you should contact the i2c authors
-to get your own ID(s). Note that most of the time you don't need an ID
-at all so you can just omit it.
-
 Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This
 means that your driver will be notified when new adapters are found.
 This is almost always what you want.
author
#13 lore raw

PATCH 1/1 I2C: SENSORS_ATXP1 must select I2C_SENSOR

[PATCH] I2C: SENSORS_ATXP1 must select I2C_SENSOR

Quoted 13 lines · Sebastian Pigulak

I've tried patching linux-2.6.13-RC1 with patch-2.6.13-rc1-git2 and building atxp1(it allows Vcore voltage changing) into the kernel. Unfortunately, the kernel compilation stops with:

LD init/built-in.o
LD vmlinux
drivers/built-in.o(.text+0x92298): In function `atxp1_detect':
: undefined reference to i2c_which_vrm' drivers/built-in.o(.text+0x921ae): In function atxp1_attach_adapter':
: undefined reference to `i2c_detect'
make: *** [vmlinux] B??d 1
==> ERROR: Build Failed. Aborting...

Quoted 1 line

Could someone have a look at the module and possibly fix it up?

SENSORS_ATXP1 must select I2C_SENSOR.

---
commit 80efa8c72006a1c04004f8fb07b22073348e4bf2
tree 48b0d3a256790004ea5383c878f86e05f162ce31
parent 1d772e2587da3c8b0fb8610fcc1c91fd82f87e52
author Adrian Bunk <[email protected]> Fri, 01 Jul 2005 00:17:27 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:37 -0700

 drivers/i2c/chips/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/i2c/chips/Kconfig +1 -0
@@ -80,6 +80,7 @@ config SENSORS_ASB100
 config SENSORS_ATXP1
 	tristate "Attansic ATXP1 VID controller"
 	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
 	help
 	  If you say yes here you get support for the Attansic ATXP1 VID
 	  controller.
author
#14 lore raw

PATCH 1/1 I2C: Documentation fix

[PATCH] I2C: Documentation fix

Fix documentation to match code in include/linux/i2c-dev.h

---
commit a68e2f4895070f3a449bfe5ae1174b73cc900642
tree 76f3e9e4da1f261687b51aad6c8be3534788e63f
parent 61f5809d3ebce9d5433b8696048e91405b681023
author Jan Veldeman <[email protected]> Fri, 01 Jul 2005 16:20:24 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:10:37 -0700

 Documentation/i2c/dev-interface |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/i2c/dev-interface +2 -2
@@ -97,10 +97,10 @@ ioctl(file,I2C_PEC,long select)
 ioctl(file,I2C_FUNCS,unsigned long *funcs)
   Gets the adapter functionality and puts it in *funcs.
 
-ioctl(file,I2C_RDWR,struct i2c_ioctl_rdwr_data *msgset)
+ioctl(file,I2C_RDWR,struct i2c_rdwr_ioctl_data *msgset)
 
   Do combined read/write transaction without stop in between.
-  The argument is a pointer to a struct i2c_ioctl_rdwr_data {
+  The argument is a pointer to a struct i2c_rdwr_ioctl_data {
 
       struct i2c_msg *msgs;  /* ptr to array of simple messages */
       int nmsgs;             /* number of messages to exchange */
author
#15 lore raw

PATCH 1/1 I2C: Move hwmon drivers (1/3)

[PATCH] I2C: Move hwmon drivers (1/3)

Part 1: Configuration files and Makefiles.

From: Jean Delvare <[email protected]>

---
commit ad2f931dcb41bcfae38cc77d78b7821dfef83cf2
tree 344940f7ce52d94cf9bdd862409c63ebeb9bfa3a
parent 0e65f82814e9828d3ff54988de9e7c0b36794daa
author Jean Delvare <[email protected]> Sat, 02 Jul 2005 18:15:49 +0200 committer Greg Kroah-Hartman <[email protected]> Mon, 11 Jul 2005 14:14:31 -0700

 arch/arm/Kconfig           |    2 
 arch/h8300/Kconfig         |    2 
 arch/sparc64/Kconfig       |    2 
 drivers/Kconfig            |    2 
 drivers/Makefile           |    1 
 drivers/hwmon/Kconfig      |  420 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/hwmon/Makefile     |   44 +++++
 drivers/i2c/chips/Kconfig  |  402 ------------------------------------------
 drivers/i2c/chips/Makefile |   38 ----
 9 files changed, 476 insertions(+), 437 deletions(-)
arch/arm/Kconfig +2 -0
@@ -744,6 +744,8 @@ source "drivers/char/Kconfig"
 
 source "drivers/i2c/Kconfig"
 
+source "drivers/hwmon/Kconfig"
+
 #source "drivers/l3/Kconfig"
 
 source "drivers/misc/Kconfig"
arch/h8300/Kconfig +2 -0
@@ -179,6 +179,8 @@ source "drivers/serial/Kconfig"
 
 source "drivers/i2c/Kconfig"
 
+source "drivers/hwmon/Kconfig"
+
 source "drivers/usb/Kconfig"
 
 endmenu
arch/sparc64/Kconfig +2 -0
@@ -647,6 +647,8 @@ source "drivers/input/Kconfig"
 
 source "drivers/i2c/Kconfig"
 
+source "drivers/hwmon/Kconfig"
+
 source "fs/Kconfig"
 
 source "drivers/media/Kconfig"
drivers/Kconfig +2 -0
@@ -44,6 +44,8 @@ source "drivers/i2c/Kconfig"
 
 source "drivers/w1/Kconfig"
 
+source "drivers/hwmon/Kconfig"
+
 source "drivers/misc/Kconfig"
 
 source "drivers/media/Kconfig"
drivers/Makefile +1 -0
@@ -52,6 +52,7 @@ obj-$(CONFIG_INPUT)		+= input/
 obj-$(CONFIG_I2O)		+= message/
 obj-$(CONFIG_I2C)		+= i2c/
 obj-$(CONFIG_W1)		+= w1/
+obj-$(CONFIG_HWMON)		+= hwmon/
 obj-$(CONFIG_PHONE)		+= telephony/
 obj-$(CONFIG_MD)		+= md/
 obj-$(CONFIG_BT)		+= bluetooth/
drivers/hwmon/Kconfig new file +420 -0

420 lines not on this page · raw message

drivers/hwmon/Makefile new file +44 -0

44 lines not on this page · raw message

drivers/i2c/chips/Kconfig +2 -400

412 lines not on this page · raw message

drivers/i2c/chips/Makefile +1 -37
@@ -1,52 +1,16 @@
 #
-# Makefile for sensor and "other" I2C chip drivers.
+# Makefile for miscellaneous I2C chip drivers.
 #
 
-# asb100, then w83781d go first, as they can override other drivers' addresses.
-obj-$(CONFIG_SENSORS_ASB100)	+= asb100.o
-obj-$(CONFIG_SENSORS_W83627HF)	+= w83627hf.o
-obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
-
-obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
-obj-$(CONFIG_SENSORS_ADM1025)	+= adm1025.o
-obj-$(CONFIG_SENSORS_ADM1026)	+= adm1026.o
-obj-$(CONFIG_SENSORS_ADM1031)	+= adm1031.o
-obj-$(CONFIG_SENSORS_ADM9240)	+= adm9240.o
-obj-$(CONFIG_SENSORS_ATXP1)	+= atxp1.o
 obj-$(CONFIG_SENSORS_DS1337)	+= ds1337.o
 obj-$(CONFIG_SENSORS_DS1374)	+= ds1374.o
-obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
-obj-$(CONFIG_SENSORS_FSCHER)	+= fscher.o
-obj-$(CONFIG_SENSORS_FSCPOS)	+= fscpos.o
-obj-$(CONFIG_SENSORS_GL518SM)	+= gl518sm.o
-obj-$(CONFIG_SENSORS_GL520SM)	+= gl520sm.o
-obj-$(CONFIG_SENSORS_IT87)	+= it87.o
-obj-$(CONFIG_SENSORS_LM63)	+= lm63.o
-obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
-obj-$(CONFIG_SENSORS_LM77)	+= lm77.o
-obj-$(CONFIG_SENSORS_LM78)	+= lm78.o
-obj-$(CONFIG_SENSORS_LM80)	+= lm80.o
-obj-$(CONFIG_SENSORS_LM83)	+= lm83.o
-obj-$(CONFIG_SENSORS_LM85)	+= lm85.o
-obj-$(CONFIG_SENSORS_LM87)	+= lm87.o
-obj-$(CONFIG_SENSORS_LM90)	+= lm90.o
-obj-$(CONFIG_SENSORS_LM92)	+= lm92.o
-obj-$(CONFIG_SENSORS_MAX1619)	+= max1619.o
 obj-$(CONFIG_SENSORS_MAX6875)	+= max6875.o
 obj-$(CONFIG_SENSORS_M41T00)	+= m41t00.o
-obj-$(CONFIG_SENSORS_PC87360)	+= pc87360.o
 obj-$(CONFIG_SENSORS_PCA9539)	+= pca9539.o
 obj-$(CONFIG_SENSORS_PCF8574)	+= pcf8574.o
 obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
 obj-$(CONFIG_SENSORS_RTC8564)	+= rtc8564.o
-obj-$(CONFIG_SENSORS_SIS5595)	+= sis5595.o
-obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
-obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
-obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
-obj-$(CONFIG_SENSORS_W83627EHF)	+= w83627ehf.o
-obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
-
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o