Lines 28-37
Link Here
|
28 |
#ifndef _LINUX_I2C_H |
28 |
#ifndef _LINUX_I2C_H |
29 |
#define _LINUX_I2C_H |
29 |
#define _LINUX_I2C_H |
30 |
|
30 |
|
31 |
#include <linux/module.h> |
31 |
#ifdef __KERNEL__ |
32 |
#include <linux/types.h> |
32 |
# include <linux/module.h> |
|
|
33 |
# include <linux/types.h> |
34 |
#else |
35 |
# define __KERNEL__ |
36 |
# include <linux/types.h> |
37 |
# undef __KERNEL__ |
38 |
#endif |
33 |
#include <linux/i2c-id.h> |
39 |
#include <linux/i2c-id.h> |
|
|
40 |
#ifdef __KERNEL__ |
34 |
#include <linux/device.h> /* for struct device */ |
41 |
#include <linux/device.h> /* for struct device */ |
|
|
42 |
#endif |
35 |
#include <asm/semaphore.h> |
43 |
#include <asm/semaphore.h> |
36 |
|
44 |
|
37 |
/* --- General options ------------------------------------------------ */ |
45 |
/* --- General options ------------------------------------------------ */ |
Lines 109-114
Link Here
|
109 |
* events. |
117 |
* events. |
110 |
*/ |
118 |
*/ |
111 |
|
119 |
|
|
|
120 |
#ifdef __KERNEL__ |
112 |
struct i2c_driver { |
121 |
struct i2c_driver { |
113 |
struct module *owner; |
122 |
struct module *owner; |
114 |
char name[32]; |
123 |
char name[32]; |
Lines 268-273
Link Here
|
268 |
{ |
277 |
{ |
269 |
dev_set_drvdata (&dev->dev, data); |
278 |
dev_set_drvdata (&dev->dev, data); |
270 |
} |
279 |
} |
|
|
280 |
#endif |
271 |
|
281 |
|
272 |
/*flags for the driver struct: */ |
282 |
/*flags for the driver struct: */ |
273 |
#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ |
283 |
#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ |
Lines 599-609
Link Here
|
599 |
#define i2c_is_isa_adapter(adapptr) \ |
609 |
#define i2c_is_isa_adapter(adapptr) \ |
600 |
((adapptr)->algo->id == I2C_ALGO_ISA) |
610 |
((adapptr)->algo->id == I2C_ALGO_ISA) |
601 |
|
611 |
|
|
|
612 |
#ifdef __KERNEL__ |
602 |
/* Tiny delay function used by the i2c bus drivers */ |
613 |
/* Tiny delay function used by the i2c bus drivers */ |
603 |
static inline void i2c_delay(signed long timeout) |
614 |
static inline void i2c_delay(signed long timeout) |
604 |
{ |
615 |
{ |
605 |
set_current_state(TASK_INTERRUPTIBLE); |
616 |
set_current_state(TASK_INTERRUPTIBLE); |
606 |
schedule_timeout(timeout); |
617 |
schedule_timeout(timeout); |
607 |
} |
618 |
} |
|
|
619 |
#endif |
608 |
|
620 |
|
609 |
#endif /* _LINUX_I2C_H */ |
621 |
#endif /* _LINUX_I2C_H */ |