Commit 30921089 authored by Leo (Sunpeng) Li's avatar Leo (Sunpeng) Li Committed by Alex Deucher

drm/amd/display: Right shift AUX reply value sooner than later

[Why]
There is no point in keeping the AUX reply value in the raw format as
returned from reading the AUX_SW_DATA register.

[How]
Shift it within read_channel_reply(), where the register is read, before
returning it.
Signed-off-by: default avatarLeo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c2437b1f
...@@ -300,9 +300,10 @@ static int read_channel_reply(struct aux_engine *engine, uint32_t size, ...@@ -300,9 +300,10 @@ static int read_channel_reply(struct aux_engine *engine, uint32_t size,
AUX_SW_DATA_RW, 1); AUX_SW_DATA_RW, 1);
REG_GET(AUX_SW_DATA, AUX_SW_DATA, &reply_result_32); REG_GET(AUX_SW_DATA, AUX_SW_DATA, &reply_result_32);
reply_result_32 = reply_result_32 >> 4;
*reply_result = (uint8_t)reply_result_32; *reply_result = (uint8_t)reply_result_32;
if (reply_result_32 >> 4 == 0) { /* ACK */ if (reply_result_32 == 0) { /* ACK */
uint32_t i = 0; uint32_t i = 0;
/* First byte was already used to get the command status */ /* First byte was already used to get the command status */
...@@ -356,7 +357,6 @@ static void process_channel_reply( ...@@ -356,7 +357,6 @@ static void process_channel_reply(
return; return;
} }
} else { } else {
reply_result = reply_result >> 4;
switch (reply_result) { switch (reply_result) {
case 0: /* ACK */ case 0: /* ACK */
......
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