aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2011-01-10 16:11:23 -0500
committerJean Delvare <khali@endymion.delvare>2011-01-10 16:11:23 -0500
commit0cc43a1806f078f7fd414850d8f1f1761696e4af (patch)
tree2278fca3af95002a867fa72b34e4ca97ccf5489f /include/linux/i2c.h
parentaf5a60baaee66e2f891dbb9a8519ca28ab7da7cd (diff)
i2c: Constify i2c_client where possible
Helper functions for I2C and SMBus transactions don't modify the i2c_client that is passed to them, so it can be marked const. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 56cfe23ffb39..903576df88dc 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -57,9 +57,10 @@ struct i2c_board_info;
57 * transmit an arbitrary number of messages without interruption. 57 * transmit an arbitrary number of messages without interruption.
58 * @count must be be less than 64k since msg.len is u16. 58 * @count must be be less than 64k since msg.len is u16.
59 */ 59 */
60extern int i2c_master_send(struct i2c_client *client, const char *buf, 60extern int i2c_master_send(const struct i2c_client *client, const char *buf,
61 int count);
62extern int i2c_master_recv(const struct i2c_client *client, char *buf,
61 int count); 63 int count);
62extern int i2c_master_recv(struct i2c_client *client, char *buf, int count);
63 64
64/* Transfer num messages. 65/* Transfer num messages.
65 */ 66 */
@@ -78,23 +79,25 @@ extern s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
78/* Now follow the 'nice' access routines. These also document the calling 79/* Now follow the 'nice' access routines. These also document the calling
79 conventions of i2c_smbus_xfer. */ 80 conventions of i2c_smbus_xfer. */
80 81
81extern s32 i2c_smbus_read_byte(struct i2c_client *client); 82extern s32 i2c_smbus_read_byte(const struct i2c_client *client);
82extern s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); 83extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
83extern s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); 84extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client,
84extern s32 i2c_smbus_write_byte_data(struct i2c_client *client, 85 u8 command);
86extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client,
85 u8 command, u8 value); 87 u8 command, u8 value);
86extern s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command); 88extern s32 i2c_smbus_read_word_data(const struct i2c_client *client,
87extern s32 i2c_smbus_write_word_data(struct i2c_client *client, 89 u8 command);
90extern s32 i2c_smbus_write_word_data(const struct i2c_client *client,
88 u8 command, u16 value); 91 u8 command, u16 value);
89/* Returns the number of read bytes */ 92/* Returns the number of read bytes */
90extern s32 i2c_smbus_read_block_data(struct i2c_client *client, 93extern s32 i2c_smbus_read_block_data(const struct i2c_client *client,
91 u8 command, u8 *values); 94 u8 command, u8 *values);
92extern s32 i2c_smbus_write_block_data(struct i2c_client *client, 95extern s32 i2c_smbus_write_block_data(const struct i2c_client *client,
93 u8 command, u8 length, const u8 *values); 96 u8 command, u8 length, const u8 *values);
94/* Returns the number of read bytes */ 97/* Returns the number of read bytes */
95extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, 98extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client,
96 u8 command, u8 length, u8 *values); 99 u8 command, u8 length, u8 *values);
97extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, 100extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
98 u8 command, u8 length, 101 u8 command, u8 length,
99 const u8 *values); 102 const u8 *values);
100#endif /* I2C */ 103#endif /* I2C */