patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,58 @@
     1.4 +Fixes
     1.5 +
     1.6 +In file included from fs/compat_ioctl.c:69,
     1.7 +                 from arch/ppc64/kernel/ioctl32.c:24:
     1.8 +include/linux/i2c.h:58: error: array type has incomplete element type
     1.9 +include/linux/i2c.h:197: error: array type has incomplete element type
    1.10 +
    1.11 +when compiling with gcc-4.0.
    1.12 +
    1.13 +--- linux-2.6.11.3/include/linux/i2c.h.old	2005-03-19 10:59:09.000000000 -0800
    1.14 ++++ linux-2.6.11.3/include/linux/i2c.h	2005-03-19 11:01:37.000000000 -0800
    1.15 +@@ -36,7 +36,22 @@
    1.16 + 
    1.17 + /* --- General options ------------------------------------------------	*/
    1.18 + 
    1.19 +-struct i2c_msg;
    1.20 ++/*
    1.21 ++ * I2C Message - used for pure i2c transaction, also from /dev interface
    1.22 ++ */
    1.23 ++struct i2c_msg {
    1.24 ++	__u16 addr;	/* slave address			*/
    1.25 ++ 	__u16 flags;		
    1.26 ++#define I2C_M_TEN	0x10	/* we have a ten bit chip address	*/
    1.27 ++#define I2C_M_RD	0x01
    1.28 ++#define I2C_M_NOSTART	0x4000
    1.29 ++#define I2C_M_REV_DIR_ADDR	0x2000
    1.30 ++#define I2C_M_IGNORE_NAK	0x1000
    1.31 ++#define I2C_M_NO_RD_ACK		0x0800
    1.32 ++ 	__u16 len;		/* msg length				*/
    1.33 ++ 	__u8 *buf;		/* pointer to msg data			*/
    1.34 ++};
    1.35 ++
    1.36 + struct i2c_algorithm;
    1.37 + struct i2c_adapter;
    1.38 + struct i2c_client;
    1.39 +@@ -379,22 +394,6 @@
    1.40 + /* Return 1 if adapter supports everything we need, 0 if not. */
    1.41 + extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
    1.42 + 
    1.43 +-/*
    1.44 +- * I2C Message - used for pure i2c transaction, also from /dev interface
    1.45 +- */
    1.46 +-struct i2c_msg {
    1.47 +-	__u16 addr;	/* slave address			*/
    1.48 +- 	__u16 flags;		
    1.49 +-#define I2C_M_TEN	0x10	/* we have a ten bit chip address	*/
    1.50 +-#define I2C_M_RD	0x01
    1.51 +-#define I2C_M_NOSTART	0x4000
    1.52 +-#define I2C_M_REV_DIR_ADDR	0x2000
    1.53 +-#define I2C_M_IGNORE_NAK	0x1000
    1.54 +-#define I2C_M_NO_RD_ACK		0x0800
    1.55 +- 	__u16 len;		/* msg length				*/
    1.56 +- 	__u8 *buf;		/* pointer to msg data			*/
    1.57 +-};
    1.58 +-
    1.59 + /* To determine what functionality is present */
    1.60 + 
    1.61 + #define I2C_FUNC_I2C			0x00000001