|
@@ -1362,7 +1362,7 @@ EXPORT_SYMBOL(i2c_transfer);
|
|
|
*
|
|
|
* Returns negative errno, or else the number of bytes written.
|
|
|
*/
|
|
|
-int i2c_master_send(struct i2c_client *client, const char *buf, int count)
|
|
|
+int i2c_master_send(const struct i2c_client *client, const char *buf, int count)
|
|
|
{
|
|
|
int ret;
|
|
|
struct i2c_adapter *adap = client->adapter;
|
|
@@ -1389,7 +1389,7 @@ EXPORT_SYMBOL(i2c_master_send);
|
|
|
*
|
|
|
* Returns negative errno, or else the number of bytes read.
|
|
|
*/
|
|
|
-int i2c_master_recv(struct i2c_client *client, char *buf, int count)
|
|
|
+int i2c_master_recv(const struct i2c_client *client, char *buf, int count)
|
|
|
{
|
|
|
struct i2c_adapter *adap = client->adapter;
|
|
|
struct i2c_msg msg;
|
|
@@ -1679,7 +1679,7 @@ static int i2c_smbus_check_pec(u8 cpec, struct i2c_msg *msg)
|
|
|
* This executes the SMBus "receive byte" protocol, returning negative errno
|
|
|
* else the byte received from the device.
|
|
|
*/
|
|
|
-s32 i2c_smbus_read_byte(struct i2c_client *client)
|
|
|
+s32 i2c_smbus_read_byte(const struct i2c_client *client)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
int status;
|
|
@@ -1699,7 +1699,7 @@ EXPORT_SYMBOL(i2c_smbus_read_byte);
|
|
|
* This executes the SMBus "send byte" protocol, returning negative errno
|
|
|
* else zero on success.
|
|
|
*/
|
|
|
-s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value)
|
|
|
+s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value)
|
|
|
{
|
|
|
return i2c_smbus_xfer(client->adapter, client->addr, client->flags,
|
|
|
I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
|
|
@@ -1714,7 +1714,7 @@ EXPORT_SYMBOL(i2c_smbus_write_byte);
|
|
|
* This executes the SMBus "read byte" protocol, returning negative errno
|
|
|
* else a data byte received from the device.
|
|
|
*/
|
|
|
-s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command)
|
|
|
+s32 i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
int status;
|
|
@@ -1735,7 +1735,8 @@ EXPORT_SYMBOL(i2c_smbus_read_byte_data);
|
|
|
* This executes the SMBus "write byte" protocol, returning negative errno
|
|
|
* else zero on success.
|
|
|
*/
|
|
|
-s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value)
|
|
|
+s32 i2c_smbus_write_byte_data(const struct i2c_client *client, u8 command,
|
|
|
+ u8 value)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
data.byte = value;
|
|
@@ -1753,7 +1754,7 @@ EXPORT_SYMBOL(i2c_smbus_write_byte_data);
|
|
|
* This executes the SMBus "read word" protocol, returning negative errno
|
|
|
* else a 16-bit unsigned "word" received from the device.
|
|
|
*/
|
|
|
-s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command)
|
|
|
+s32 i2c_smbus_read_word_data(const struct i2c_client *client, u8 command)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
int status;
|
|
@@ -1774,7 +1775,8 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
|
|
|
* This executes the SMBus "write word" protocol, returning negative errno
|
|
|
* else zero on success.
|
|
|
*/
|
|
|
-s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value)
|
|
|
+s32 i2c_smbus_write_word_data(const struct i2c_client *client, u8 command,
|
|
|
+ u16 value)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
data.word = value;
|
|
@@ -1793,7 +1795,8 @@ EXPORT_SYMBOL(i2c_smbus_write_word_data);
|
|
|
* This executes the SMBus "process call" protocol, returning negative errno
|
|
|
* else a 16-bit unsigned "word" received from the device.
|
|
|
*/
|
|
|
-s32 i2c_smbus_process_call(struct i2c_client *client, u8 command, u16 value)
|
|
|
+s32 i2c_smbus_process_call(const struct i2c_client *client, u8 command,
|
|
|
+ u16 value)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
|
int status;
|
|
@@ -1821,7 +1824,7 @@ EXPORT_SYMBOL(i2c_smbus_process_call);
|
|
|
* support this; its emulation through I2C messaging relies on a specific
|
|
|
* mechanism (I2C_M_RECV_LEN) which may not be implemented.
|
|
|
*/
|
|
|
-s32 i2c_smbus_read_block_data(struct i2c_client *client, u8 command,
|
|
|
+s32 i2c_smbus_read_block_data(const struct i2c_client *client, u8 command,
|
|
|
u8 *values)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
@@ -1848,7 +1851,7 @@ EXPORT_SYMBOL(i2c_smbus_read_block_data);
|
|
|
* This executes the SMBus "block write" protocol, returning negative errno
|
|
|
* else zero on success.
|
|
|
*/
|
|
|
-s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
|
|
|
+s32 i2c_smbus_write_block_data(const struct i2c_client *client, u8 command,
|
|
|
u8 length, const u8 *values)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
@@ -1864,7 +1867,7 @@ s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
|
|
|
EXPORT_SYMBOL(i2c_smbus_write_block_data);
|
|
|
|
|
|
/* Returns the number of read bytes */
|
|
|
-s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command,
|
|
|
+s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client, u8 command,
|
|
|
u8 length, u8 *values)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|
|
@@ -1884,7 +1887,7 @@ s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command,
|
|
|
}
|
|
|
EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
|
|
|
|
|
|
-s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
|
|
|
+s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, u8 command,
|
|
|
u8 length, const u8 *values)
|
|
|
{
|
|
|
union i2c_smbus_data data;
|