diff options
author | Derek Young <dyoung@nslu2-linux.org> | 2005-11-15 09:18:51 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-11-15 09:18:51 +0000 |
commit | 1c3a109402522ea3f1cc0b5da98c3341eb412128 (patch) | |
tree | 70050fb538d64def3cf97897a5c5ede1b4dcf061 /packages/linux | |
parent | e0122cc8da2c072243180ffb7cb051f56a53349f (diff) |
nas100d-kernel: update to i2c 0.0.3, and new defconfig
Diffstat (limited to 'packages/linux')
-rw-r--r-- | packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch | 193 | ||||
-rw-r--r-- | packages/linux/nas100d-kernel/2.6.14/defconfig | 10 |
2 files changed, 158 insertions, 45 deletions
diff --git a/packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch b/packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch index 2587fc5803..e5b77b48de 100644 --- a/packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch +++ b/packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch @@ -1,9 +1,9 @@ - drivers/i2c/algos/i2c-algo-bit.c | 24 +++++++++++++++++++ - drivers/i2c/busses/i2c-ixp4xx.c | 47 ++++++++++++++++++++++++++++++++++++--- - 2 files changed, 67 insertions(+), 4 deletions(-) + drivers/i2c/algos/i2c-algo-bit.c | 77 +++++++++++++++++++-------------------- + drivers/i2c/busses/i2c-ixp4xx.c | 46 +++++++++++++++++++++-- + 2 files changed, 82 insertions(+), 41 deletions(-) --- linux-nas100d.orig/drivers/i2c/busses/i2c-ixp4xx.c 2005-11-11 22:22:43.000000000 +0100 -+++ linux-nas100d/drivers/i2c/busses/i2c-ixp4xx.c 2005-11-14 17:06:04.000000000 +0100 ++++ linux-nas100d/drivers/i2c/busses/i2c-ixp4xx.c 2005-11-15 00:41:39.000000000 +0100 @@ -47,16 +47,26 @@ static inline int ixp4xx_sda_pin(void *d static void ixp4xx_bit_setscl(void *data, int val) @@ -68,15 +68,14 @@ return sda; } -@@ -127,17 +158,27 @@ static int ixp4xx_i2c_probe(struct devic +@@ -127,17 +158,26 @@ static int ixp4xx_i2c_probe(struct devic drv_data->algo_data.udelay = 10; drv_data->algo_data.mdelay = 10; drv_data->algo_data.timeout = 100; - +#ifdef CONFIG_MACH_NAS100D -+ drv_data->algo_data.getscl = NULL; -+ drv_data->algo_data.udelay = 120; -+ drv_data->algo_data.mdelay = 120; ++ drv_data->algo_data.udelay = 100; ++ drv_data->algo_data.mdelay = 100; +#endif drv_data->adapter.id = I2C_HW_B_IXP4XX; drv_data->adapter.algo_data = &drv_data->algo_data; @@ -99,73 +98,187 @@ printk(KERN_ERR "ERROR: Could not install %s\n", dev->bus_id); --- linux-nas100d.orig/drivers/i2c/algos/i2c-algo-bit.c 2005-11-14 14:28:20.000000000 +0100 -+++ linux-nas100d/drivers/i2c/algos/i2c-algo-bit.c 2005-11-14 17:10:32.000000000 +0100 -@@ -81,7 +81,6 @@ static inline int sclhi(struct i2c_algo_ - unsigned long start; ++++ linux-nas100d/drivers/i2c/algos/i2c-algo-bit.c 2005-11-15 08:46:27.000000000 +0100 +@@ -78,30 +78,31 @@ static inline void scllo(struct i2c_algo + */ + static inline int sclhi(struct i2c_algo_bit_data *adap) + { +- unsigned long start; ++ int i=0; ++// unsigned long start; setscl(adap,1); -- ++ udelay(adap->udelay); + /* Not all adapters have scl sense line... */ if (adap->getscl == NULL ) { - udelay(adap->udelay); -@@ -111,6 +110,10 @@ static void i2c_start(struct i2c_algo_bi +- udelay(adap->udelay); + return 0; + } + +- start=jiffies; ++ getscl(adap); + while (! getscl(adap) ) { + /* the hw knows how to read the clock line, + * so we wait until it actually gets high. + * This is safer as some chips may hold it low + * while they are processing data internally. + */ +- if (time_after_eq(jiffies, start+adap->timeout)) { ++ setscl(adap,1); ++ getscl(adap); ++ if (i++ > 10) + return -ETIMEDOUT; +- } +- cond_resched(); + } +- DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start)); +- udelay(adap->udelay); ++// DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start)); ++// udelay(adap->udelay); + return 0; + } + +@@ -111,6 +112,8 @@ static void i2c_start(struct i2c_algo_bi { /* assert: scl, sda are high */ DEBPROTO(printk("S ")); -+#ifdef CONFIG_MACH_NAS100D + sclhi(adap); + sdahi(adap); -+#endif sdalo(adap); scllo(adap); } -@@ -132,6 +135,9 @@ static void i2c_stop(struct i2c_algo_bit +@@ -120,7 +123,7 @@ static void i2c_repstart(struct i2c_algo + /* scl, sda may not be high */ + DEBPROTO(printk(" Sr ")); + setsda(adap,1); +- sclhi(adap); ++ setscl(adap,1); + udelay(adap->udelay); + + sdalo(adap); +@@ -132,8 +135,8 @@ static void i2c_stop(struct i2c_algo_bit { DEBPROTO(printk("P\n")); /* assert: scl is low */ -+#ifdef CONFIG_MACH_NAS100D -+ scllo(adap); -+#endif ++ sclhi(adap); sdalo(adap); - sclhi(adap); +- sclhi(adap); sdahi(adap); -@@ -154,6 +160,9 @@ static int i2c_outb(struct i2c_adapter * + } + +@@ -154,34 +157,28 @@ static int i2c_outb(struct i2c_adapter * struct i2c_algo_bit_data *adap = i2c_adap->algo_data; /* assert: scl is low */ -+#ifdef CONFIG_MACH_NAS100D -+ scllo(adap); -+#endif ++ setscl(adap,0); for ( i=7 ; i>=0 ; i-- ) { sb = c & ( 1 << i ); setsda(adap,sb); -@@ -181,7 +190,14 @@ static int i2c_outb(struct i2c_adapter * - - DEBPROTO( printk(KERN_DEBUG "[%2.2x]",c&0xff) ); + udelay(adap->udelay); + DEBPROTO(printk(KERN_DEBUG "%d",sb!=0)); +- if (sclhi(adap)<0) { /* timed out */ +- sdahi(adap); /* we don't want to block the net */ +- DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x, timeout at bit #%d\n", c&0xff, i)); +- return -ETIMEDOUT; +- }; +- /* do arbitration here: +- * if ( sb && ! getsda(adap) ) -> ouch! Get out of here. +- */ +- setscl(adap, 0 ); +- udelay(adap->udelay); ++ sclhi(adap); ++ printk(" "); ++ scllo(adap); + } +- sdahi(adap); +- if (sclhi(adap)<0){ /* timeout */ +- DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x, timeout at ack\n", c&0xff)); +- return -ETIMEDOUT; +- }; ++ setscl(adap,0); ++ setsda(adap,1); ++ udelay(adap->udelay); ++ ack=getsda(adap); ++ sclhi(adap); + /* read ack: SDA should be pulled down by slave */ + ack=getsda(adap); /* ack: sda is pulled low ->success. */ +- DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x , getsda() = %d\n", c & 0xff, ack)); +- +- DEBPROTO( printk(KERN_DEBUG "[%2.2x]",c&0xff) ); DEBPROTO(if (0==ack){ printk(KERN_DEBUG " A ");} else printk(KERN_DEBUG " NA ") ); -+#ifdef CONFIG_MACH_NAS100D -+ sdalo(adap); -+#endif - scllo(adap); +- scllo(adap); ++ setsda(adap,0); ++ setscl(adap,0); + -+#ifdef CONFIG_MACH_NAS100D + udelay(adap->udelay); -+#endif return 0==ack; /* return 1 if device acked */ /* assert: scl is low (sda undef) */ } -@@ -196,8 +212,14 @@ static int i2c_inb(struct i2c_adapter *i +@@ -196,14 +193,15 @@ static int i2c_inb(struct i2c_adapter *i struct i2c_algo_bit_data *adap = i2c_adap->algo_data; /* assert: scl is low */ -+#ifdef CONFIG_MACH_NAS100D +- sdahi(adap); + setscl(adap,0); -+#endif - sdahi(adap); for (i=0;i<8;i++) { -+#ifdef CONFIG_MAC_NAS100D + getsda(adap); -+#endif if (sclhi(adap)<0) { /* timeout */ DEB2(printk(KERN_DEBUG " i2c_inb: timeout at bit #%d\n", 7-i)); return -ETIMEDOUT; + }; +- indata *= 2; +- if ( getsda(adap) ) ++ indata = indata << 1; ++ if (getsda(adap)) + indata |= 0x01; + scllo(adap); + } +@@ -469,16 +467,16 @@ static int bit_xfer(struct i2c_adapter * + struct i2c_msg msgs[], int num) + { + struct i2c_msg *pmsg; +- struct i2c_algo_bit_data *adap = i2c_adap->algo_data; ++// struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + int i,ret; +- unsigned short nak_ok; ++// unsigned short nak_ok; + +- i2c_start(adap); ++// i2c_start(adap); + for (i=0;i<num;i++) { + pmsg = &msgs[i]; +- nak_ok = pmsg->flags & I2C_M_IGNORE_NAK; +- if (!(pmsg->flags & I2C_M_NOSTART)) { ++// nak_ok = pmsg->flags & I2C_M_IGNORE_NAK; ++/* if (!(pmsg->flags & I2C_M_NOSTART)) { + if (i) { + i2c_repstart(adap); + } +@@ -489,6 +487,7 @@ static int bit_xfer(struct i2c_adapter * + return (ret<0) ? ret : -EREMOTEIO; + } + } ++*/ + if (pmsg->flags & I2C_M_RD ) { + /* read bytes into buffer*/ + ret = readbytes(i2c_adap, pmsg); +@@ -505,7 +504,7 @@ static int bit_xfer(struct i2c_adapter * + } + } + } +- i2c_stop(adap); ++// i2c_stop(adap); + return num; + } + +@@ -530,6 +529,8 @@ int i2c_bit_add_bus(struct i2c_adapter * + { + struct i2c_algo_bit_data *bit_adap = adap->algo_data; + ++ printk(KERN_INFO "i2c: nas100d 0.0.3\n"); ++ + if (bit_test) { + int ret = test_bus(bit_adap, adap->name); + if (ret<0) diff --git a/packages/linux/nas100d-kernel/2.6.14/defconfig b/packages/linux/nas100d-kernel/2.6.14/defconfig index 7ad2bc67db..e4f21957a6 100644 --- a/packages/linux/nas100d-kernel/2.6.14/defconfig +++ b/packages/linux/nas100d-kernel/2.6.14/defconfig @@ -956,16 +956,16 @@ CONFIG_I2C_IXP4XX=y # # CONFIG_SENSORS_DS1337 is not set # CONFIG_SENSORS_DS1374 is not set -CONFIG_SENSORS_EEPROM=y +CONFIG_SENSORS_EEPROM=n # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CHIP is not set +CONFIG_I2C_DEBUG_CORE=y +CONFIG_I2C_DEBUG_ALGO=y +CONFIG_I2C_DEBUG_BUS=n +CONFIG_I2C_DEBUG_CHIP=n # # Hardware Monitoring support |