[PATCH 10/16] drm/amd/display: Fix i2c write flag.

Harry Wentland harry.wentland at amd.com
Mon Apr 3 23:07:24 UTC 2017


From: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>

I2C_M_RD was translated to write instead of read.

Change-Id: I49e819ca6d8519d91eb13b371d773b2eb1b601e5
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 5d45c0fe3643..ca4fa5c8d8bf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -422,7 +422,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;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 5e231c3ff482..a260bb5fad3b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -2121,7 +2121,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;
-- 
2.11.0



More information about the amd-gfx mailing list