diff options
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9d9d379b5a15..5ac0f9055715 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -63,10 +63,36 @@ struct property_entry; | |||
63 | * transmit an arbitrary number of messages without interruption. | 63 | * transmit an arbitrary number of messages without interruption. |
64 | * @count must be be less than 64k since msg.len is u16. | 64 | * @count must be be less than 64k since msg.len is u16. |
65 | */ | 65 | */ |
66 | extern int i2c_master_send(const struct i2c_client *client, const char *buf, | 66 | extern int i2c_transfer_buffer_flags(const struct i2c_client *client, |
67 | int count); | 67 | char *buf, int count, u16 flags); |
68 | extern int i2c_master_recv(const struct i2c_client *client, char *buf, | 68 | |
69 | int count); | 69 | /** |
70 | * i2c_master_recv - issue a single I2C message in master receive mode | ||
71 | * @client: Handle to slave device | ||
72 | * @buf: Where to store data read from slave | ||
73 | * @count: How many bytes to read, must be less than 64k since msg.len is u16 | ||
74 | * | ||
75 | * Returns negative errno, or else the number of bytes read. | ||
76 | */ | ||
77 | static inline int i2c_master_recv(const struct i2c_client *client, | ||
78 | char *buf, int count) | ||
79 | { | ||
80 | return i2c_transfer_buffer_flags(client, buf, count, I2C_M_RD); | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * i2c_master_send - issue a single I2C message in master transmit mode | ||
85 | * @client: Handle to slave device | ||
86 | * @buf: Data that will be written to the slave | ||
87 | * @count: How many bytes to write, must be less than 64k since msg.len is u16 | ||
88 | * | ||
89 | * Returns negative errno, or else the number of bytes written. | ||
90 | */ | ||
91 | static inline int i2c_master_send(const struct i2c_client *client, | ||
92 | const char *buf, int count) | ||
93 | { | ||
94 | return i2c_transfer_buffer_flags(client, (char *)buf, count, 0); | ||
95 | }; | ||
70 | 96 | ||
71 | /* Transfer num messages. | 97 | /* Transfer num messages. |
72 | */ | 98 | */ |