I2C updates for 2.4.31-pre1
Hi Marcelo, hi all,
I have a number of I2C updates for 2.4.31-pre1 waiting. All are backports from Linux 2.6 and are already present in i2c 2.9.1.
Individual patches follow, please apply.
Thanks,
Signature · 1 line
Jean Delvare
PATCH 1/1 I2C updates for 2.4.31-pre1 (1/3)
Fix a typo in a comment in i2c.h. It was originally fixed by Corey Minyard in Linux 2.6.
http://linux.bkbits.net:8080/linux-2.5/diffs/include/linux/[email protected]
include/linux/i2c.h renamed from include/linux/i2c.h.orig +1 -1
@@ -193,7 +193,7 @@char name[32 ];/* textual description */ unsigned int id; -/* If an adapter algorithm can't to I2C-level access, set master_xfer +/* If an adapter algorithm can't do I2C-level access, set master_xfer to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */
Signature · 1 line
Jean Delvare
PATCH 1/1 I2C updates for 2.4.31-pre1 (2/3)
In reply to Jean DelvareFix I2C_FUNC_* defines in i2c.h. These defines lack surrounding parentheses, which might cause unexpected results where used. These were originally fixed by Corey Minyard in Linux 2.6.
http://marc.theaimsgroup.com/?l=linux-kernel&m=110928784629301
http://linux.bkbits.net:8080/linux-2.5/diffs/include/linux/[email protected]
include/linux/i2c.h renamed from include/linux/i2c.h.orig +17 -17
@@ -390,23 +390,23 @@#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000/* New I2C-like block */ #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000/* transfer */ -#define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \ - I2C_FUNC_SMBUS_WRITE_BYTE -#define I2C_FUNC_SMBUS_BYTE_DATA I2C_FUNC_SMBUS_READ_BYTE_DATA | \ - I2C_FUNC_SMBUS_WRITE_BYTE_DATA -#define I2C_FUNC_SMBUS_WORD_DATA I2C_FUNC_SMBUS_READ_WORD_DATA | \ - I2C_FUNC_SMBUS_WRITE_WORD_DATA -#define I2C_FUNC_SMBUS_BLOCK_DATA I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ - I2C_FUNC_SMBUS_WRITE_BLOCK_DATA -#define I2C_FUNC_SMBUS_I2C_BLOCK I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ - I2C_FUNC_SMBUS_WRITE_I2C_BLOCK - -#define I2C_FUNC_SMBUS_EMUL I2C_FUNC_SMBUS_QUICK | \ - I2C_FUNC_SMBUS_BYTE | \ - I2C_FUNC_SMBUS_BYTE_DATA | \ - I2C_FUNC_SMBUS_WORD_DATA | \ - I2C_FUNC_SMBUS_PROC_CALL | \ - I2C_FUNC_SMBUS_WRITE_BLOCK_DATA +#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ + I2C_FUNC_SMBUS_WRITE_BYTE) +#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \ + I2C_FUNC_SMBUS_WRITE_BYTE_DATA) +#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \ + I2C_FUNC_SMBUS_WRITE_WORD_DATA) +#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ + I2C_FUNC_SMBUS_WRITE_BLOCK_DATA) +#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ + I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) + +#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ + I2C_FUNC_SMBUS_BYTE | \ + I2C_FUNC_SMBUS_BYTE_DATA | \ + I2C_FUNC_SMBUS_WORD_DATA | \ + I2C_FUNC_SMBUS_PROC_CALL | \ + I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)/* * Data for SMBus Messages
Signature · 1 line
Jean Delvare
PATCH 1/1 I2C updates for 2.4.31-pre1 (3/3)
In reply to Jean DelvareFix an iteration bug in the handling of i2c client module parameters. The "force" module parameter is a list of adapter, address pairs, not triplets. The current code would only handle the first, fourth, seventh etc. pairs properly. I guess that nobody ever needed more than one pair, or the bug would have been noticed way earlier. This bug was originally fixed by myself in Linux 2.6.
http://marc.theaimsgroup.com/?l=linux-kernel&m=111231616107325
http://linux.bkbits.net:8080/linux-2.5/diffs/drivers/i2c/[email protected]
drivers/i2c/i2c-core.c renamed from drivers/i2c/i2c-core.c.orig +1 -1
@@ -851,7 +851,7 @@at all */ found =0 ; -for (i =0 ; !found && (address_data->force[i] !=I2C_CLIENT_END ); i +=3 ) { +for (i =0 ; !found && (address_data->force[i] !=I2C_CLIENT_END ); i +=2 ) {if (((adap_id == address_data->force[i]) || (address_data->force[i] ==ANY_I2C_BUS )) && (addr == address_data->force[i+1 ])) {
Signature · 1 line
Jean Delvare