From: Leo (Sunpeng) Li Date: Tue, 26 Jun 2018 14:44:05 +0000 (-0400) Subject: drm/amd/display: Right shift AUX reply value sooner than later X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3092108904461dd50b1502f3a2977a4259d91044;p=openwrt%2Fstaging%2Fblogic.git 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: Leo (Sunpeng) Li Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c b/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c index 1f3940644a5b..ae5caa97caca 100644 --- a/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c +++ b/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c @@ -300,9 +300,10 @@ static int read_channel_reply(struct aux_engine *engine, uint32_t size, AUX_SW_DATA_RW, 1); 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; - if (reply_result_32 >> 4 == 0) { /* ACK */ + if (reply_result_32 == 0) { /* ACK */ uint32_t i = 0; /* First byte was already used to get the command status */ @@ -356,7 +357,6 @@ static void process_channel_reply( return; } } else { - reply_result = reply_result >> 4; switch (reply_result) { case 0: /* ACK */