summaryrefslogtreecommitdiff
path: root/target/linux/generic-2.6/patches-2.6.22/601-eeprom_93cx6_fixes.patch
blob: 6957348b5502a2d34e99dac83ef7b6f31aa9af3c (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
From: Ivo van Doorn <ivdoorn@gmail.com>
Date: Mon, 14 May 2007 21:06:01 +0000 (+0200)
Subject: [PATCH] eeprom_93cx6: Add comment for 1us delay after pulse
X-Git-Tag: v2.6.23-rc1~1201^2~73
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=4b914dc0493edff19ff698a18198a173a14ba9d2

[PATCH] eeprom_93cx6: Add comment for 1us delay after pulse

This will add a comment for the 1us delay which is taken
after the pulse has been switched. The 1us delay is based
on the specifications so that should be made clear.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

diff --git a/drivers/misc/eeprom_93cx6.c b/drivers/misc/eeprom_93cx6.c
index bfcb434..0d6d742 100644
--- a/drivers/misc/eeprom_93cx6.c
+++ b/drivers/misc/eeprom_93cx6.c
@@ -39,6 +39,12 @@ static inline void eeprom_93cx6_pulse_high(struct eeprom_93cx6 *eeprom)
 {
 	eeprom->reg_data_clock = 1;
 	eeprom->register_write(eeprom);
+
+	/*
+	 * Add a short delay for the pulse to work.
+	 * According to the specifications the minimal time
+	 * should be 450ns so a 1us delay is sufficient.
+	 */
 	udelay(1);
 }
 
@@ -46,6 +52,12 @@ static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom)
 {
 	eeprom->reg_data_clock = 0;
 	eeprom->register_write(eeprom);
+
+	/*
+	 * Add a short delay for the pulse to work.
+	 * According to the specifications the minimal time
+	 * should be 450ns so a 1us delay is sufficient.
+	 */
 	udelay(1);
 }
 
From: John W. Linville <linville@tuxdriver.com>
Date: Tue, 12 Jun 2007 01:37:46 +0000 (-0400)
Subject: [PATCH] eeprom_93cx6: shorten pulse timing to match spec
X-Git-Tag: v2.6.23-rc1~1201^2~71
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=7e9400f178d291b2208c4ed9aac0f425c1364000

[PATCH] eeprom_93cx6: shorten pulse timing to match spec

93cx6 datasheet available here:

        http://ww1.microchip.com/downloads/en/DeviceDoc/21749F.pdf

Figure 1-1 and Table 1-2 on pages 4-5 indicate that both Clock High
Time and Clock Low Time have largest minimum times of 450ns.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

diff --git a/drivers/misc/eeprom_93cx6.c b/drivers/misc/eeprom_93cx6.c
index 0d6d742..ac515b0 100644
--- a/drivers/misc/eeprom_93cx6.c
+++ b/drivers/misc/eeprom_93cx6.c
@@ -42,10 +42,10 @@ static inline void eeprom_93cx6_pulse_high(struct eeprom_93cx6 *eeprom)
 
 	/*
 	 * Add a short delay for the pulse to work.
-	 * According to the specifications the minimal time
-	 * should be 450ns so a 1us delay is sufficient.
+	 * According to the specifications the "maximum minimum"
+	 * time should be 450ns.
 	 */
-	udelay(1);
+	ndelay(450);
 }
 
 static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom)
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 3 Jul 2007 22:31:44 +0000 (+0200)
Subject: eeprom_93cx6: shorten pulse timing to match spec (bis)
X-Git-Tag: v2.6.23-rc1~1151^2~11
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=8abd531e3f77188de2fc41e677d075cc66e61631

eeprom_93cx6: shorten pulse timing to match spec (bis)

Based on an original idea by John W. Linville.

It is the missing part of 42d45ccd60636c28e35c2016f091783bc14ad99c

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
---

diff --git a/drivers/misc/eeprom_93cx6.c b/drivers/misc/eeprom_93cx6.c
index ac515b0..ea55654 100644
--- a/drivers/misc/eeprom_93cx6.c
+++ b/drivers/misc/eeprom_93cx6.c
@@ -55,10 +55,10 @@ static inline void eeprom_93cx6_pulse_low(struct eeprom_93cx6 *eeprom)
 
 	/*
 	 * Add a short delay for the pulse to work.
-	 * According to the specifications the minimal time
-	 * should be 450ns so a 1us delay is sufficient.
+	 * According to the specifications the "maximum minimum"
+	 * time should be 450ns.
 	 */
-	udelay(1);
+	ndelay(450);
 }
 
 static void eeprom_93cx6_startup(struct eeprom_93cx6 *eeprom)