summaryrefslogtreecommitdiff
path: root/packages/linux/nas100d-kernel/2.6.14/60-nas100d-i2c.patch
blob: b4c5e3c63b2efccfac0f87fa73e48a8f9e4609c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 drivers/i2c/algos/i2c-algo-bit.c |    9 +++++++--
 drivers/i2c/busses/i2c-ixp4xx.c  |    9 ++++++---
 2 files changed, 13 insertions(+), 5 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-15 11:51:51.000000000 +0100
@@ -65,7 +65,6 @@ static int ixp4xx_bit_getscl(void *data)
 
 	gpio_line_config(ixp4xx_scl_pin(data), IXP4XX_GPIO_IN );
 	gpio_line_get(ixp4xx_scl_pin(data), &scl);
-
 	return scl;
 }	
 
@@ -75,7 +74,6 @@ static int ixp4xx_bit_getsda(void *data)
 
 	gpio_line_config(ixp4xx_sda_pin(data), IXP4XX_GPIO_IN );
 	gpio_line_get(ixp4xx_sda_pin(data), &sda);
-
 	return sda;
 }	
 
@@ -127,7 +125,10 @@ 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.udelay = 200;
+	drv_data->algo_data.mdelay = 200;
+#endif
 	drv_data->adapter.id = I2C_HW_B_IXP4XX;
 	drv_data->adapter.algo_data = &drv_data->algo_data;
 
@@ -145,6 +146,8 @@ static int ixp4xx_i2c_probe(struct devic
 		return err;
 	}
 
+	printk(KERN_INFO "i2c: ixp4xx 0.0.3\n");
+
 	dev_set_drvdata(&plat_dev->dev, drv_data);
 
 	return 0;
--- linux-nas100d.orig/drivers/i2c/algos/i2c-algo-bit.c	2005-11-15 11:01:31.000000000 +0100
+++ linux-nas100d/drivers/i2c/algos/i2c-algo-bit.c	2005-11-15 11:47:33.000000000 +0100
@@ -44,8 +44,8 @@
 
 /* module parameters:
  */
-static int i2c_debug;
-static int bit_test;	/* see if the line-setting functions work	*/
+static int i2c_debug=2;
+static int bit_test=1;	/* see if the line-setting functions work	*/
 
 /* --- setting states on the bus with the right timing: ---------------	*/
 
@@ -203,6 +203,7 @@ static int i2c_inb(struct i2c_adapter *i
 			return -ETIMEDOUT;
 		};
 		indata *= 2;
+		udelay(adap->udelay);
 		if ( getsda(adap) ) 
 			indata |= 0x01;
 		scllo(adap);
@@ -544,6 +545,8 @@ int i2c_bit_add_bus(struct i2c_adapter *
 	adap->timeout = 100;	/* default values, should	*/
 	adap->retries = 3;	/* be replaced by defines	*/
 
+	printk(KERN_INFO "i2c: algo-bit 0.0.3\n");
+
 	i2c_add_adapter(adap);
 	return 0;
 }
@@ -561,9 +564,11 @@ MODULE_AUTHOR("Simon G. Vogl <simon@tk.u
 MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
 MODULE_LICENSE("GPL");
 
+/*
 module_param(bit_test, bool, 0);
 module_param(i2c_debug, int, S_IRUGO | S_IWUSR);
 
 MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck");
 MODULE_PARM_DESC(i2c_debug,
 		 "debug level - 0 off; 1 normal; 2,3 more verbose; 9 bit-protocol");
+*/