Commit 3cb9567d authored by Ellen Wang's avatar Ellen Wang Committed by Luis Henriques

HID: cp2112: fix I2C_SMBUS_BYTE write

commit 6d00d153 upstream.

When doing an I2C_SMBUS_BYTE write (one byte write, no address),
the data to be written is in "command" not "data->byte".
Signed-off-by: default avatarEllen Wang <ellen@cumulusnetworks.com>
Acked-by: default avatarWolfram Sang <wsa@the-dreams.de>
Reviewed-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 9b04189c
...@@ -451,7 +451,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr, ...@@ -451,7 +451,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
if (I2C_SMBUS_READ == read_write) if (I2C_SMBUS_READ == read_write)
count = cp2112_read_req(buf, addr, read_length); count = cp2112_read_req(buf, addr, read_length);
else else
count = cp2112_write_req(buf, addr, data->byte, NULL, count = cp2112_write_req(buf, addr, command, NULL,
0); 0);
break; break;
case I2C_SMBUS_BYTE_DATA: case I2C_SMBUS_BYTE_DATA:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment