---- linux-old/Documentation/Configure.help Sun Jan 18 23:43:06 2004
-+++ linux/Documentation/Configure.help Sun Jan 18 23:58:17 2004
+diff -urN linux-2.4.24.org/Documentation/Configure.help linux-2.4.24/Documentation/Configure.help
+--- linux-2.4.24.org/Documentation/Configure.help 2004-01-19 00:57:40.711147069 +0100
++++ linux-2.4.24/Documentation/Configure.help 2004-01-19 01:37:57.569677460 +0100
@@ -20124,6 +20124,16 @@
<file:Documentation/modules.txt>.
The module will be called i2c-velleman.o.
I2C device interface
CONFIG_I2C_CHARDEV
Say Y here to use i2c-* device files, usually found in the /dev
---- linux-old/Documentation/i2c/dev-interface Sun Jan 18 23:41:30 2004
-+++ linux/Documentation/i2c/dev-interface Sun Jan 18 23:58:17 2004
+diff -urN linux-2.4.24.org/Documentation/i2c/dev-interface linux-2.4.24/Documentation/i2c/dev-interface
+--- linux-2.4.24.org/Documentation/i2c/dev-interface 2004-01-19 00:57:38.305648310 +0100
++++ linux-2.4.24/Documentation/i2c/dev-interface 2004-01-19 01:37:57.903608081 +0100
@@ -89,6 +89,11 @@
Selects ten bit addresses if select not equals 0, selects normal 7 bit
addresses if select equals 0. Default 0.
ioctl(file,I2C_FUNCS,unsigned long *funcs)
Gets the adapter functionality and puts it in *funcs.
---- linux-old/Documentation/i2c/i2c-pport Thu Jan 1 00:00:00 1970
-+++ linux/Documentation/i2c/i2c-pport Sun Jan 18 23:58:17 2004
+diff -urN linux-2.4.24.org/Documentation/i2c/i2c-pport linux-2.4.24/Documentation/i2c/i2c-pport
+--- linux-2.4.24.org/Documentation/i2c/i2c-pport 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/Documentation/i2c/i2c-pport 2004-01-19 01:37:58.302525201 +0100
@@ -0,0 +1,67 @@
+Parallel Port Adapters
+----------------------
+
+Daniel Smolik
+marvin@sitour.cz
---- linux-old/Documentation/i2c/i2c-protocol Sun Jan 18 23:41:30 2004
-+++ linux/Documentation/i2c/i2c-protocol Sun Jan 18 23:58:17 2004
+diff -urN linux-2.4.24.org/Documentation/i2c/i2c-protocol linux-2.4.24/Documentation/i2c/i2c-protocol
+--- linux-2.4.24.org/Documentation/i2c/i2c-protocol 2004-01-19 00:57:38.306648102 +0100
++++ linux-2.4.24/Documentation/i2c/i2c-protocol 2004-01-19 01:37:59.228332853 +0100
@@ -65,3 +65,12 @@
need to emit an Rd instead of a Wr, or vice versa, you set this
flag. For example:
+
+ Flags I2C_M_NO_RD_ACK
+ In a read message, master A/NA bit is skipped.
---- linux-old/Documentation/i2c/summary Sun Jan 18 23:41:31 2004
-+++ linux/Documentation/i2c/summary Sun Jan 18 23:58:17 2004
+diff -urN linux-2.4.24.org/Documentation/i2c/summary linux-2.4.24/Documentation/i2c/summary
+--- linux-2.4.24.org/Documentation/i2c/summary 2004-01-19 00:57:38.333642477 +0100
++++ linux-2.4.24/Documentation/i2c/summary 2004-01-19 01:37:59.718231070 +0100
@@ -59,16 +59,16 @@
i2c-algo-8xx: An algorithm for CPM's I2C device in Motorola 8xx processors (NOT BUILT BY DEFAULT)
i2c-algo-bit: A bit-banging algorithm
i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit)
i2c-rpx: RPX board Motorola 8xx I2C device (uses i2c-algo-8xx) (NOT BUILT BY DEFAULT)
i2c-velleman: Velleman K8000 parallel port adapter (uses i2c-algo-bit)
---- linux-old/Documentation/i2c/writing-clients Sun Jan 18 23:41:31 2004
-+++ linux/Documentation/i2c/writing-clients Sun Jan 18 23:58:18 2004
+diff -urN linux-2.4.24.org/Documentation/i2c/writing-clients linux-2.4.24/Documentation/i2c/writing-clients
+--- linux-2.4.24.org/Documentation/i2c/writing-clients 2004-01-19 00:57:38.359637061 +0100
++++ linux-2.4.24/Documentation/i2c/writing-clients 2004-01-19 01:38:00.209129080 +0100
@@ -24,16 +24,14 @@
routines, a client structure specific information like the actual I2C
address.
Extra client data
---- linux-old/drivers/i2c/i2c-adap-ibm_ocp.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-adap-ibm_ocp.c Sun Jan 18 23:58:19 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-adap-ibm_ocp.c linux-2.4.24/drivers/i2c/i2c-adap-ibm_ocp.c
+--- linux-2.4.24.org/drivers/i2c/i2c-adap-ibm_ocp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-adap-ibm_ocp.c 2004-01-19 01:38:00.568054509 +0100
@@ -0,0 +1,346 @@
+/*
+ -------------------------------------------------------------------------
+
+module_init(iic_ibmocp_init);
+module_exit(iic_ibmocp_exit);
---- linux-old/drivers/i2c/i2c-algo-8xx.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-algo-8xx.c Sun Jan 18 23:58:19 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-algo-8xx.c linux-2.4.24/drivers/i2c/i2c-algo-8xx.c
+--- linux-2.4.24.org/drivers/i2c/i2c-algo-8xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-algo-8xx.c 2004-01-19 01:38:00.572053678 +0100
@@ -0,0 +1,616 @@
+/*
+ * i2c-algo-8xx.c i2x driver algorithms for MPC8XX CPM
+MODULE_AUTHOR("Brad Parker <brad@heeltoe.com>");
+MODULE_DESCRIPTION("I2C-Bus MPC8XX algorithm");
+MODULE_LICENSE("GPL");
---- linux-old/include/linux/i2c-algo-8xx.h Thu Jan 1 00:00:00 1970
-+++ linux/include/linux/i2c-algo-8xx.h Sun Jan 18 23:58:19 2004
-@@ -0,0 +1,43 @@
-+/* ------------------------------------------------------------------------- */
-+/* i2c-algo-8xx.h i2c driver algorithms for MPX8XX CPM */
-+/*
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-+/* ------------------------------------------------------------------------- */
-+
-+/* $Id$ */
-+
-+#ifndef _LINUX_I2C_ALGO_8XX_H
-+#define _LINUX_I2C_ALGO_8XX_H
-+
-+#include "asm/commproc.h"
-+
-+struct i2c_algo_8xx_data {
-+ uint dp_addr;
-+ int reloc;
-+ volatile i2c8xx_t *i2c;
-+ volatile iic_t *iip;
-+ volatile cpm8xx_t *cp;
-+
-+ int (*setisr) (int irq,
-+ void (*func)(void *, void *),
-+ void *data);
-+
-+ u_char temp[513];
-+};
-+
-+int i2c_8xx_add_bus(struct i2c_adapter *);
-+int i2c_8xx_del_bus(struct i2c_adapter *);
-+
-+#endif /* _LINUX_I2C_ALGO_8XX_H */
---- linux-old/drivers/i2c/i2c-algo-bit.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-algo-bit.c Sun Jan 18 23:58:20 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-algo-bit.c linux-2.4.24/drivers/i2c/i2c-algo-bit.c
+--- linux-2.4.24.org/drivers/i2c/i2c-algo-bit.c 2004-01-19 00:55:48.051624305 +0100
++++ linux-2.4.24/drivers/i2c/i2c-algo-bit.c 2004-01-19 01:38:00.761014419 +0100
@@ -18,24 +18,22 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* ------------------------------------------------------------------------- */
-{
-}
-#endif
---- linux-old/include/linux/i2c-algo-bit.h Mon Dec 11 21:15:41 2000
-+++ linux/include/linux/i2c-algo-bit.h Sun Jan 18 23:58:20 2004
-@@ -21,12 +21,10 @@
- /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
- Frodo Looijaard <frodol@dds.nl> */
-
--/* $Id$ */
-+/* $Id$ */
-
--#ifndef I2C_ALGO_BIT_H
--#define I2C_ALGO_BIT_H 1
--
--#include <linux/i2c.h>
-+#ifndef _LINUX_I2C_ALGO_BIT_H
-+#define _LINUX_I2C_ALGO_BIT_H
-
- /* --- Defines for bit-adapters --------------------------------------- */
- /*
-@@ -42,9 +40,10 @@
- int (*getscl) (void *data);
-
- /* local settings */
-- int udelay;
-- int mdelay;
-- int timeout;
-+ int udelay; /* half-clock-cycle time in microsecs */
-+ /* i.e. clock is (500 / udelay) KHz */
-+ int mdelay; /* in millisecs, unused */
-+ int timeout; /* in jiffies */
- };
-
- #define I2C_BIT_ADAP_MAX 16
-@@ -52,4 +51,4 @@
- int i2c_bit_add_bus(struct i2c_adapter *);
- int i2c_bit_del_bus(struct i2c_adapter *);
-
--#endif /* I2C_ALGO_BIT_H */
-+#endif /* _LINUX_I2C_ALGO_BIT_H */
---- linux-old/drivers/i2c/i2c-algo-ibm_ocp.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-algo-ibm_ocp.c Sun Jan 18 23:58:21 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-algo-ibm_ocp.c linux-2.4.24/drivers/i2c/i2c-algo-ibm_ocp.c
+--- linux-2.4.24.org/drivers/i2c/i2c-algo-ibm_ocp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-algo-ibm_ocp.c 2004-01-19 01:38:01.767805246 +0100
@@ -0,0 +1,901 @@
+/*
+ -------------------------------------------------------------------------
+MODULE_PARM_DESC(i2c_debug,
+ "debug level - 0 off; 1 normal; 2,3 more verbose; 9 iic-protocol");
+
---- linux-old/include/linux/i2c-algo-ibm_ocp.h Thu Jan 1 00:00:00 1970
-+++ linux/include/linux/i2c-algo-ibm_ocp.h Sun Jan 18 23:58:21 2004
-@@ -0,0 +1,52 @@
-+/* ------------------------------------------------------------------------- */
-+/* i2c-algo-ibm_ocp.h i2c driver algorithms for IBM PPC 405 IIC adapters */
-+/* ------------------------------------------------------------------------- */
-+/* Copyright (C) 1995-97 Simon G. Vogl
-+ 1998-99 Hans Berglund
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-+/* ------------------------------------------------------------------------- */
-+
-+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
-+ Frodo Looijaard <frodol@dds.nl> */
-+
-+/* Modifications by MontaVista Software, August 2000
-+ Changes made to support the IIC peripheral on the IBM PPC 405 */
-+
-+#ifndef _LINUX_I2C_ALGO_IBM_OCP_H
-+#define _LINUX_I2C_ALGO_IBM_OCP_H
-+
-+struct i2c_algo_iic_data {
-+ struct iic_regs *data; /* private data for lolevel routines */
-+ void (*setiic) (void *data, int ctl, int val);
-+ int (*getiic) (void *data, int ctl);
-+ int (*getown) (void *data);
-+ int (*getclock) (void *data);
-+ void (*waitforpin) (void *data);
-+
-+ /* local settings */
-+ int udelay;
-+ int mdelay;
-+ int timeout;
-+};
-+
-+
-+#define I2C_IIC_ADAP_MAX 16
-+
-+
-+int i2c_ocp_add_bus(struct i2c_adapter *);
-+int i2c_ocp_del_bus(struct i2c_adapter *);
-+
-+#endif /* _LINUX_I2C_ALGO_IBM_OCP_H */
---- linux-old/drivers/i2c/i2c-algo-pcf.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-algo-pcf.c Sun Jan 18 23:58:21 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-algo-pcf.c linux-2.4.24/drivers/i2c/i2c-algo-pcf.c
+--- linux-2.4.24.org/drivers/i2c/i2c-algo-pcf.c 2004-01-19 00:55:48.234586174 +0100
++++ linux-2.4.24/drivers/i2c/i2c-algo-pcf.c 2004-01-19 01:38:01.845789044 +0100
@@ -32,14 +32,11 @@
#include <linux/delay.h>
#include <linux/slab.h>
-{
-}
-#endif
---- linux-old/include/linux/i2c-algo-pcf.h Mon Dec 11 21:22:34 2000
-+++ linux/include/linux/i2c-algo-pcf.h Sun Jan 18 23:58:21 2004
-@@ -22,13 +22,12 @@
- /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
- Frodo Looijaard <frodol@dds.nl> */
-
--/* $Id$ */
-+/* $Id$ */
-
--#ifndef I2C_ALGO_PCF_H
--#define I2C_ALGO_PCF_H 1
-+#ifndef _LINUX_I2C_ALGO_PCF_H
-+#define _LINUX_I2C_ALGO_PCF_H
-
--/* --- Defines for pcf-adapters --------------------------------------- */
--#include <linux/i2c.h>
-+#include <linux/i2c-pcf8584.h>
-
- struct i2c_algo_pcf_data {
- void *data; /* private data for lolevel routines */
-@@ -49,4 +48,4 @@
- int i2c_pcf_add_bus(struct i2c_adapter *);
- int i2c_pcf_del_bus(struct i2c_adapter *);
-
--#endif /* I2C_ALGO_PCF_H */
-+#endif /* _LINUX_I2C_ALGO_PCF_H */
---- linux-old/drivers/i2c/i2c-core.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-core.c Sun Jan 18 23:58:22 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-core.c linux-2.4.24/drivers/i2c/i2c-core.c
+--- linux-2.4.24.org/drivers/i2c/i2c-core.c 2004-01-19 00:55:48.021630556 +0100
++++ linux-2.4.24/drivers/i2c/i2c-core.c 2004-01-19 01:38:02.521648626 +0100
@@ -18,56 +18,33 @@
/* ------------------------------------------------------------------------- */
-#endif
+module_init(i2c_init);
+module_exit(i2c_exit);
---- linux-old/drivers/i2c/i2c-dev.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-dev.c Sun Jan 18 23:58:23 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-dev.c linux-2.4.24/drivers/i2c/i2c-dev.c
+--- linux-2.4.24.org/drivers/i2c/i2c-dev.c 2004-01-19 00:55:47.817673063 +0100
++++ linux-2.4.24/drivers/i2c/i2c-dev.c 2004-01-19 01:38:03.213504884 +0100
@@ -28,9 +28,8 @@
/* The devfs code is contributed by Philipp Matthias Hahn
<pmhahn@titan.lahn.de> */
-
+module_init(i2c_dev_init);
+module_exit(i2c_dev_exit);
---- linux-old/include/linux/i2c-dev.h Fri Jun 13 14:51:38 2003
-+++ linux/include/linux/i2c-dev.h Sun Jan 18 23:58:23 2004
-@@ -19,14 +19,16 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--/* $Id$ */
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-elektor.c linux-2.4.24/drivers/i2c/i2c-elektor.c
+--- linux-2.4.24.org/drivers/i2c/i2c-elektor.c 2004-01-19 00:55:48.252582424 +0100
++++ linux-2.4.24/drivers/i2c/i2c-elektor.c 2004-01-19 01:38:04.703195383 +0100
+@@ -31,23 +31,22 @@
+ #include <linux/delay.h>
+ #include <linux/slab.h>
+ #include <linux/init.h>
++#include <linux/interrupt.h>
+ #include <linux/pci.h>
+-#include <asm/irq.h>
+-#include <asm/io.h>
-
--#ifndef I2C_DEV_H
--#define I2C_DEV_H
-+/* $Id$ */
++#include <linux/wait.h>
+ #include <linux/i2c.h>
+ #include <linux/i2c-algo-pcf.h>
+-#include <linux/i2c-elektor.h>
+-#include "i2c-pcf8584.h"
++#include <asm/io.h>
++#include <asm/irq.h>
-+#ifndef _LINUX_I2C_DEV_H
-+#define _LINUX_I2C_DEV_H
+ #define DEFAULT_BASE 0x330
+
+-static int base = 0;
+-static int irq = 0;
++static int base;
++static int irq;
+ static int clock = 0x1c;
+ static int own = 0x55;
+-static int mmapped = 0;
+-static int i2c_debug = 0;
++static int mmapped;
++static int i2c_debug;
+
+ /* vdovikin: removed static struct i2c_pcf_isa gpi; code -
+ this module in real supports only one device, due to missing arguments
+@@ -56,6 +55,7 @@
+
+ static wait_queue_head_t pcf_wait;
+ static int pcf_pending;
++static spinlock_t irq_driver_lock = SPIN_LOCK_UNLOCKED;
+
+ /* ----- global defines ----------------------------------------------- */
+ #define DEB(x) if (i2c_debug>=1) x
+@@ -63,13 +63,24 @@
+ #define DEB3(x) if (i2c_debug>=3) x
+ #define DEBE(x) x /* error messages */
- #include <linux/types.h>
--#include <linux/i2c.h>
+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
-+#define minor(d) MINOR(d)
++/* compatibility */
++#ifndef isa_readb
++#define isa_readb readb
++#endif
++
++#ifndef isa_writeb
++#define isa_writeb writeb
+#endif
++
+ /* ----- local functions ---------------------------------------------- */
- /* Some IOCTL commands are defined in <linux/i2c.h> */
- /* Note: 10-bit addresses are NOT supported! */
-@@ -45,137 +47,4 @@
- __u32 nmsgs; /* number of i2c_msgs */
- };
-
--#ifndef __KERNEL__
--
--#include <sys/ioctl.h>
--
--static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
-- int size, union i2c_smbus_data *data)
--{
-- struct i2c_smbus_ioctl_data args;
--
-- args.read_write = read_write;
-- args.command = command;
-- args.size = size;
-- args.data = data;
-- return ioctl(file,I2C_SMBUS,&args);
--}
--
--
--static inline __s32 i2c_smbus_write_quick(int file, __u8 value)
--{
-- return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL);
--}
--
--static inline __s32 i2c_smbus_read_byte(int file)
--{
-- union i2c_smbus_data data;
-- if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
-- return -1;
-- else
-- return 0x0FF & data.byte;
--}
--
--static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
--{
-- return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
-- I2C_SMBUS_BYTE,NULL);
--}
--
--static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
--{
-- union i2c_smbus_data data;
-- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
-- I2C_SMBUS_BYTE_DATA,&data))
-- return -1;
-- else
-- return 0x0FF & data.byte;
--}
--
--static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
-- __u8 value)
--{
-- union i2c_smbus_data data;
-- data.byte = value;
-- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
-- I2C_SMBUS_BYTE_DATA, &data);
--}
--
--static inline __s32 i2c_smbus_read_word_data(int file, __u8 command)
--{
-- union i2c_smbus_data data;
-- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
-- I2C_SMBUS_WORD_DATA,&data))
-- return -1;
-- else
-- return 0x0FFFF & data.word;
--}
--
--static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
-- __u16 value)
--{
-- union i2c_smbus_data data;
-- data.word = value;
-- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
-- I2C_SMBUS_WORD_DATA, &data);
--}
--
--static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value)
--{
-- union i2c_smbus_data data;
-- data.word = value;
-- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
-- I2C_SMBUS_PROC_CALL,&data))
-- return -1;
-- else
-- return 0x0FFFF & data.word;
--}
--
--
--/* Returns the number of read bytes */
--static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,
-- __u8 *values)
--{
-- union i2c_smbus_data data;
-- int i;
-- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
-- I2C_SMBUS_BLOCK_DATA,&data))
-- return -1;
-- else {
-- for (i = 1; i <= data.block[0]; i++)
-- values[i-1] = data.block[i];
-- return data.block[0];
-- }
--}
--
--static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
-- __u8 length, __u8 *values)
--{
-- union i2c_smbus_data data;
-- int i;
-- if (length > 32)
-- length = 32;
-- for (i = 1; i <= length; i++)
-- data.block[i] = values[i-1];
-- data.block[0] = length;
-- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
-- I2C_SMBUS_BLOCK_DATA, &data);
--}
--
--static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
-- __u8 length, __u8 *values)
--{
-- union i2c_smbus_data data;
-- int i;
-- if (length > 32)
-- length = 32;
-- for (i = 1; i <= length; i++)
-- data.block[i] = values[i-1];
-- data.block[0] = length;
-- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
-- I2C_SMBUS_I2C_BLOCK_DATA, &data);
--}
--
--#endif /* ndef __KERNEL__ */
--
--#endif
-+#endif /* _LINUX_I2C_DEV_H */
---- linux-old/drivers/i2c/i2c-elektor.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-elektor.c Sun Jan 18 23:58:23 2004
-@@ -31,23 +31,22 @@
- #include <linux/delay.h>
- #include <linux/slab.h>
- #include <linux/init.h>
-+#include <linux/interrupt.h>
- #include <linux/pci.h>
--#include <asm/irq.h>
--#include <asm/io.h>
--
-+#include <linux/wait.h>
- #include <linux/i2c.h>
- #include <linux/i2c-algo-pcf.h>
--#include <linux/i2c-elektor.h>
--#include "i2c-pcf8584.h"
-+#include <asm/io.h>
-+#include <asm/irq.h>
-
- #define DEFAULT_BASE 0x330
-
--static int base = 0;
--static int irq = 0;
-+static int base;
-+static int irq;
- static int clock = 0x1c;
- static int own = 0x55;
--static int mmapped = 0;
--static int i2c_debug = 0;
-+static int mmapped;
-+static int i2c_debug;
-
- /* vdovikin: removed static struct i2c_pcf_isa gpi; code -
- this module in real supports only one device, due to missing arguments
-@@ -56,6 +55,7 @@
-
- static wait_queue_head_t pcf_wait;
- static int pcf_pending;
-+static spinlock_t irq_driver_lock = SPIN_LOCK_UNLOCKED;
-
- /* ----- global defines ----------------------------------------------- */
- #define DEB(x) if (i2c_debug>=1) x
-@@ -63,13 +63,24 @@
- #define DEB3(x) if (i2c_debug>=3) x
- #define DEBE(x) x /* error messages */
-
-+
-+/* compatibility */
-+#ifndef isa_readb
-+#define isa_readb readb
-+#endif
-+
-+#ifndef isa_writeb
-+#define isa_writeb writeb
-+#endif
-+
- /* ----- local functions ---------------------------------------------- */
-
- static void pcf_isa_setbyte(void *data, int ctl, int val)
- {
- int address = ctl ? (base + 1) : base;
+ static void pcf_isa_setbyte(void *data, int ctl, int val)
+ {
+ int address = ctl ? (base + 1) : base;
- if (ctl && irq) {
+ /* enable irq if any specified for serial operation */
-#endif
+module_init(i2c_pcfisa_init);
+module_exit(i2c_pcfisa_exit);
---- linux-old/include/linux/i2c-elektor.h Thu Oct 11 15:05:47 2001
-+++ linux/include/linux/i2c-elektor.h Sun Jan 18 23:58:23 2004
-@@ -1,47 +0,0 @@
--/* ------------------------------------------------------------------------- */
--/* i2c-elektor.c i2c-hw access for PCF8584 style isa bus adaptes */
--/* ------------------------------------------------------------------------- */
--/* Copyright (C) 1995-97 Simon G. Vogl
-- 1998-99 Hans Berglund
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
--/* ------------------------------------------------------------------------- */
--
--/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
-- Frodo Looijaard <frodol@dds.nl> */
--
--/* $Id$ */
--
--#ifndef I2C_PCF_ELEKTOR_H
--#define I2C_PCF_ELEKTOR_H 1
--
--/*
-- * This struct contains the hw-dependent functions of PCF8584 adapters to
-- * manipulate the registers, and to init any hw-specific features.
-- * vdovikin: removed: this module in real supports only one device,
-- * due to missing arguments in some functions, called from the algo-pcf module.
-- * Sometimes it's need to be rewriten -
-- * but for now just remove this for simpler reading */
--
--/*
--struct i2c_pcf_isa {
-- int pi_base;
-- int pi_irq;
-- int pi_clock;
-- int pi_own;
--};
--*/
--
--#endif /* PCF_ELEKTOR_H */
---- linux-old/drivers/i2c/i2c-elv.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-elv.c Sun Jan 18 23:58:23 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-elv.c linux-2.4.24/drivers/i2c/i2c-elv.c
+--- linux-2.4.24.org/drivers/i2c/i2c-elv.c 2004-01-19 00:55:48.270578673 +0100
++++ linux-2.4.24/drivers/i2c/i2c-elv.c 2004-01-19 01:38:05.664995558 +0100
@@ -21,21 +21,18 @@
/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
Frodo Looijaard <frodol@dds.nl> */
-#endif
+module_init(i2c_bitelv_init);
+module_exit(i2c_bitelv_exit);
---- linux-old/drivers/i2c/i2c-frodo.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-frodo.c Sun Jan 18 23:58:24 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-frodo.c linux-2.4.24/drivers/i2c/i2c-frodo.c
+--- linux-2.4.24.org/drivers/i2c/i2c-frodo.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-frodo.c 2004-01-19 01:38:06.299863657 +0100
@@ -0,0 +1,83 @@
+
+/*
+module_init (i2c_frodo_init);
+module_exit (i2c_frodo_exit);
+
---- linux-old/include/linux/i2c-id.h Sun Jan 18 23:42:13 2004
-+++ linux/include/linux/i2c-id.h Sun Jan 18 23:58:24 2004
-@@ -20,10 +20,11 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- /* ------------------------------------------------------------------------- */
-
--/* $Id$ */
-+/* $Id$ */
-+
-+#ifndef LINUX_I2C_ID_H
-+#define LINUX_I2C_ID_H
-
--#ifndef I2C_ID_H
--#define I2C_ID_H
- /*
- * This file is part of the i2c-bus package and contains the identifier
- * values for drivers, adapters and other folk populating these serial
-@@ -90,10 +91,25 @@
- #define I2C_DRIVERID_DRP3510 43 /* ADR decoder (Astra Radio) */
- #define I2C_DRIVERID_SP5055 44 /* Satellite tuner */
- #define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */
-+#define I2C_DRIVERID_SAA7108 46 /* video decoder, image scaler */
-+#define I2C_DRIVERID_DS1307 47 /* DS1307 real time clock */
- #define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */
--#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
--#define I2C_DRIVERID_SAA7191 57 /* video decoder */
--#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
-+#define I2C_DRIVERID_ZR36067 49 /* Zoran 36067 video encoder */
-+#define I2C_DRIVERID_ZR36120 50 /* Zoran 36120 video encoder */
-+#define I2C_DRIVERID_24LC32A 51 /* Microchip 24LC32A 32k EEPROM */
-+#define I2C_DRIVERID_STM41T00 52 /* real time clock */
-+#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */
-+#define I2C_DRIVERID_ADV7170 54 /* video encoder */
-+#define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */
-+#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
-+#define I2C_DRIVERID_SAA7191 57 /* video encoder */
-+#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
-+#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */
-+#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */
-+#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */
-+#define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */
-+
-+
-
- #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
- #define I2C_DRIVERID_EXP1 0xF1
-@@ -102,6 +118,8 @@
-
- #define I2C_DRIVERID_I2CDEV 900
- #define I2C_DRIVERID_I2CPROC 901
-+#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
-+#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */
-
- /* IDs -- Use DRIVERIDs 1000-1999 for sensors.
- These were originally in sensors.h in the lm_sensors package */
-@@ -131,6 +149,26 @@
- #define I2C_DRIVERID_ADM1024 1025
- #define I2C_DRIVERID_IT87 1026
- #define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
-+#define I2C_DRIVERID_FSCPOS 1028
-+#define I2C_DRIVERID_FSCSCY 1029
-+#define I2C_DRIVERID_PCF8591 1030
-+#define I2C_DRIVERID_SMSC47M1 1031
-+#define I2C_DRIVERID_VT1211 1032
-+#define I2C_DRIVERID_LM92 1033
-+#define I2C_DRIVERID_VT8231 1034
-+#define I2C_DRIVERID_SMARTBATT 1035
-+#define I2C_DRIVERID_BMCSENSORS 1036
-+#define I2C_DRIVERID_FS451 1037
-+#define I2C_DRIVERID_W83627HF 1038
-+#define I2C_DRIVERID_LM85 1039
-+#define I2C_DRIVERID_LM83 1040
-+#define I2C_DRIVERID_SAA1064 1041
-+#define I2C_DRIVERID_LM90 1042
-+#define I2C_DRIVERID_ASB100 1043
-+#define I2C_DRIVERID_MAX6650 1044
-+#define I2C_DRIVERID_XEONTEMP 1045
-+#define I2C_DRIVERID_FSCHER 1046
-+#define I2C_DRIVERID_W83L785TS 1047
-
- /*
- * ---- Adapter types ----------------------------------------------------
-@@ -147,14 +185,21 @@
- #define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */
- #define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */
- #define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */
--
-+#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */
-+#define I2C_ALGO_SAA7134 0x090000
-+#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */
-+#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */
-+#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */
-+#define I2C_ALGO_MPC107 0x0d0000
- #define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */
-
- #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
--
--#define I2C_ALGO_SIBYTE 0x120000 /* Broadcom SiByte SOCs */
--
--#define I2C_ALGO_SGI 0x130000 /* SGI algorithm */
-+#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */
-+#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */
-+#define I2C_ALGO_OCP_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */
-+#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
-+#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
-+#define I2C_ALGO_USB 0x170000 /* USB algorithm */
-
- #define I2C_ALGO_EXP 0x800000 /* experimental */
-
-@@ -182,27 +227,45 @@
- #define I2C_HW_B_I810 0x0a /* Intel I810 */
- #define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */
- #define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */
-+#define I2C_HW_B_SAVG 0x0d /* Savage 4 */
-+#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */
- #define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */
- #define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */
- #define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */
-+#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */
-+#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */
-+#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */
-+#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */
-+#define I2C_HW_B_IXP425 0x17 /* GPIO on IXP425 systems */
-+#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */
-+#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */
-+#define I2C_HW_B_PCILYNX 0x20 /* TI PCILynx I2C adapter */
-
- /* --- PCF 8584 based algorithms */
- #define I2C_HW_P_LP 0x00 /* Parallel port interface */
- #define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */
- #define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */
-
-+/* --- USB based adapters */
-+#define I2C_HW_USB_USBVISION 0x00
-+
- /* --- ACPI Embedded controller algorithms */
- #define I2C_HW_ACPI_EC 0x00
-
-+/* --- MPC824x PowerPC adapters */
-+#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */
-+
- /* --- MPC8xx PowerPC adapters */
- #define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */
-
--/* --- Broadcom SiByte adapters */
--#define I2C_HW_SIBYTE 0x00
-+/* --- ITE based algorithms */
-+#define I2C_HW_I_IIC 0x00 /* controller on the ITE */
-+
-+/* --- PowerPC on-chip adapters */
-+#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */
-
--/* --- SGI adapters */
--#define I2C_HW_SGI_VINO 0x00
--#define I2C_HW_SGI_MACE 0x01
-+/* --- XSCALE on-chip adapters */
-+#define I2C_HW_IOP321 0x00
-
- /* --- SMBus only adapters */
- #define I2C_HW_SMBUS_PIIX4 0x00
-@@ -213,9 +276,27 @@
- #define I2C_HW_SMBUS_AMD756 0x05
- #define I2C_HW_SMBUS_SIS5595 0x06
- #define I2C_HW_SMBUS_ALI1535 0x07
-+#define I2C_HW_SMBUS_SIS630 0x08
-+#define I2C_HW_SMBUS_SIS645 0x09
-+#define I2C_HW_SMBUS_AMD8111 0x0a
-+#define I2C_HW_SMBUS_SCX200 0x0b
-+#define I2C_HW_SMBUS_NFORCE2 0x0c
- #define I2C_HW_SMBUS_W9968CF 0x0d
-+#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */
-+#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */
-+#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */
-+#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress Ez-USB FX2 USB 2.0 */
-
- /* --- ISA pseudo-adapter */
- #define I2C_HW_ISA 0x00
-
--#endif /* I2C_ID_H */
-+/* --- IPMI pseudo-adapter */
-+#define I2C_HW_IPMI 0x00
-+
-+/* --- IPMB adapter */
-+#define I2C_HW_IPMB 0x00
-+
-+/* --- MCP107 adapter */
-+#define I2C_HW_MPC107 0x00
-+
-+#endif /* LINUX_I2C_ID_H */
---- linux-old/drivers/i2c/i2c-pcf-epp.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-pcf-epp.c Sun Jan 18 23:58:24 2004
-@@ -0,0 +1,281 @@
-+/* ------------------------------------------------------------------------- */
-+/* i2c-pcf-epp.c i2c-hw access for PCF8584 style EPP parallel port adapters */
-+/* ------------------------------------------------------------------------- */
-+/* Copyright (C) 1998-99 Hans Berglund
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-pcf-epp.c linux-2.4.24/drivers/i2c/i2c-pcf-epp.c
+--- linux-2.4.24.org/drivers/i2c/i2c-pcf-epp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-pcf-epp.c 2004-01-19 01:38:06.775764783 +0100
+@@ -0,0 +1,281 @@
++/* ------------------------------------------------------------------------- */
++/* i2c-pcf-epp.c i2c-hw access for PCF8584 style EPP parallel port adapters */
++/* ------------------------------------------------------------------------- */
++/* Copyright (C) 1998-99 Hans Berglund
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+
+module_init(i2c_pcfepp_init);
+module_exit(pcf_epp_exit);
---- linux-old/include/linux/i2c-pcf8584.h Thu Jan 1 00:00:00 1970
-+++ linux/include/linux/i2c-pcf8584.h Sun Jan 18 23:58:24 2004
-@@ -0,0 +1,78 @@
-+/* -------------------------------------------------------------------- */
-+/* i2c-pcf8584.h: PCF 8584 global defines */
-+/* -------------------------------------------------------------------- */
-+/* Copyright (C) 1996 Simon G. Vogl
-+ 1999 Hans Berglund
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-+/* -------------------------------------------------------------------- */
-+
-+/* With some changes from Frodo Looijaard <frodol@dds.nl> */
-+
-+/* $Id$ */
-+
-+#ifndef _LINUX_I2C_PCF8584_H
-+#define _LINUX_I2C_PCF8584_H
-+
-+/* ----- Control register bits ---------------------------------------- */
-+#define I2C_PCF_PIN 0x80
-+#define I2C_PCF_ESO 0x40
-+#define I2C_PCF_ES1 0x20
-+#define I2C_PCF_ES2 0x10
-+#define I2C_PCF_ENI 0x08
-+#define I2C_PCF_STA 0x04
-+#define I2C_PCF_STO 0x02
-+#define I2C_PCF_ACK 0x01
-+
-+#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
-+#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
-+#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
-+#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
-+
-+/* ----- Status register bits ----------------------------------------- */
-+/*#define I2C_PCF_PIN 0x80 as above*/
-+
-+#define I2C_PCF_INI 0x40 /* 1 if not initialized */
-+#define I2C_PCF_STS 0x20
-+#define I2C_PCF_BER 0x10
-+#define I2C_PCF_AD0 0x08
-+#define I2C_PCF_LRB 0x08
-+#define I2C_PCF_AAS 0x04
-+#define I2C_PCF_LAB 0x02
-+#define I2C_PCF_BB 0x01
-+
-+/* ----- Chip clock frequencies --------------------------------------- */
-+#define I2C_PCF_CLK3 0x00
-+#define I2C_PCF_CLK443 0x10
-+#define I2C_PCF_CLK6 0x14
-+#define I2C_PCF_CLK 0x18
-+#define I2C_PCF_CLK12 0x1c
-+
-+/* ----- transmission frequencies ------------------------------------- */
-+#define I2C_PCF_TRNS90 0x00 /* 90 kHz */
-+#define I2C_PCF_TRNS45 0x01 /* 45 kHz */
-+#define I2C_PCF_TRNS11 0x02 /* 11 kHz */
-+#define I2C_PCF_TRNS15 0x03 /* 1.5 kHz */
-+
-+
-+/* ----- Access to internal registers according to ES1,ES2 ------------ */
-+/* they are mapped to the data port ( a0 = 0 ) */
-+/* available when ESO == 0 : */
-+
-+#define I2C_PCF_OWNADR 0
-+#define I2C_PCF_INTREG I2C_PCF_ES2
-+#define I2C_PCF_CLKREG I2C_PCF_ES1
-+
-+#endif /* _LINUX_I2C_PCF8584_H */
---- linux-old/drivers/i2c/i2c-philips-par.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-philips-par.c Sun Jan 18 23:58:24 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-philips-par.c linux-2.4.24/drivers/i2c/i2c-philips-par.c
+--- linux-2.4.24.org/drivers/i2c/i2c-philips-par.c 2004-01-19 00:55:48.322567838 +0100
++++ linux-2.4.24/drivers/i2c/i2c-philips-par.c 2004-01-19 01:38:06.801759382 +0100
@@ -21,7 +21,7 @@
/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
Frodo Looijaard <frodol@dds.nl> */
-#endif
+module_init(i2c_bitlp_init);
+module_exit(i2c_bitlp_exit);
---- linux-old/drivers/i2c/i2c-pport.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-pport.c Sun Jan 18 23:58:25 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-pport.c linux-2.4.24/drivers/i2c/i2c-pport.c
+--- linux-2.4.24.org/drivers/i2c/i2c-pport.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-pport.c 2004-01-19 01:38:07.237668817 +0100
@@ -0,0 +1,205 @@
+/* ------------------------------------------------------------------------- */
+/* i2c-pport.c i2c-hw access for primitive i2c par. port adapter */
+
+module_init(i2c_bitpport_init);
+module_exit(i2c_bitpport_exit);
---- linux-old/drivers/i2c/i2c-proc.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-proc.c Sun Jan 18 23:58:25 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-proc.c linux-2.4.24/drivers/i2c/i2c-proc.c
+--- linux-2.4.24.org/drivers/i2c/i2c-proc.c 2004-01-19 00:55:48.174598676 +0100
++++ linux-2.4.24/drivers/i2c/i2c-proc.c 2004-01-19 01:38:07.267662585 +0100
@@ -29,23 +29,15 @@
#include <linux/ctype.h>
#include <linux/sysctl.h>
-#endif /* MODULE */
+module_init(i2c_proc_init);
+module_exit(i2c_proc_exit);
---- linux-old/include/linux/i2c-proc.h Thu Oct 11 15:05:47 2001
-+++ linux/include/linux/i2c-proc.h Sun Jan 18 23:58:26 2004
-@@ -1,6 +1,7 @@
- /*
-- sensors.h - Part of lm_sensors, Linux kernel modules for hardware
-- monitoring
-+ i2c-proc.h - Part of the i2c package
-+ was originally sensors.h - Part of lm_sensors, Linux kernel modules
-+ for hardware monitoring
- Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
-
- This program is free software; you can redistribute it and/or modify
-@@ -18,14 +19,9 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
--#ifndef SENSORS_SENSORS_H
--#define SENSORS_SENSORS_H
-+#ifndef _LINUX_I2C_PROC_H
-+#define _LINUX_I2C_PROC_H
-
--#ifdef __KERNEL__
--
--/* Next two must be included before sysctl.h can be included, in 2.0 kernels */
--#include <linux/types.h>
--#include <linux/fs.h>
- #include <linux/sysctl.h>
-
- /* The type of callback functions used in sensors_{proc,sysctl}_real */
-@@ -73,8 +69,7 @@
- these functions must be updated! */
- extern int i2c_register_entry(struct i2c_client *client,
- const char *prefix,
-- ctl_table * ctl_template,
-- struct module *controlling_mod);
-+ ctl_table * ctl_template);
-
- extern void i2c_deregister_entry(int id);
-
-@@ -347,6 +342,31 @@
- {NULL}}; \
- SENSORS_INSMOD
-
-+#define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \
-+ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \
-+ SENSORS_MODULE_PARM(force, \
-+ "List of adapter,address pairs to boldly assume " \
-+ "to be present"); \
-+ SENSORS_MODULE_PARM_FORCE(chip1); \
-+ SENSORS_MODULE_PARM_FORCE(chip2); \
-+ SENSORS_MODULE_PARM_FORCE(chip3); \
-+ SENSORS_MODULE_PARM_FORCE(chip4); \
-+ SENSORS_MODULE_PARM_FORCE(chip5); \
-+ SENSORS_MODULE_PARM_FORCE(chip6); \
-+ SENSORS_MODULE_PARM_FORCE(chip7); \
-+ SENSORS_MODULE_PARM_FORCE(chip8); \
-+ static struct i2c_force_data forces[] = {{force,any_chip}, \
-+ {force_ ## chip1,chip1}, \
-+ {force_ ## chip2,chip2}, \
-+ {force_ ## chip3,chip3}, \
-+ {force_ ## chip4,chip4}, \
-+ {force_ ## chip5,chip5}, \
-+ {force_ ## chip6,chip6}, \
-+ {force_ ## chip7,chip7}, \
-+ {force_ ## chip8,chip8}, \
-+ {NULL}}; \
-+ SENSORS_INSMOD
-+
- typedef int i2c_found_addr_proc(struct i2c_adapter *adapter,
- int addr, unsigned short flags,
- int kind);
-@@ -362,7 +382,7 @@
-
- /* This macro is used to scale user-input to sensible values in almost all
- chip drivers. */
--extern inline int SENSORS_LIMIT(long value, long low, long high)
-+static inline int SENSORS_LIMIT(long value, long low, long high)
- {
- if (value < low)
- return low;
-@@ -372,8 +392,6 @@
- return value;
- }
-
--#endif /* def __KERNEL__ */
--
-
- /* The maximum length of the prefix */
- #define SENSORS_PREFIX_MAX 20
-@@ -392,5 +410,5 @@
- char name[SENSORS_PREFIX_MAX + 13];
- };
-
--#endif /* def SENSORS_SENSORS_H */
-+#endif /* def _LINUX_I2C_PROC_H */
-
---- linux-old/drivers/i2c/i2c-rpx.c Thu Jan 1 00:00:00 1970
-+++ linux/drivers/i2c/i2c-rpx.c Sun Jan 18 23:58:26 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-rpx.c linux-2.4.24/drivers/i2c/i2c-rpx.c
+--- linux-2.4.24.org/drivers/i2c/i2c-rpx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/drivers/i2c/i2c-rpx.c 2004-01-19 01:38:08.185471900 +0100
@@ -0,0 +1,101 @@
+/*
+ * Embedded Planet RPX Lite MPC8xx CPM I2C interface.
+
+module_init(i2c_rpx_init);
+module_exit(i2c_rpx_exit);
---- linux-old/drivers/i2c/i2c-velleman.c Sun Jan 18 23:41:50 2004
-+++ linux/drivers/i2c/i2c-velleman.c Sun Jan 18 23:58:26 2004
+diff -urN linux-2.4.24.org/drivers/i2c/i2c-velleman.c linux-2.4.24/drivers/i2c/i2c-velleman.c
+--- linux-2.4.24.org/drivers/i2c/i2c-velleman.c 2004-01-19 00:55:48.331565963 +0100
++++ linux-2.4.24/drivers/i2c/i2c-velleman.c 2004-01-19 01:38:08.250458398 +0100
@@ -18,18 +18,18 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* ------------------------------------------------------------------------- */
-#endif
+module_init(i2c_bitvelle_init);
+module_exit(i2c_bitvelle_exit);
---- linux-old/include/linux/i2c.h Sun Jan 18 23:42:13 2004
-+++ linux/include/linux/i2c.h Sun Jan 18 23:58:27 2004
-@@ -23,36 +23,33 @@
- /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
- Frodo Looijaard <frodol@dds.nl> */
-
--/* $Id$ */
-+/* $Id$ */
-
--#ifndef I2C_H
--#define I2C_H
-+#ifndef _LINUX_I2C_H
-+#define _LINUX_I2C_H
-
--#define I2C_DATE "20010830"
--#define I2C_VERSION "2.6.1"
-+#define I2C_DATE "20040115"
-+#define I2C_VERSION "2.8.3"
+diff -urN linux-2.4.24.org/drivers/i2c/scx200_acb.c linux-2.4.24/drivers/i2c/scx200_acb.c
+--- linux-2.4.24.org/drivers/i2c/scx200_acb.c 2004-01-19 00:55:48.149603885 +0100
++++ linux-2.4.24/drivers/i2c/scx200_acb.c 2004-01-19 01:41:26.143347097 +0100
+@@ -408,16 +408,6 @@
+ return 0;
+ }
--#include <linux/i2c-id.h> /* id values of adapters et. al. */
-+#include <linux/module.h>
- #include <linux/types.h>
--
--
--struct i2c_msg;
+-static void scx200_acb_inc_use(struct i2c_adapter *adapter)
+-{
+- MOD_INC_USE_COUNT;
+-}
-
+-static void scx200_acb_dec_use(struct i2c_adapter *adapter)
+-{
+- MOD_DEC_USE_COUNT;
+-}
-
--#ifdef __KERNEL__
+ /* For now, we only handle combined mode (smbus) */
+ static struct i2c_algorithm scx200_acb_algorithm = {
+ name: "NatSemi SCx200 ACCESS.bus",
+@@ -482,8 +472,6 @@
+ sprintf(adapter->name, "SCx200 ACB%d", index);
+ adapter->id = I2C_ALGO_SMBUS;
+ adapter->algo = &scx200_acb_algorithm;
+- adapter->inc_use = scx200_acb_inc_use;
+- adapter->dec_use = scx200_acb_dec_use;
+ adapter->client_register = scx200_acb_reg;
+ adapter->client_unregister = scx200_acb_unreg;
+
+diff -urN linux-2.4.24.org/drivers/i2c/scx200_i2c.c linux-2.4.24/drivers/i2c/scx200_i2c.c
+--- linux-2.4.24.org/drivers/i2c/scx200_i2c.c 2004-01-19 00:55:48.103613470 +0100
++++ linux-2.4.24/drivers/i2c/scx200_i2c.c 2004-01-19 01:41:09.572789315 +0100
+@@ -76,16 +76,6 @@
+ return 0;
+ }
+
+-static void scx200_i2c_inc_use(struct i2c_adapter *adap)
+-{
+- MOD_INC_USE_COUNT;
+-}
-
--/* --- Includes and compatibility declarations ------------------------ */
+-static void scx200_i2c_dec_use(struct i2c_adapter *adap)
+-{
+- MOD_DEC_USE_COUNT;
+-}
-
-+#include <linux/errno.h>
-+#include <linux/sched.h>
- #include <asm/semaphore.h>
--#include <linux/config.h>
-+#include <linux/i2c-id.h>
+ /* ------------------------------------------------------------------------
+ * Encapsulate the above functions in the correct operations structure.
+ * This is only done when more than one hardware adapter is supported.
+@@ -104,8 +94,6 @@
+ .name = "NatSemi SCx200 I2C",
+ .id = I2C_HW_B_VELLE,
+ .algo_data = &scx200_i2c_data,
+- .inc_use = scx200_i2c_inc_use,
+- .dec_use = scx200_i2c_dec_use,
+ .client_register = scx200_i2c_reg,
+ .client_unregister = scx200_i2c_unreg,
+ };
+diff -urN linux-2.4.24.org/include/linux/i2c-algo-8xx.h linux-2.4.24/include/linux/i2c-algo-8xx.h
+--- linux-2.4.24.org/include/linux/i2c-algo-8xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/include/linux/i2c-algo-8xx.h 2004-01-19 01:38:00.671033114 +0100
+@@ -0,0 +1,43 @@
++/* ------------------------------------------------------------------------- */
++/* i2c-algo-8xx.h i2c driver algorithms for MPX8XX CPM */
++/*
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
+
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
-+#define MODULE_LICENSE(x)
-+#endif
-
- /* --- General options ------------------------------------------------ */
-
--#define I2C_ALGO_MAX 4 /* control memory consumption */
--#define I2C_ADAP_MAX 16
-+#define I2C_ADAP_MAX 16 /* control memory consumption */
- #define I2C_DRIVER_MAX 16
- #define I2C_CLIENT_MAX 32
--#define I2C_DUMMY_MAX 4
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
++/* ------------------------------------------------------------------------- */
++
++/* $Id$ */
++
++#ifndef _LINUX_I2C_ALGO_8XX_H
++#define _LINUX_I2C_ALGO_8XX_H
++
++#include "asm/commproc.h"
++
++struct i2c_algo_8xx_data {
++ uint dp_addr;
++ int reloc;
++ volatile i2c8xx_t *i2c;
++ volatile iic_t *iip;
++ volatile cpm8xx_t *cp;
++
++ int (*setisr) (int irq,
++ void (*func)(void *, void *),
++ void *data);
++
++ u_char temp[513];
++};
++
++int i2c_8xx_add_bus(struct i2c_adapter *);
++int i2c_8xx_del_bus(struct i2c_adapter *);
++
++#endif /* _LINUX_I2C_ALGO_8XX_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-algo-bit.h linux-2.4.24/include/linux/i2c-algo-bit.h
+--- linux-2.4.24.org/include/linux/i2c-algo-bit.h 2004-01-19 00:52:56.054475029 +0100
++++ linux-2.4.24/include/linux/i2c-algo-bit.h 2004-01-19 01:38:01.445872131 +0100
+@@ -21,12 +21,10 @@
+ /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+ Frodo Looijaard <frodol@dds.nl> */
-+struct i2c_msg;
- struct i2c_algorithm;
- struct i2c_adapter;
- struct i2c_client;
-@@ -60,7 +57,6 @@
- struct i2c_client_address_data;
- union i2c_smbus_data;
+-/* $Id$ */
++/* $Id$ */
+-#ifndef I2C_ALGO_BIT_H
+-#define I2C_ALGO_BIT_H 1
-
+-#include <linux/i2c.h>
++#ifndef _LINUX_I2C_ALGO_BIT_H
++#define _LINUX_I2C_ALGO_BIT_H
+
+ /* --- Defines for bit-adapters --------------------------------------- */
/*
- * The master routines are the ones normally used to transmit data to devices
- * on a bus (or read from them). Apart from two basic transfer functions to
-@@ -113,6 +109,8 @@
- extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
- u8 command, u8 length,
- u8 *values);
-+extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
-+ u8 command, u8 *values);
- extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
- u8 command, u8 length,
- u8 *values);
-@@ -125,6 +123,7 @@
- */
+@@ -42,9 +40,10 @@
+ int (*getscl) (void *data);
- struct i2c_driver {
-+ struct module *owner;
- char name[32];
- int id;
- unsigned int flags; /* div., see below */
-@@ -148,18 +147,6 @@
- * with the device.
- */
- int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
--
-- /* These two are mainly used for bookkeeping & dynamic unloading of
-- * kernel modules. inc_use tells the driver that a client is being
-- * used by another module & that it should increase its ref. counter.
-- * dec_use is the inverse operation.
-- * NB: Make sure you have no circular dependencies, or else you get a
-- * deadlock when trying to unload the modules.
-- * You should use the i2c_{inc,dec}_use_client functions instead of
-- * calling this function directly.
-- */
-- void (*inc_use)(struct i2c_client *client);
-- void (*dec_use)(struct i2c_client *client);
+ /* local settings */
+- int udelay;
+- int mdelay;
+- int timeout;
++ int udelay; /* half-clock-cycle time in microsecs */
++ /* i.e. clock is (500 / udelay) KHz */
++ int mdelay; /* in millisecs, unused */
++ int timeout; /* in jiffies */
};
- /*
-@@ -192,6 +179,7 @@
- * to name two of the most common.
- */
- struct i2c_algorithm {
-+ struct module *owner; /* future use --km */
- char name[32]; /* textual description */
- unsigned int id;
+ #define I2C_BIT_ADAP_MAX 16
+@@ -52,4 +51,4 @@
+ int i2c_bit_add_bus(struct i2c_adapter *);
+ int i2c_bit_del_bus(struct i2c_adapter *);
-@@ -221,16 +209,13 @@
+-#endif /* I2C_ALGO_BIT_H */
++#endif /* _LINUX_I2C_ALGO_BIT_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-algo-ibm_ocp.h linux-2.4.24/include/linux/i2c-algo-ibm_ocp.h
+--- linux-2.4.24.org/include/linux/i2c-algo-ibm_ocp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/include/linux/i2c-algo-ibm_ocp.h 2004-01-19 01:38:01.769804830 +0100
+@@ -0,0 +1,52 @@
++/* ------------------------------------------------------------------------- */
++/* i2c-algo-ibm_ocp.h i2c driver algorithms for IBM PPC 405 IIC adapters */
++/* ------------------------------------------------------------------------- */
++/* Copyright (C) 1995-97 Simon G. Vogl
++ 1998-99 Hans Berglund
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
++/* ------------------------------------------------------------------------- */
++
++/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
++ Frodo Looijaard <frodol@dds.nl> */
++
++/* Modifications by MontaVista Software, August 2000
++ Changes made to support the IIC peripheral on the IBM PPC 405 */
++
++#ifndef _LINUX_I2C_ALGO_IBM_OCP_H
++#define _LINUX_I2C_ALGO_IBM_OCP_H
++
++struct i2c_algo_iic_data {
++ struct iic_regs *data; /* private data for lolevel routines */
++ void (*setiic) (void *data, int ctl, int val);
++ int (*getiic) (void *data, int ctl);
++ int (*getown) (void *data);
++ int (*getclock) (void *data);
++ void (*waitforpin) (void *data);
++
++ /* local settings */
++ int udelay;
++ int mdelay;
++ int timeout;
++};
++
++
++#define I2C_IIC_ADAP_MAX 16
++
++
++int i2c_ocp_add_bus(struct i2c_adapter *);
++int i2c_ocp_del_bus(struct i2c_adapter *);
++
++#endif /* _LINUX_I2C_ALGO_IBM_OCP_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-algo-pcf.h linux-2.4.24/include/linux/i2c-algo-pcf.h
+--- linux-2.4.24.org/include/linux/i2c-algo-pcf.h 2004-01-19 00:52:56.079469818 +0100
++++ linux-2.4.24/include/linux/i2c-algo-pcf.h 2004-01-19 01:38:02.289696816 +0100
+@@ -22,13 +22,12 @@
+ /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+ Frodo Looijaard <frodol@dds.nl> */
+
+-/* $Id$ */
++/* $Id$ */
+
+-#ifndef I2C_ALGO_PCF_H
+-#define I2C_ALGO_PCF_H 1
++#ifndef _LINUX_I2C_ALGO_PCF_H
++#define _LINUX_I2C_ALGO_PCF_H
+
+-/* --- Defines for pcf-adapters --------------------------------------- */
+-#include <linux/i2c.h>
++#include <linux/i2c-pcf8584.h>
+
+ struct i2c_algo_pcf_data {
+ void *data; /* private data for lolevel routines */
+@@ -49,4 +48,4 @@
+ int i2c_pcf_add_bus(struct i2c_adapter *);
+ int i2c_pcf_del_bus(struct i2c_adapter *);
+
+-#endif /* I2C_ALGO_PCF_H */
++#endif /* _LINUX_I2C_ALGO_PCF_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-dev.h linux-2.4.24/include/linux/i2c-dev.h
+--- linux-2.4.24.org/include/linux/i2c-dev.h 2004-01-19 00:52:49.451851465 +0100
++++ linux-2.4.24/include/linux/i2c-dev.h 2004-01-19 01:38:04.481241497 +0100
+@@ -19,14 +19,16 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+-/* $Id$ */
+-
+-#ifndef I2C_DEV_H
+-#define I2C_DEV_H
++/* $Id$ */
+
++#ifndef _LINUX_I2C_DEV_H
++#define _LINUX_I2C_DEV_H
+
+ #include <linux/types.h>
+-#include <linux/i2c.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
++#define minor(d) MINOR(d)
++#endif
+
+ /* Some IOCTL commands are defined in <linux/i2c.h> */
+ /* Note: 10-bit addresses are NOT supported! */
+@@ -45,137 +47,4 @@
+ __u32 nmsgs; /* number of i2c_msgs */
+ };
+
+-#ifndef __KERNEL__
+-
+-#include <sys/ioctl.h>
+-
+-static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
+- int size, union i2c_smbus_data *data)
+-{
+- struct i2c_smbus_ioctl_data args;
+-
+- args.read_write = read_write;
+- args.command = command;
+- args.size = size;
+- args.data = data;
+- return ioctl(file,I2C_SMBUS,&args);
+-}
+-
+-
+-static inline __s32 i2c_smbus_write_quick(int file, __u8 value)
+-{
+- return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL);
+-}
+-
+-static inline __s32 i2c_smbus_read_byte(int file)
+-{
+- union i2c_smbus_data data;
+- if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
+- return -1;
+- else
+- return 0x0FF & data.byte;
+-}
+-
+-static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
+-{
+- return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
+- I2C_SMBUS_BYTE,NULL);
+-}
+-
+-static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
+-{
+- union i2c_smbus_data data;
+- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
+- I2C_SMBUS_BYTE_DATA,&data))
+- return -1;
+- else
+- return 0x0FF & data.byte;
+-}
+-
+-static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
+- __u8 value)
+-{
+- union i2c_smbus_data data;
+- data.byte = value;
+- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+- I2C_SMBUS_BYTE_DATA, &data);
+-}
+-
+-static inline __s32 i2c_smbus_read_word_data(int file, __u8 command)
+-{
+- union i2c_smbus_data data;
+- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
+- I2C_SMBUS_WORD_DATA,&data))
+- return -1;
+- else
+- return 0x0FFFF & data.word;
+-}
+-
+-static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
+- __u16 value)
+-{
+- union i2c_smbus_data data;
+- data.word = value;
+- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+- I2C_SMBUS_WORD_DATA, &data);
+-}
+-
+-static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value)
+-{
+- union i2c_smbus_data data;
+- data.word = value;
+- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+- I2C_SMBUS_PROC_CALL,&data))
+- return -1;
+- else
+- return 0x0FFFF & data.word;
+-}
+-
+-
+-/* Returns the number of read bytes */
+-static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,
+- __u8 *values)
+-{
+- union i2c_smbus_data data;
+- int i;
+- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
+- I2C_SMBUS_BLOCK_DATA,&data))
+- return -1;
+- else {
+- for (i = 1; i <= data.block[0]; i++)
+- values[i-1] = data.block[i];
+- return data.block[0];
+- }
+-}
+-
+-static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
+- __u8 length, __u8 *values)
+-{
+- union i2c_smbus_data data;
+- int i;
+- if (length > 32)
+- length = 32;
+- for (i = 1; i <= length; i++)
+- data.block[i] = values[i-1];
+- data.block[0] = length;
+- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+- I2C_SMBUS_BLOCK_DATA, &data);
+-}
+-
+-static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
+- __u8 length, __u8 *values)
+-{
+- union i2c_smbus_data data;
+- int i;
+- if (length > 32)
+- length = 32;
+- for (i = 1; i <= length; i++)
+- data.block[i] = values[i-1];
+- data.block[0] = length;
+- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+- I2C_SMBUS_I2C_BLOCK_DATA, &data);
+-}
+-
+-#endif /* ndef __KERNEL__ */
+-
+-#endif
++#endif /* _LINUX_I2C_DEV_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-elektor.h linux-2.4.24/include/linux/i2c-elektor.h
+--- linux-2.4.24.org/include/linux/i2c-elektor.h 2004-01-19 00:52:56.339415628 +0100
++++ linux-2.4.24/include/linux/i2c-elektor.h 2004-01-19 01:38:05.176097132 +0100
+@@ -1,47 +0,0 @@
+-/* ------------------------------------------------------------------------- */
+-/* i2c-elektor.c i2c-hw access for PCF8584 style isa bus adaptes */
+-/* ------------------------------------------------------------------------- */
+-/* Copyright (C) 1995-97 Simon G. Vogl
+- 1998-99 Hans Berglund
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2 of the License, or
+- (at your option) any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+-/* ------------------------------------------------------------------------- */
+-
+-/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+- Frodo Looijaard <frodol@dds.nl> */
+-
+-/* $Id$ */
+-
+-#ifndef I2C_PCF_ELEKTOR_H
+-#define I2C_PCF_ELEKTOR_H 1
+-
+-/*
+- * This struct contains the hw-dependent functions of PCF8584 adapters to
+- * manipulate the registers, and to init any hw-specific features.
+- * vdovikin: removed: this module in real supports only one device,
+- * due to missing arguments in some functions, called from the algo-pcf module.
+- * Sometimes it's need to be rewriten -
+- * but for now just remove this for simpler reading */
+-
+-/*
+-struct i2c_pcf_isa {
+- int pi_base;
+- int pi_irq;
+- int pi_clock;
+- int pi_own;
+-};
+-*/
+-
+-#endif /* PCF_ELEKTOR_H */
+diff -urN linux-2.4.24.org/include/linux/i2c.h linux-2.4.24/include/linux/i2c.h
+--- linux-2.4.24.org/include/linux/i2c.h 2004-01-19 00:52:49.411859802 +0100
++++ linux-2.4.24/include/linux/i2c.h 2004-01-19 01:38:09.789138720 +0100
+@@ -23,36 +23,33 @@
+ /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
+ Frodo Looijaard <frodol@dds.nl> */
+
+-/* $Id$ */
++/* $Id$ */
+
+-#ifndef I2C_H
+-#define I2C_H
++#ifndef _LINUX_I2C_H
++#define _LINUX_I2C_H
+
+-#define I2C_DATE "20010830"
+-#define I2C_VERSION "2.6.1"
++#define I2C_DATE "20040115"
++#define I2C_VERSION "2.8.3"
+
+-#include <linux/i2c-id.h> /* id values of adapters et. al. */
++#include <linux/module.h>
+ #include <linux/types.h>
+-
+-
+-struct i2c_msg;
+-
+-
+-#ifdef __KERNEL__
+-
+-/* --- Includes and compatibility declarations ------------------------ */
+-
++#include <linux/errno.h>
++#include <linux/sched.h>
+ #include <asm/semaphore.h>
+-#include <linux/config.h>
++#include <linux/i2c-id.h>
++
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
++#define MODULE_LICENSE(x)
++#endif
+
+ /* --- General options ------------------------------------------------ */
+
+-#define I2C_ALGO_MAX 4 /* control memory consumption */
+-#define I2C_ADAP_MAX 16
++#define I2C_ADAP_MAX 16 /* control memory consumption */
+ #define I2C_DRIVER_MAX 16
+ #define I2C_CLIENT_MAX 32
+-#define I2C_DUMMY_MAX 4
+
++struct i2c_msg;
+ struct i2c_algorithm;
+ struct i2c_adapter;
+ struct i2c_client;
+@@ -60,7 +57,6 @@
+ struct i2c_client_address_data;
+ union i2c_smbus_data;
+
+-
+ /*
+ * The master routines are the ones normally used to transmit data to devices
+ * on a bus (or read from them). Apart from two basic transfer functions to
+@@ -113,6 +109,8 @@
+ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
+ u8 command, u8 length,
+ u8 *values);
++extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
++ u8 command, u8 *values);
+ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
+ u8 command, u8 length,
+ u8 *values);
+@@ -125,6 +123,7 @@
+ */
+
+ struct i2c_driver {
++ struct module *owner;
+ char name[32];
+ int id;
+ unsigned int flags; /* div., see below */
+@@ -148,18 +147,6 @@
+ * with the device.
+ */
+ int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
+-
+- /* These two are mainly used for bookkeeping & dynamic unloading of
+- * kernel modules. inc_use tells the driver that a client is being
+- * used by another module & that it should increase its ref. counter.
+- * dec_use is the inverse operation.
+- * NB: Make sure you have no circular dependencies, or else you get a
+- * deadlock when trying to unload the modules.
+- * You should use the i2c_{inc,dec}_use_client functions instead of
+- * calling this function directly.
+- */
+- void (*inc_use)(struct i2c_client *client);
+- void (*dec_use)(struct i2c_client *client);
+ };
+
+ /*
+@@ -192,6 +179,7 @@
+ * to name two of the most common.
+ */
+ struct i2c_algorithm {
++ struct module *owner; /* future use --km */
+ char name[32]; /* textual description */
+ unsigned int id;
+
+@@ -221,16 +209,13 @@
* with the access algorithms necessary to access it.
*/
struct i2c_adapter {
struct i2c_algorithm *algo;/* the algorithm to access the bus */
void *algo_data;
-- /* --- These may be NULL, but should increase the module use count */
-- void (*inc_use)(struct i2c_adapter *);
-- void (*dec_use)(struct i2c_adapter *);
+- /* --- These may be NULL, but should increase the module use count */
+- void (*inc_use)(struct i2c_adapter *);
+- void (*dec_use)(struct i2c_adapter *);
+-
+ /* --- administration stuff. */
+ int (*client_register)(struct i2c_client *);
+ int (*client_unregister)(struct i2c_client *);
+@@ -241,11 +226,11 @@
+ /* and can be set via the i2c_ioctl call */
+
+ /* data fields that are valid for all devices */
+- struct semaphore lock;
++ struct semaphore bus;
++ struct semaphore list;
+ unsigned int flags;/* flags specifying div. data */
+
+ struct i2c_client *clients[I2C_CLIENT_MAX];
+- int client_count;
+
+ int timeout;
+ int retries;
+@@ -264,6 +249,9 @@
+ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */
+ #define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */
+ /* on an i2c_client */
++#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
++#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
++ /* Must equal I2C_M_TEN below */
+
+ /* i2c_client_address_data is the struct for holding default client
+ * addresses for a driver and for the parameters supplied on the
+@@ -302,12 +290,6 @@
+ extern int i2c_attach_client(struct i2c_client *);
+ extern int i2c_detach_client(struct i2c_client *);
+
+-/* Only call these if you grab a resource that makes unloading the
+- client and the adapter it is on completely impossible. Like when a
+- /proc directory is entered. */
+-extern void i2c_inc_use_client(struct i2c_client *);
+-extern void i2c_dec_use_client(struct i2c_client *);
+-
+ /* New function: This is to get an i2c_client-struct for controlling the
+ client either by using i2c_control-function or having the
+ client-module export functions that can be used with the i2c_client
+@@ -341,6 +323,15 @@
+ struct i2c_client_address_data *address_data,
+ i2c_client_found_addr_proc *found_proc);
+
++static inline int i2c_client_command(struct i2c_client *client,
++ unsigned int cmd, void *arg)
++{
++ if (client->driver && client->driver->command)
++ return client->driver->command(client, cmd, arg);
++ else
++ return -EINVAL;
++}
++
+ /* An ioctl like call to set div. parameters of the adapter.
+ */
+ extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
+@@ -358,8 +349,6 @@
+ /* Return 1 if adapter supports everything we need, 0 if not. */
+ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
+
+-#endif /* __KERNEL__ */
+-
+ /*
+ * I2C Message - used for pure i2c transaction, also from /dev interface
+ */
+@@ -370,15 +359,28 @@
+ #define I2C_M_RD 0x01
+ #define I2C_M_NOSTART 0x4000
+ #define I2C_M_REV_DIR_ADDR 0x2000
++#define I2C_M_IGNORE_NAK 0x1000
++#define I2C_M_NO_RD_ACK 0x0800
++#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
++#define I2C_M_RECV_PEC 0x0200 /* receive one more than the returned
++ length byte for the PEC */
+ __u16 len; /* msg length */
+ __u8 *buf; /* pointer to msg data */
++ int err;
++ short done;
+ };
+
+ /* To determine what functionality is present */
+
+ #define I2C_FUNC_I2C 0x00000001
+ #define I2C_FUNC_10BIT_ADDR 0x00000002
+-#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART} */
++#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
++#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
+ #define I2C_FUNC_SMBUS_QUICK 0x00010000
+ #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
+ #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
+@@ -389,8 +391,12 @@
+ #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
+ #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
+ #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
+-#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* New I2C-like block */
+-#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* transfer */
++#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
++#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
++#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
++#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */
++#define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */
++#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */
+
+ #define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \
+ I2C_FUNC_SMBUS_WRITE_BYTE
+@@ -402,13 +408,28 @@
+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
+ #define I2C_FUNC_SMBUS_I2C_BLOCK I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
+ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
++#define I2C_FUNC_SMBUS_I2C_BLOCK_2 I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
++ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2
++#define I2C_FUNC_SMBUS_BLOCK_DATA_PEC I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \
++ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC
++#define I2C_FUNC_SMBUS_WORD_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \
++ I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC
++
++#define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA
++#define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA
++#define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA
++#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA
++#define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA
++#define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA
+
+ #define I2C_FUNC_SMBUS_EMUL I2C_FUNC_SMBUS_QUICK | \
+ I2C_FUNC_SMBUS_BYTE | \
+ I2C_FUNC_SMBUS_BYTE_DATA | \
+ I2C_FUNC_SMBUS_WORD_DATA | \
+ I2C_FUNC_SMBUS_PROC_CALL | \
+- I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
++ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
++ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \
++ I2C_FUNC_SMBUS_I2C_BLOCK
+
+ /*
+ * Data for SMBus Messages
+@@ -418,8 +439,9 @@
+ union i2c_smbus_data {
+ __u8 byte;
+ __u16 word;
+- __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
++ __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */
+ /* one more for read length in block process call */
++ /* and one more for PEC */
+ };
+
+ /* smbus_access read or write markers */
+@@ -435,6 +457,11 @@
+ #define I2C_SMBUS_PROC_CALL 4
+ #define I2C_SMBUS_BLOCK_DATA 5
+ #define I2C_SMBUS_I2C_BLOCK_DATA 6
++#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
++#define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */
++#define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */
++#define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */
++#define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */
+
+
+ /* ----- commands for the ioctl like i2c_command call:
+@@ -460,6 +487,7 @@
+
+ #define I2C_FUNCS 0x0705 /* Get the adapter functionality */
+ #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
++#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
+ #if 0
+ #define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */
+ #endif
+@@ -475,16 +503,6 @@
+
+ #define I2C_MAJOR 89 /* Device major number */
+
+-#ifdef __KERNEL__
+-
+-# ifndef NULL
+-# define NULL ( (void *) 0 )
+-# endif
+-
+-# ifndef ENODEV
+-# include <asm/errno.h>
+-# endif
+-
+ /* These defines are used for probing i2c client addresses */
+ /* Default fill of many variables */
+ #define I2C_CLIENT_DEFAULTS {I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
+@@ -546,5 +564,11 @@
+ #define i2c_is_isa_adapter(adapptr) \
+ ((adapptr)->algo->id == I2C_ALGO_ISA)
+
+-#endif /* def __KERNEL__ */
+-#endif /* I2C_H */
++/* Tiny delay function used by the i2c bus drivers */
++static inline void i2c_delay(signed long timeout)
++{
++ set_current_state(TASK_INTERRUPTIBLE);
++ schedule_timeout(timeout);
++}
++
++#endif /* _LINUX_I2C_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-id.h linux-2.4.24/include/linux/i2c-id.h
+--- linux-2.4.24.org/include/linux/i2c-id.h 2004-01-19 00:52:42.139375899 +0100
++++ linux-2.4.24/include/linux/i2c-id.h 2004-01-19 01:38:06.401842469 +0100
+@@ -20,10 +20,11 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* ------------------------------------------------------------------------- */
+
+-/* $Id$ */
++/* $Id$ */
++
++#ifndef LINUX_I2C_ID_H
++#define LINUX_I2C_ID_H
+
+-#ifndef I2C_ID_H
+-#define I2C_ID_H
+ /*
+ * This file is part of the i2c-bus package and contains the identifier
+ * values for drivers, adapters and other folk populating these serial
+@@ -90,10 +91,25 @@
+ #define I2C_DRIVERID_DRP3510 43 /* ADR decoder (Astra Radio) */
+ #define I2C_DRIVERID_SP5055 44 /* Satellite tuner */
+ #define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */
++#define I2C_DRIVERID_SAA7108 46 /* video decoder, image scaler */
++#define I2C_DRIVERID_DS1307 47 /* DS1307 real time clock */
+ #define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */
+-#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
+-#define I2C_DRIVERID_SAA7191 57 /* video decoder */
+-#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
++#define I2C_DRIVERID_ZR36067 49 /* Zoran 36067 video encoder */
++#define I2C_DRIVERID_ZR36120 50 /* Zoran 36120 video encoder */
++#define I2C_DRIVERID_24LC32A 51 /* Microchip 24LC32A 32k EEPROM */
++#define I2C_DRIVERID_STM41T00 52 /* real time clock */
++#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */
++#define I2C_DRIVERID_ADV7170 54 /* video encoder */
++#define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */
++#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
++#define I2C_DRIVERID_SAA7191 57 /* video encoder */
++#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
++#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */
++#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */
++#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */
++#define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */
++
++
+
+ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
+ #define I2C_DRIVERID_EXP1 0xF1
+@@ -102,6 +118,8 @@
+
+ #define I2C_DRIVERID_I2CDEV 900
+ #define I2C_DRIVERID_I2CPROC 901
++#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
++#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */
+
+ /* IDs -- Use DRIVERIDs 1000-1999 for sensors.
+ These were originally in sensors.h in the lm_sensors package */
+@@ -131,6 +149,26 @@
+ #define I2C_DRIVERID_ADM1024 1025
+ #define I2C_DRIVERID_IT87 1026
+ #define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
++#define I2C_DRIVERID_FSCPOS 1028
++#define I2C_DRIVERID_FSCSCY 1029
++#define I2C_DRIVERID_PCF8591 1030
++#define I2C_DRIVERID_SMSC47M1 1031
++#define I2C_DRIVERID_VT1211 1032
++#define I2C_DRIVERID_LM92 1033
++#define I2C_DRIVERID_VT8231 1034
++#define I2C_DRIVERID_SMARTBATT 1035
++#define I2C_DRIVERID_BMCSENSORS 1036
++#define I2C_DRIVERID_FS451 1037
++#define I2C_DRIVERID_W83627HF 1038
++#define I2C_DRIVERID_LM85 1039
++#define I2C_DRIVERID_LM83 1040
++#define I2C_DRIVERID_SAA1064 1041
++#define I2C_DRIVERID_LM90 1042
++#define I2C_DRIVERID_ASB100 1043
++#define I2C_DRIVERID_MAX6650 1044
++#define I2C_DRIVERID_XEONTEMP 1045
++#define I2C_DRIVERID_FSCHER 1046
++#define I2C_DRIVERID_W83L785TS 1047
+
+ /*
+ * ---- Adapter types ----------------------------------------------------
+@@ -147,14 +185,21 @@
+ #define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */
+ #define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */
+ #define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */
-
- /* --- administration stuff. */
- int (*client_register)(struct i2c_client *);
- int (*client_unregister)(struct i2c_client *);
-@@ -241,11 +226,11 @@
- /* and can be set via the i2c_ioctl call */
++#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */
++#define I2C_ALGO_SAA7134 0x090000
++#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */
++#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */
++#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */
++#define I2C_ALGO_MPC107 0x0d0000
+ #define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */
- /* data fields that are valid for all devices */
-- struct semaphore lock;
-+ struct semaphore bus;
-+ struct semaphore list;
- unsigned int flags;/* flags specifying div. data */
+ #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
+-
+-#define I2C_ALGO_SIBYTE 0x120000 /* Broadcom SiByte SOCs */
+-
+-#define I2C_ALGO_SGI 0x130000 /* SGI algorithm */
++#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */
++#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */
++#define I2C_ALGO_OCP_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */
++#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
++#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
++#define I2C_ALGO_USB 0x170000 /* USB algorithm */
- struct i2c_client *clients[I2C_CLIENT_MAX];
-- int client_count;
+ #define I2C_ALGO_EXP 0x800000 /* experimental */
- int timeout;
- int retries;
-@@ -264,6 +249,9 @@
- #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */
- #define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */
- /* on an i2c_client */
-+#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
-+#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
-+ /* Must equal I2C_M_TEN below */
+@@ -182,27 +227,45 @@
+ #define I2C_HW_B_I810 0x0a /* Intel I810 */
+ #define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */
+ #define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */
++#define I2C_HW_B_SAVG 0x0d /* Savage 4 */
++#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */
+ #define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */
+ #define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */
+ #define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */
++#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */
++#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */
++#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */
++#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */
++#define I2C_HW_B_IXP425 0x17 /* GPIO on IXP425 systems */
++#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */
++#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */
++#define I2C_HW_B_PCILYNX 0x20 /* TI PCILynx I2C adapter */
- /* i2c_client_address_data is the struct for holding default client
- * addresses for a driver and for the parameters supplied on the
-@@ -302,12 +290,6 @@
- extern int i2c_attach_client(struct i2c_client *);
- extern int i2c_detach_client(struct i2c_client *);
+ /* --- PCF 8584 based algorithms */
+ #define I2C_HW_P_LP 0x00 /* Parallel port interface */
+ #define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */
+ #define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */
+
++/* --- USB based adapters */
++#define I2C_HW_USB_USBVISION 0x00
++
+ /* --- ACPI Embedded controller algorithms */
+ #define I2C_HW_ACPI_EC 0x00
+
++/* --- MPC824x PowerPC adapters */
++#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */
++
+ /* --- MPC8xx PowerPC adapters */
+ #define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */
+
+-/* --- Broadcom SiByte adapters */
+-#define I2C_HW_SIBYTE 0x00
++/* --- ITE based algorithms */
++#define I2C_HW_I_IIC 0x00 /* controller on the ITE */
++
++/* --- PowerPC on-chip adapters */
++#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */
+
+-/* --- SGI adapters */
+-#define I2C_HW_SGI_VINO 0x00
+-#define I2C_HW_SGI_MACE 0x01
++/* --- XSCALE on-chip adapters */
++#define I2C_HW_IOP321 0x00
+
+ /* --- SMBus only adapters */
+ #define I2C_HW_SMBUS_PIIX4 0x00
+@@ -213,9 +276,27 @@
+ #define I2C_HW_SMBUS_AMD756 0x05
+ #define I2C_HW_SMBUS_SIS5595 0x06
+ #define I2C_HW_SMBUS_ALI1535 0x07
++#define I2C_HW_SMBUS_SIS630 0x08
++#define I2C_HW_SMBUS_SIS645 0x09
++#define I2C_HW_SMBUS_AMD8111 0x0a
++#define I2C_HW_SMBUS_SCX200 0x0b
++#define I2C_HW_SMBUS_NFORCE2 0x0c
+ #define I2C_HW_SMBUS_W9968CF 0x0d
++#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */
++#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */
++#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */
++#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress Ez-USB FX2 USB 2.0 */
+
+ /* --- ISA pseudo-adapter */
+ #define I2C_HW_ISA 0x00
+
+-#endif /* I2C_ID_H */
++/* --- IPMI pseudo-adapter */
++#define I2C_HW_IPMI 0x00
++
++/* --- IPMB adapter */
++#define I2C_HW_IPMB 0x00
++
++/* --- MCP107 adapter */
++#define I2C_HW_MPC107 0x00
++
++#endif /* LINUX_I2C_ID_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-pcf8584.h linux-2.4.24/include/linux/i2c-pcf8584.h
+--- linux-2.4.24.org/include/linux/i2c-pcf8584.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.24/include/linux/i2c-pcf8584.h 2004-01-19 01:38:06.778764160 +0100
+@@ -0,0 +1,78 @@
++/* -------------------------------------------------------------------- */
++/* i2c-pcf8584.h: PCF 8584 global defines */
++/* -------------------------------------------------------------------- */
++/* Copyright (C) 1996 Simon G. Vogl
++ 1999 Hans Berglund
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
++/* -------------------------------------------------------------------- */
++
++/* With some changes from Frodo Looijaard <frodol@dds.nl> */
++
++/* $Id$ */
++
++#ifndef _LINUX_I2C_PCF8584_H
++#define _LINUX_I2C_PCF8584_H
++
++/* ----- Control register bits ---------------------------------------- */
++#define I2C_PCF_PIN 0x80
++#define I2C_PCF_ESO 0x40
++#define I2C_PCF_ES1 0x20
++#define I2C_PCF_ES2 0x10
++#define I2C_PCF_ENI 0x08
++#define I2C_PCF_STA 0x04
++#define I2C_PCF_STO 0x02
++#define I2C_PCF_ACK 0x01
++
++#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
++#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
++#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
++#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
++
++/* ----- Status register bits ----------------------------------------- */
++/*#define I2C_PCF_PIN 0x80 as above*/
++
++#define I2C_PCF_INI 0x40 /* 1 if not initialized */
++#define I2C_PCF_STS 0x20
++#define I2C_PCF_BER 0x10
++#define I2C_PCF_AD0 0x08
++#define I2C_PCF_LRB 0x08
++#define I2C_PCF_AAS 0x04
++#define I2C_PCF_LAB 0x02
++#define I2C_PCF_BB 0x01
++
++/* ----- Chip clock frequencies --------------------------------------- */
++#define I2C_PCF_CLK3 0x00
++#define I2C_PCF_CLK443 0x10
++#define I2C_PCF_CLK6 0x14
++#define I2C_PCF_CLK 0x18
++#define I2C_PCF_CLK12 0x1c
++
++/* ----- transmission frequencies ------------------------------------- */
++#define I2C_PCF_TRNS90 0x00 /* 90 kHz */
++#define I2C_PCF_TRNS45 0x01 /* 45 kHz */
++#define I2C_PCF_TRNS11 0x02 /* 11 kHz */
++#define I2C_PCF_TRNS15 0x03 /* 1.5 kHz */
++
++
++/* ----- Access to internal registers according to ES1,ES2 ------------ */
++/* they are mapped to the data port ( a0 = 0 ) */
++/* available when ESO == 0 : */
++
++#define I2C_PCF_OWNADR 0
++#define I2C_PCF_INTREG I2C_PCF_ES2
++#define I2C_PCF_CLKREG I2C_PCF_ES1
++
++#endif /* _LINUX_I2C_PCF8584_H */
+diff -urN linux-2.4.24.org/include/linux/i2c-proc.h linux-2.4.24/include/linux/i2c-proc.h
+--- linux-2.4.24.org/include/linux/i2c-proc.h 2004-01-19 00:52:58.774907910 +0100
++++ linux-2.4.24/include/linux/i2c-proc.h 2004-01-19 01:38:07.991512197 +0100
+@@ -1,6 +1,7 @@
+ /*
+- sensors.h - Part of lm_sensors, Linux kernel modules for hardware
+- monitoring
++ i2c-proc.h - Part of the i2c package
++ was originally sensors.h - Part of lm_sensors, Linux kernel modules
++ for hardware monitoring
+ Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
--/* Only call these if you grab a resource that makes unloading the
-- client and the adapter it is on completely impossible. Like when a
-- /proc directory is entered. */
--extern void i2c_inc_use_client(struct i2c_client *);
--extern void i2c_dec_use_client(struct i2c_client *);
--
- /* New function: This is to get an i2c_client-struct for controlling the
- client either by using i2c_control-function or having the
- client-module export functions that can be used with the i2c_client
-@@ -341,6 +323,15 @@
- struct i2c_client_address_data *address_data,
- i2c_client_found_addr_proc *found_proc);
+ This program is free software; you can redistribute it and/or modify
+@@ -18,14 +19,9 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
-+static inline int i2c_client_command(struct i2c_client *client,
-+ unsigned int cmd, void *arg)
-+{
-+ if (client->driver && client->driver->command)
-+ return client->driver->command(client, cmd, arg);
-+ else
-+ return -EINVAL;
-+}
-+
- /* An ioctl like call to set div. parameters of the adapter.
- */
- extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
-@@ -358,8 +349,6 @@
- /* Return 1 if adapter supports everything we need, 0 if not. */
- extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
+-#ifndef SENSORS_SENSORS_H
+-#define SENSORS_SENSORS_H
++#ifndef _LINUX_I2C_PROC_H
++#define _LINUX_I2C_PROC_H
--#endif /* __KERNEL__ */
+-#ifdef __KERNEL__
-
- /*
- * I2C Message - used for pure i2c transaction, also from /dev interface
- */
-@@ -370,15 +359,28 @@
- #define I2C_M_RD 0x01
- #define I2C_M_NOSTART 0x4000
- #define I2C_M_REV_DIR_ADDR 0x2000
-+#define I2C_M_IGNORE_NAK 0x1000
-+#define I2C_M_NO_RD_ACK 0x0800
-+#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
-+#define I2C_M_RECV_PEC 0x0200 /* receive one more than the returned
-+ length byte for the PEC */
- __u16 len; /* msg length */
- __u8 *buf; /* pointer to msg data */
-+ int err;
-+ short done;
- };
-
- /* To determine what functionality is present */
+-/* Next two must be included before sysctl.h can be included, in 2.0 kernels */
+-#include <linux/types.h>
+-#include <linux/fs.h>
+ #include <linux/sysctl.h>
- #define I2C_FUNC_I2C 0x00000001
- #define I2C_FUNC_10BIT_ADDR 0x00000002
--#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART} */
-+#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
-+#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
- #define I2C_FUNC_SMBUS_QUICK 0x00010000
- #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
- #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
-@@ -389,8 +391,12 @@
- #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
- #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
- #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
--#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* New I2C-like block */
--#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* transfer */
-+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
-+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
-+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
-+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */
-+#define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */
-+#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */
+ /* The type of callback functions used in sensors_{proc,sysctl}_real */
+@@ -73,8 +69,7 @@
+ these functions must be updated! */
+ extern int i2c_register_entry(struct i2c_client *client,
+ const char *prefix,
+- ctl_table * ctl_template,
+- struct module *controlling_mod);
++ ctl_table * ctl_template);
- #define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \
- I2C_FUNC_SMBUS_WRITE_BYTE
-@@ -402,13 +408,28 @@
- I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
- #define I2C_FUNC_SMBUS_I2C_BLOCK I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
- I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
-+#define I2C_FUNC_SMBUS_I2C_BLOCK_2 I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
-+ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2
-+#define I2C_FUNC_SMBUS_BLOCK_DATA_PEC I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \
-+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC
-+#define I2C_FUNC_SMBUS_WORD_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \
-+ I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC
-+
-+#define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA
-+#define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA
-+#define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA
-+#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA
-+#define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA
-+#define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA
+ extern void i2c_deregister_entry(int id);
- #define I2C_FUNC_SMBUS_EMUL I2C_FUNC_SMBUS_QUICK | \
- I2C_FUNC_SMBUS_BYTE | \
- I2C_FUNC_SMBUS_BYTE_DATA | \
- I2C_FUNC_SMBUS_WORD_DATA | \
- I2C_FUNC_SMBUS_PROC_CALL | \
-- I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
-+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
-+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \
-+ I2C_FUNC_SMBUS_I2C_BLOCK
+@@ -347,6 +342,31 @@
+ {NULL}}; \
+ SENSORS_INSMOD
- /*
- * Data for SMBus Messages
-@@ -418,8 +439,9 @@
- union i2c_smbus_data {
- __u8 byte;
- __u16 word;
-- __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
-+ __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */
- /* one more for read length in block process call */
-+ /* and one more for PEC */
- };
++#define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \
++ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \
++ SENSORS_MODULE_PARM(force, \
++ "List of adapter,address pairs to boldly assume " \
++ "to be present"); \
++ SENSORS_MODULE_PARM_FORCE(chip1); \
++ SENSORS_MODULE_PARM_FORCE(chip2); \
++ SENSORS_MODULE_PARM_FORCE(chip3); \
++ SENSORS_MODULE_PARM_FORCE(chip4); \
++ SENSORS_MODULE_PARM_FORCE(chip5); \
++ SENSORS_MODULE_PARM_FORCE(chip6); \
++ SENSORS_MODULE_PARM_FORCE(chip7); \
++ SENSORS_MODULE_PARM_FORCE(chip8); \
++ static struct i2c_force_data forces[] = {{force,any_chip}, \
++ {force_ ## chip1,chip1}, \
++ {force_ ## chip2,chip2}, \
++ {force_ ## chip3,chip3}, \
++ {force_ ## chip4,chip4}, \
++ {force_ ## chip5,chip5}, \
++ {force_ ## chip6,chip6}, \
++ {force_ ## chip7,chip7}, \
++ {force_ ## chip8,chip8}, \
++ {NULL}}; \
++ SENSORS_INSMOD
++
+ typedef int i2c_found_addr_proc(struct i2c_adapter *adapter,
+ int addr, unsigned short flags,
+ int kind);
+@@ -362,7 +382,7 @@
- /* smbus_access read or write markers */
-@@ -435,6 +457,11 @@
- #define I2C_SMBUS_PROC_CALL 4
- #define I2C_SMBUS_BLOCK_DATA 5
- #define I2C_SMBUS_I2C_BLOCK_DATA 6
-+#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
-+#define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */
-+#define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */
-+#define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */
-+#define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */
+ /* This macro is used to scale user-input to sensible values in almost all
+ chip drivers. */
+-extern inline int SENSORS_LIMIT(long value, long low, long high)
++static inline int SENSORS_LIMIT(long value, long low, long high)
+ {
+ if (value < low)
+ return low;
+@@ -372,8 +392,6 @@
+ return value;
+ }
+-#endif /* def __KERNEL__ */
+-
- /* ----- commands for the ioctl like i2c_command call:
-@@ -460,6 +487,7 @@
+ /* The maximum length of the prefix */
+ #define SENSORS_PREFIX_MAX 20
+@@ -392,5 +410,5 @@
+ char name[SENSORS_PREFIX_MAX + 13];
+ };
- #define I2C_FUNCS 0x0705 /* Get the adapter functionality */
- #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
-+#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
- #if 0
- #define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */
- #endif
-@@ -475,16 +503,6 @@
+-#endif /* def SENSORS_SENSORS_H */
++#endif /* def _LINUX_I2C_PROC_H */
- #define I2C_MAJOR 89 /* Device major number */
+diff -urN linux-2.4.24.org/drivers/i2c/scx200_acb.c linux-2.4.24/drivers/i2c/scx200_acb.c
+--- linux-2.4.24.org/drivers/i2c/scx200_acb.c 2004-01-19 00:55:48.149603885 +0100
++++ linux-2.4.24/drivers/i2c/scx200_acb.c 2004-01-19 01:41:26.143347097 +0100
+@@ -408,16 +408,6 @@
+ return 0;
+ }
--#ifdef __KERNEL__
--
--# ifndef NULL
--# define NULL ( (void *) 0 )
--# endif
+-static void scx200_acb_inc_use(struct i2c_adapter *adapter)
+-{
+- MOD_INC_USE_COUNT;
+-}
-
--# ifndef ENODEV
--# include <asm/errno.h>
--# endif
+-static void scx200_acb_dec_use(struct i2c_adapter *adapter)
+-{
+- MOD_DEC_USE_COUNT;
+-}
-
- /* These defines are used for probing i2c client addresses */
- /* Default fill of many variables */
- #define I2C_CLIENT_DEFAULTS {I2C_CLIENT_END, I2C_CLIENT_END, I2C_CLIENT_END, \
-@@ -546,5 +564,11 @@
- #define i2c_is_isa_adapter(adapptr) \
- ((adapptr)->algo->id == I2C_ALGO_ISA)
+ /* For now, we only handle combined mode (smbus) */
+ static struct i2c_algorithm scx200_acb_algorithm = {
+ name: "NatSemi SCx200 ACCESS.bus",
+@@ -482,8 +472,6 @@
+ sprintf(adapter->name, "SCx200 ACB%d", index);
+ adapter->id = I2C_ALGO_SMBUS;
+ adapter->algo = &scx200_acb_algorithm;
+- adapter->inc_use = scx200_acb_inc_use;
+- adapter->dec_use = scx200_acb_dec_use;
+ adapter->client_register = scx200_acb_reg;
+ adapter->client_unregister = scx200_acb_unreg;
+
+diff -urN linux-2.4.24.org/drivers/i2c/scx200_i2c.c linux-2.4.24/drivers/i2c/scx200_i2c.c
+--- linux-2.4.24.org/drivers/i2c/scx200_i2c.c 2004-01-19 00:55:48.103613470 +0100
++++ linux-2.4.24/drivers/i2c/scx200_i2c.c 2004-01-19 01:41:09.572789315 +0100
+@@ -76,16 +76,6 @@
+ return 0;
+ }
--#endif /* def __KERNEL__ */
--#endif /* I2C_H */
-+/* Tiny delay function used by the i2c bus drivers */
-+static inline void i2c_delay(signed long timeout)
-+{
-+ set_current_state(TASK_INTERRUPTIBLE);
-+ schedule_timeout(timeout);
-+}
-+
-+#endif /* _LINUX_I2C_H */
+-static void scx200_i2c_inc_use(struct i2c_adapter *adap)
+-{
+- MOD_INC_USE_COUNT;
+-}
+-
+-static void scx200_i2c_dec_use(struct i2c_adapter *adap)
+-{
+- MOD_DEC_USE_COUNT;
+-}
+-
+ /* ------------------------------------------------------------------------
+ * Encapsulate the above functions in the correct operations structure.
+ * This is only done when more than one hardware adapter is supported.
+@@ -104,8 +94,6 @@
+ .name = "NatSemi SCx200 I2C",
+ .id = I2C_HW_B_VELLE,
+ .algo_data = &scx200_i2c_data,
+- .inc_use = scx200_i2c_inc_use,
+- .dec_use = scx200_i2c_dec_use,
+ .client_register = scx200_i2c_reg,
+ .client_unregister = scx200_i2c_unreg,
+ };