--- i2c.h.orig 2004-02-07 13:29:15.099504640 -0500 +++ i2c.h 2004-02-07 13:35:53.956869104 -0500 @@ -28,10 +28,18 @@ #ifndef _LINUX_I2C_H #define _LINUX_I2C_H -#include -#include +#ifdef __KERNEL__ +# include +# include +#else +# define __KERNEL__ +# include +# undef __KERNEL__ +#endif #include +#ifdef __KERNEL__ #include /* for struct device */ +#endif #include /* --- General options ------------------------------------------------ */ @@ -109,6 +117,7 @@ * events. */ +#ifdef __KERNEL__ struct i2c_driver { struct module *owner; char name[32]; @@ -268,6 +277,7 @@ { dev_set_drvdata (&dev->dev, data); } +#endif /*flags for the driver struct: */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ @@ -599,11 +609,13 @@ #define i2c_is_isa_adapter(adapptr) \ ((adapptr)->algo->id == I2C_ALGO_ISA) +#ifdef __KERNEL__ /* 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 #endif /* _LINUX_I2C_H */