I2C_M_RD was translated to write instead of read.
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
return false;
for (i = 0; i < num; i++) {
- msgs[i].flags = cmd->payloads[i].write ? I2C_M_RD : 0;
+ msgs[i].flags = cmd->payloads[i].write ? 0 : I2C_M_RD;
msgs[i].addr = cmd->payloads[i].address;
msgs[i].len = cmd->payloads[i].length;
msgs[i].buf = cmd->payloads[i].data;
cmd.speed = 100;
for (i = 0; i < num; i++) {
- cmd.payloads[i].write = (msgs[i].flags & I2C_M_RD);
+ cmd.payloads[i].write = !(msgs[i].flags & I2C_M_RD);
cmd.payloads[i].address = msgs[i].addr;
cmd.payloads[i].length = msgs[i].len;
cmd.payloads[i].data = msgs[i].buf;