]> git.pld-linux.org Git - packages/kernel.git/blame - linux-2.4.23-i2c-2.8.1.patch
- added description of djurban's branch
[packages/kernel.git] / linux-2.4.23-i2c-2.8.1.patch
CommitLineData
b206fde9
AM
1diff -ruN linux-2.4.23-rc1-orig/drivers/acorn/char/i2c.c linux-2.4.23-rc1-i2c/drivers/acorn/char/i2c.c
2--- linux-2.4.23-rc1-orig/drivers/acorn/char/i2c.c Wed Aug 27 18:11:45 2003
3+++ linux-2.4.23-rc1-i2c/drivers/acorn/char/i2c.c Sat Nov 15 17:36:24 2003
4@@ -264,13 +264,13 @@
5 }
6
7 static struct i2c_algo_bit_data ioc_data = {
8- setsda: ioc_setsda,
9- setscl: ioc_setscl,
10- getsda: ioc_getsda,
11- getscl: ioc_getscl,
12- udelay: 80,
13- mdelay: 80,
14- timeout: 100
15+ .setsda = ioc_setsda,
16+ .setscl = ioc_setscl,
17+ .getsda = ioc_getsda,
18+ .getscl = ioc_getscl,
19+ .udelay = 80,
20+ .mdelay = 80,
21+ .timeout = 100,
22 };
23
24 static int ioc_client_reg(struct i2c_client *client)
25@@ -303,11 +303,12 @@
26 }
27
28 static struct i2c_adapter ioc_ops = {
29- name: "IOC/IOMD",
30- id: I2C_HW_B_IOC,
31- algo_data: &ioc_data,
32- client_register: ioc_client_reg,
33- client_unregister: ioc_client_unreg
34+ .owner = THIS_MODULE,
35+ .name = "IOC/IOMD",
36+ .id = I2C_HW_B_IOC,
37+ .algo_data = &ioc_data,
38+ .client_register = ioc_client_reg,
39+ .client_unregister = ioc_client_unreg,
40 };
41
42 static int __init i2c_ioc_init(void)
43diff -ruN linux-2.4.23-rc1-orig/drivers/acorn/char/pcf8583.c linux-2.4.23-rc1-i2c/drivers/acorn/char/pcf8583.c
44--- linux-2.4.23-rc1-orig/drivers/acorn/char/pcf8583.c Tue Jul 15 12:23:25 2003
45+++ linux-2.4.23-rc1-i2c/drivers/acorn/char/pcf8583.c Sat Nov 15 17:36:24 2003
46@@ -23,13 +23,13 @@
47 static unsigned short normal_addr[] = { 0x50, I2C_CLIENT_END };
48
49 static struct i2c_client_address_data addr_data = {
50- normal_i2c: normal_addr,
51- normal_i2c_range: ignore,
52- probe: ignore,
53- probe_range: ignore,
54- ignore: ignore,
55- ignore_range: ignore,
56- force: ignore,
57+ .normal_i2c = normal_addr,
58+ .normal_i2c_range = ignore,
59+ .probe = ignore,
60+ .probe_range = ignore,
61+ .ignore = ignore,
62+ .ignore_range = ignore,
63+ .force = ignore,
64 };
65
66 #define DAT(x) ((unsigned int)(x->data))
67@@ -50,6 +50,7 @@
68 return -ENOMEM;
69
70 strcpy(c->name, "PCF8583");
71+ c->name = THIS_MODULE;
72 c->id = pcf8583_driver.id;
73 c->flags = 0;
74 c->addr = addr;
75@@ -225,12 +226,13 @@
76 }
77
78 static struct i2c_driver pcf8583_driver = {
79- name: "PCF8583",
80- id: I2C_DRIVERID_PCF8583,
81- flags: I2C_DF_NOTIFY,
82- attach_adapter: pcf8583_probe,
83- detach_client: pcf8583_detach,
84- command: pcf8583_command
85+ .owner = THIS_MODULE,
86+ .name = "PCF8583",
87+ .id = I2C_DRIVERID_PCF8583,
88+ .flags = I2C_DF_NOTIFY,
89+ .attach_adapter = pcf8583_probe,
90+ .detach_client = pcf8583_detach,
91+ .command = pcf8583_command,
92 };
93
94 static __init int pcf8583_init(void)
95--- linux-2.4.23-rc1-orig/drivers/i2c/Config.in Wed Aug 27 18:11:46 2003
96+++ linux-2.4.23-rc1-i2c/drivers/i2c/Config.in Sat Nov 15 20:36:59 2003
97@@ -13,17 +13,22 @@
98 dep_tristate ' Philips style parallel port adapter' CONFIG_I2C_PHILIPSPAR $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT
99 dep_tristate ' ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT
100 dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT
101- dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_SCx200 $CONFIG_I2C_ALGOBIT
102+ if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
103+ dep_tristate 'SA1100 I2C Adapter' CONFIG_I2C_FRODO $CONFIG_I2C_ALGOBIT
104+ fi
105+ dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_SCx200_GPIO $CONFIG_I2C_ALGOBIT
106 if [ "$CONFIG_SCx200_I2C" != "n" ]; then
107 int ' GPIO pin used for SCL' CONFIG_SCx200_I2C_SCL 12
108 int ' GPIO pin used for SDA' CONFIG_SCx200_I2C_SDA 13
109 fi
110- dep_tristate ' NatSemi SCx200 ACCESS.bus' CONFIG_SCx200_ACB $CONFIG_I2C
111 fi
112
113+ dep_tristate 'NatSemi SCx200 ACCESS.bus' CONFIG_SCx200_ACB $CONFIG_I2C
114+
115 dep_tristate 'I2C PCF 8584 interfaces' CONFIG_I2C_ALGOPCF $CONFIG_I2C
116 if [ "$CONFIG_I2C_ALGOPCF" != "n" ]; then
117 dep_tristate ' Elektor ISA card' CONFIG_I2C_ELEKTOR $CONFIG_I2C_ALGOPCF
118+ dep_tristate ' PCF on EPP port' CONFIG_I2C_PCFEPP $CONFIG_I2C_ALGOPCF
119 fi
120
121 if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
122@@ -35,13 +40,13 @@
123 if [ "$CONFIG_8xx" = "y" ]; then
124 dep_tristate 'MPC8xx CPM I2C interface' CONFIG_I2C_ALGO8XX $CONFIG_I2C
125 if [ "$CONFIG_RPXLITE" = "y" -o "$CONFIG_RPXCLASSIC" = "y" ]; then
126- dep_tristate ' Embedded Planet RPX Lite/Classic suppoort' CONFIG_I2C_RPXLITE $CONFIG_I2C_ALGO8XX
127+ dep_tristate ' Embedded Planet RPX Lite/Classic support' CONFIG_I2C_RPXLITE $CONFIG_I2C_ALGO8XX
128 fi
129 fi
130- if [ "$CONFIG_405" = "y" ]; then
131- dep_tristate 'PPC 405 I2C Algorithm' CONFIG_I2C_PPC405_ALGO $CONFIG_I2C
132- if [ "$CONFIG_I2C_PPC405_ALGO" != "n" ]; then
133- dep_tristate ' PPC 405 I2C Adapter' CONFIG_I2C_PPC405_ADAP $CONFIG_I2C_PPC405_ALGO
134+ if [ "$CONFIG_IBM_OCP" = "y" ]; then
135+ dep_tristate 'IBM on-chip I2C Algorithm' CONFIG_I2C_IBM_OCP_ALGO $CONFIG_I2C
136+ if [ "$CONFIG_I2C_IBM_OCP_ALGO" != "n" ]; then
137+ dep_tristate ' IBM on-chip I2C Adapter' CONFIG_I2C_IBM_OCP_ADAP $CONFIG_I2C_IBM_OCP_ALGO
138 fi
139 fi
140
141@@ -58,7 +63,7 @@
142 # This is needed for automatic patch generation: sensors code ends here
143
144 dep_tristate 'I2C device interface' CONFIG_I2C_CHARDEV $CONFIG_I2C
145- dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C
146+ dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C $CONFIG_SYSCTL
147
148 fi
149 endmenu
150--- linux-2.4.23-rc1-orig/drivers/i2c/Makefile Wed Aug 27 18:11:46 2003
151+++ linux-2.4.23-rc1-i2c/drivers/i2c/Makefile Sat Nov 15 20:37:44 2003
152@@ -5,7 +5,8 @@
153 O_TARGET := i2c.o
154
155 export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
156- i2c-algo-ite.o i2c-proc.o i2c-algo-sibyte.o
157+ i2c-algo-ite.o i2c-proc.o i2c-algo-sibyte.o \
158+ i2c-algo-8xx.o i2c-algo-ibm_ocp.o
159
160 obj-$(CONFIG_I2C) += i2c-core.o
161 obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
162@@ -13,10 +14,16 @@
163 obj-$(CONFIG_I2C_PHILIPSPAR) += i2c-philips-par.o
164 obj-$(CONFIG_I2C_ELV) += i2c-elv.o
165 obj-$(CONFIG_I2C_VELLEMAN) += i2c-velleman.o
166+obj-$(CONFIG_I2C_FRODO) += i2c-frodo.o
167 obj-$(CONFIG_I2C_ALGOPCF) += i2c-algo-pcf.o
168 obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o
169+obj-$(CONFIG_I2C_PCFEPP) += i2c-pcf-epp.o
170 obj-$(CONFIG_ITE_I2C_ALGO) += i2c-algo-ite.o
171 obj-$(CONFIG_ITE_I2C_ADAP) += i2c-adap-ite.o
172+obj-$(CONFIG_I2C_ALGO8XX) += i2c-algo-8xx.o
173+obj-$(CONFIG_I2C_RPXLITE) += i2c-rpx.o
174+obj-$(CONFIG_I2C_IBM_OCP_ALGO) += i2c-algo-ibm_ocp.o
175+obj-$(CONFIG_I2C_IBM_OCP_ADAP) += i2c-adap-ibm_ocp.o
176 obj-$(CONFIG_I2C_PROC) += i2c-proc.o
177 obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o
178 obj-$(CONFIG_SCx200_ACB) += scx200_acb.o
179--- linux-old/Documentation/Configure.help Wed Aug 27 16:11:41 2003
180+++ linux/Documentation/Configure.help Sun Dec 7 11:17:34 2003
181@@ -18185,6 +18185,16 @@
182 <file:Documentation/modules.txt>.
183 The module will be called i2c-velleman.o.
184
185+Basic I2C on Parallel Port adapter
186+CONFIG_I2C_PPORT
187+ This supports directly connecting I2C devices to the parallel port.
188+ See <file:Documentation/i2c/i2c-pport> for more information.
189+
190+ This driver is also available as a module. If you want to compile
191+ it as a module, say M here and read
192+ <file:Documentation/modules.txt>.
193+ The module will be called i2c-pport.o.
194+
195 I2C PCF 8584 interfaces
196 CONFIG_I2C_ALGOPCF
197 This allows you to use a range of I2C adapters called PCF adapters.
198@@ -18206,6 +18216,15 @@
199 <file:Documentation/modules.txt>.
200 The module will be called i2c-elektor.o.
201
202+PCF on the EPP Parallel Port
203+CONFIG_I2C_PCFEPP
204+ This supports the PCF8584 connected to the parallel port.
205+
206+ This driver is also available as a module. If you want to compile
207+ it as a module, say M here and read
208+ <file:Documentation/modules.txt>.
209+ The module will be called i2c-pcf-epp.o.
210+
211 ITE I2C Algorithm
212 CONFIG_ITE_I2C_ALGO
213 This supports the use the ITE8172 I2C interface found on some MIPS
214@@ -18238,6 +18257,51 @@
215 sensor. Currently the device is only supported on a SiByte I2C
216 adapter, and the driver prints status updates to the system log.
217
218+Motorola 8xx I2C algorithm
219+CONFIG_I2C_ALGO8XX
220+ This is the algorithm that allows you to use Motorola 8xx I2C adapters.
221+
222+ This driver is also available as a module. If you want to compile
223+ it as a module, say M here and read
224+ <file:Documentation/modules.txt>.
225+ The module will be called i2c-algo-8xx.o.
226+
227+Motorola 8xx I2C interface
228+CONFIG_I2C_RPXLITE
229+ This supports the Motorola 8xx I2C device.
230+
231+ This driver is also available as a module. If you want to compile
232+ it as a module, say M here and read
233+ <file:Documentation/modules.txt>.
234+ The module will be called i2c-rpx.o.
235+
236+IBM 405 I2C algorithm
237+CONFIG_I2C_IBM_OCP_ALGO
238+ This is the algorithm that allows you to use IBM 405 I2C adapters.
239+
240+ This driver is also available as a module. If you want to compile
241+ it as a module, say M here and read
242+ <file:Documentation/modules.txt>.
243+ The module will be called i2c-algo-ibm_ocp.o.
244+
245+IBM 405 I2C interface
246+CONFIG_I2C_IBM_OCP_ADAP
247+ This supports the IBM 405 I2C device.
248+
249+ This driver is also available as a module. If you want to compile
250+ it as a module, say M here and read
251+ <file:Documentation/modules.txt>.
252+ The module will be called i2c-adap-ibm_ocp.o.
253+
254+StrongARM SA-1110 interface
255+CONFIG_I2C_FRODO
256+ This supports the StrongARM SA-1110 Development Board.
257+
258+ This driver is also available as a module. If you want to compile
259+ it as a module, say M here and read
260+ <file:Documentation/modules.txt>.
261+ The module will be called i2c-frodo.o.
262+
263 I2C device interface
264 CONFIG_I2C_CHARDEV
265 Say Y here to use i2c-* device files, usually found in the /dev
266@@ -18258,6 +18322,15 @@
267 This code is also available as a module. If you want to compile
268 it as a module, say M here and read <file:Documentation/modules.txt>.
269 The module will be called i2c-proc.o.
270+
271+Powermac Keywest I2C interface
272+CONFIG_I2C_KEYWEST
273+ This supports the use of the I2C interface in the combo-I/O
274+ chip on recent Apple machines. Say Y if you have such a machine.
275+
276+ This driver is also available as a module. If you want to compile
277+ it as a module, say M here and read Documentation/modules.txt.
278+ The module will be called i2c-keywest.o.
279
280 Bus Mouse Support
281 CONFIG_BUSMOUSE
282--- linux-old/Documentation/i2c/dev-interface Thu Oct 11 15:05:47 2001
283+++ linux/Documentation/i2c/dev-interface Sun Dec 7 11:17:34 2003
284@@ -87,7 +87,12 @@
285
286 ioctl(file,I2C_TENBIT,long select)
287 Selects ten bit addresses if select not equals 0, selects normal 7 bit
288- addresses if select equals 0.
289+ addresses if select equals 0. Default 0.
290+
291+ioctl(file,I2C_PEC,long select)
292+ Selects SMBus PEC (packet error checking) generation and verification
293+ if select not equals 0, disables if select equals 0. Default 0.
294+ Used only for SMBus transactions.
295
296 ioctl(file,I2C_FUNCS,unsigned long *funcs)
297 Gets the adapter functionality and puts it in *funcs.
298--- linux-old/Documentation/i2c/i2c-pport Thu Jan 1 00:00:00 1970
299+++ linux/Documentation/i2c/i2c-pport Sun Dec 7 11:17:34 2003
300@@ -0,0 +1,67 @@
301+Parallel Port Adapters
302+----------------------
303+If you are installing parallel port adapters it means you are probably messing
304+around with wires and IC's and the like. If you have purchased a card that
305+provides an external i2c/smbus this will require combined algorithm and
306+adapter code in a single module.
307+If you are doing it yourself by using the parallel port there
308+are basically 2 options.
309+
310+1) Using the parallel port and using the i2c-pport adapter module and the
311+i2c-algo-bit algorithm module together to enable you to wire up your parallel
312+port to act as an i2c/smbus. This provides a bus that will enable most
313+sensors to work but doesn't support the entire i2c/smbus capability.
314+
315+2) Using the parallel port to interface to a Philips PCF8584 parallel to i2c
316+adapter chip. You will need to build a bit of a circuit to do this. This
317+configuration needs the i2c-pcf-epp adapter module and the i2c-algo-pcf
318+algorithm module. This support almost all of the i2c/smbus capabilities.
319+
320+
321+i2c-pport Documentation
322+-----------------------
323+This is a primitive parallel port driver for the i2c bus, which exploits
324+features of modern bidirectional parallel ports.
325+
326+Bidirectional ports have particular bits connected in following way:
327+
328+ |
329+ /-----| R
330+ --o| |-----|
331+ read \-----| /------- Out pin
332+ |/
333+ - -|\
334+ write V
335+ |
336+ ---
337+
338+
339+It means when output is set to 1 we can read the port. Therefore
340+we can use 2 pins of parallel port as SDA and SCL for i2c bus. It
341+is not necessary to add any external - additional parts, we can
342+read and write the same port simultaneously.
343+ I only use register base+2 so it is possible to use all
344+8 data bits of parallel port for other applications (I have
345+connected EEPROM and LCD display). I do not use bit Enable Bi-directional
346+ Port. The only disadvantage is we can only support 5V chips.
347+
348+Layout:
349+
350+Cannon 25 pin
351+
352+SDA - connect to pin 14 (Auto Linefeed)
353+SCL - connect to pin 16 (Initialize Printer)
354+GND - connect to pin 18-25
355++5V - use external supply (I use 5V from 3.5" floppy connector)
356+
357+no pullups requied
358+
359+Module parameters:
360+
361+base = 0xXXX
362+XXX - 278 or 378
363+
364+That's all.
365+
366+Daniel Smolik
367+marvin@sitour.cz
368--- linux-old/Documentation/i2c/i2c-protocol Fri Jul 28 19:50:51 2000
369+++ linux/Documentation/i2c/i2c-protocol Sun Dec 7 11:17:35 2003
370@@ -52,10 +52,10 @@
371 We have found some I2C devices that needs the following modifications:
372
373 Flag I2C_M_NOSTART:
374- In a combined transaction, no 'S Addr' is generated at some point.
375- For example, setting I2C_M_NOSTART on the second partial message
376+ In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some
377+ point. For example, setting I2C_M_NOSTART on the second partial message
378 generates something like:
379- S Addr Rd [A] [Data] NA Wr [A] Data [A] P
380+ S Addr Rd [A] [Data] NA Data [A] P
381 If you set the I2C_M_NOSTART variable for the first partial message,
382 we do not generate Addr, but we do generate the startbit S. This will
383 probably confuse all other clients on your bus, so don't try this.
384@@ -65,4 +65,12 @@
385 need to emit an Rd instead of a Wr, or vice versa, you set this
386 flag. For example:
387 S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P
388-
389+
390+ Flags I2C_M_IGNORE_NAK
391+ Normally message is interrupted immediately if there is [NA] from the
392