diff options
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1635ee25918f..526ddc8eecfb 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -20,14 +20,15 @@ | |||
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
21 | /* ------------------------------------------------------------------------- */ | 21 | /* ------------------------------------------------------------------------- */ |
22 | 22 | ||
23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and | 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and |
24 | Frodo Looijaard <frodol@dds.nl> */ | 24 | Frodo Looijaard <frodol@dds.nl> */ |
25 | 25 | ||
26 | #ifndef _LINUX_I2C_H | 26 | #ifndef _LINUX_I2C_H |
27 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
28 | 28 | ||
29 | #include <linux/module.h> | ||
30 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #ifdef __KERNEL__ | ||
31 | #include <linux/module.h> | ||
31 | #include <linux/i2c-id.h> | 32 | #include <linux/i2c-id.h> |
32 | #include <linux/mod_devicetable.h> | 33 | #include <linux/mod_devicetable.h> |
33 | #include <linux/device.h> /* for struct device */ | 34 | #include <linux/device.h> /* for struct device */ |
@@ -96,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | |||
96 | u8 command, u16 value); | 97 | u8 command, u16 value); |
97 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
98 | u8 command, u8 length, | 99 | u8 command, u8 length, |
99 | u8 *values); | 100 | const u8 *values); |
100 | /* Returns the number of read bytes */ | 101 | /* Returns the number of read bytes */ |
101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 102 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
102 | u8 command, u8 *values); | 103 | u8 command, u8 *values); |
103 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | 104 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, |
104 | u8 command, u8 length, | 105 | u8 command, u8 length, |
105 | u8 *values); | 106 | const u8 *values); |
106 | 107 | ||
107 | /* | 108 | /* |
108 | * A driver is capable of handling one or more physical devices present on | 109 | * A driver is capable of handling one or more physical devices present on |
@@ -354,6 +355,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
354 | { | 355 | { |
355 | return adap->nr; | 356 | return adap->nr; |
356 | } | 357 | } |
358 | #endif /* __KERNEL__ */ | ||
357 | 359 | ||
358 | /* | 360 | /* |
359 | * I2C Message - used for pure i2c transaction, also from /dev interface | 361 | * I2C Message - used for pure i2c transaction, also from /dev interface |
@@ -469,6 +471,7 @@ union i2c_smbus_data { | |||
469 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 471 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
470 | 472 | ||
471 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ | 473 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ |
474 | #ifdef __KERNEL__ | ||
472 | 475 | ||
473 | #define I2C_MAJOR 89 /* Device major number */ | 476 | #define I2C_MAJOR 89 /* Device major number */ |
474 | 477 | ||
@@ -646,5 +649,5 @@ static unsigned short *forces[] = { force, force_##chip1, \ | |||
646 | force_##chip6, force_##chip7, \ | 649 | force_##chip6, force_##chip7, \ |
647 | force_##chip8, NULL }; \ | 650 | force_##chip8, NULL }; \ |
648 | I2C_CLIENT_INSMOD_COMMON | 651 | I2C_CLIENT_INSMOD_COMMON |
649 | 652 | #endif /* __KERNEL__ */ | |
650 | #endif /* _LINUX_I2C_H */ | 653 | #endif /* _LINUX_I2C_H */ |