drm/amd/display: Fix i2c write flag.
authorAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Sun, 5 Mar 2017 01:56:46 +0000 (20:56 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:22:14 +0000 (17:22 -0400)
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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c

index bc0bfa9586ee9a9eb5df90e5c76fb2f70649e32c..5b096be44e596495b49a16aca3c38cf2961dc940 100644 (file)
@@ -423,7 +423,7 @@ bool dm_helpers_submit_i2c(
                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;
index df7cc463b94634405574b7e951034238611d2241..c09af2b3350c8d8e715452d44a2f6dd382ca6547 100644 (file)
@@ -1948,7 +1948,7 @@ int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
        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;