diff options
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 36e1214b0b1..88dd803174a 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -901,7 +901,7 @@ s32 i2c_smbus_read_byte(struct i2c_client *client) | |||
901 | I2C_SMBUS_READ,0,I2C_SMBUS_BYTE, &data)) | 901 | I2C_SMBUS_READ,0,I2C_SMBUS_BYTE, &data)) |
902 | return -1; | 902 | return -1; |
903 | else | 903 | else |
904 | return 0x0FF & data.byte; | 904 | return data.byte; |
905 | } | 905 | } |
906 | 906 | ||
907 | s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value) | 907 | s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value) |
@@ -917,7 +917,7 @@ s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command) | |||
917 | I2C_SMBUS_READ,command, I2C_SMBUS_BYTE_DATA,&data)) | 917 | I2C_SMBUS_READ,command, I2C_SMBUS_BYTE_DATA,&data)) |
918 | return -1; | 918 | return -1; |
919 | else | 919 | else |
920 | return 0x0FF & data.byte; | 920 | return data.byte; |
921 | } | 921 | } |
922 | 922 | ||
923 | s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value) | 923 | s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 command, u8 value) |
@@ -936,7 +936,7 @@ s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command) | |||
936 | I2C_SMBUS_READ,command, I2C_SMBUS_WORD_DATA, &data)) | 936 | I2C_SMBUS_READ,command, I2C_SMBUS_WORD_DATA, &data)) |
937 | return -1; | 937 | return -1; |
938 | else | 938 | else |
939 | return 0x0FFFF & data.word; | 939 | return data.word; |
940 | } | 940 | } |
941 | 941 | ||
942 | s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value) | 942 | s32 i2c_smbus_write_word_data(struct i2c_client *client, u8 command, u16 value) |
@@ -1039,7 +1039,7 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr, | |||
1039 | else { | 1039 | else { |
1040 | msg[0].len=3; | 1040 | msg[0].len=3; |
1041 | msgbuf0[1] = data->word & 0xff; | 1041 | msgbuf0[1] = data->word & 0xff; |
1042 | msgbuf0[2] = (data->word >> 8) & 0xff; | 1042 | msgbuf0[2] = data->word >> 8; |
1043 | } | 1043 | } |
1044 | break; | 1044 | break; |
1045 | case I2C_SMBUS_PROC_CALL: | 1045 | case I2C_SMBUS_PROC_CALL: |
@@ -1048,7 +1048,7 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr, | |||
1048 | msg[0].len = 3; | 1048 | msg[0].len = 3; |
1049 | msg[1].len = 2; | 1049 | msg[1].len = 2; |
1050 | msgbuf0[1] = data->word & 0xff; | 1050 | msgbuf0[1] = data->word & 0xff; |
1051 | msgbuf0[2] = (data->word >> 8) & 0xff; | 1051 | msgbuf0[2] = data->word >> 8; |
1052 | break; | 1052 | break; |
1053 | case I2C_SMBUS_BLOCK_DATA: | 1053 | case I2C_SMBUS_BLOCK_DATA: |
1054 | if (read_write == I2C_SMBUS_READ) { | 1054 | if (read_write == I2C_SMBUS_READ) { |