From d2e4c6dfe706e0608cc6fedbd312fe5120bf8986 Mon Sep 17 00:00:00 2001 From: Mykola Lysenko Date: Thu, 25 Feb 2016 06:01:25 -0500 Subject: [PATCH 0862/1110] drm/amd/dal: fix HW I2C channel status Original code was incorrectly ported from DAL2 Zero I2C status value does not mean an error Signed-off-by: Mykola Lysenko Acked-by: Harry Wentland --- drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c | 7 +++++-- drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2c_hw_engine_dce80.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c index b43a431..a27dbe7 100644 --- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c +++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2c_hw_engine_dce110.c @@ -748,8 +748,11 @@ static enum i2c_channel_operation_result get_channel_status( else if (value & DC_I2C_SW_STATUS__DC_I2C_SW_DONE_MASK) return I2C_CHANNEL_OPERATION_SUCCEEDED; - /* in DAL2, I2C_RESULT_OK was returned */ - return I2C_CHANNEL_OPERATION_NOT_STARTED; + /* + * this is the case when HW used for communication, I2C_SW_STATUS + * could be zero + */ + return I2C_CHANNEL_OPERATION_SUCCEEDED; } static uint8_t get_hw_buffer_available_size( diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2c_hw_engine_dce80.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2c_hw_engine_dce80.c index bce2b94..bc94433 100644 --- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2c_hw_engine_dce80.c +++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2c_hw_engine_dce80.c @@ -742,8 +742,11 @@ static enum i2c_channel_operation_result get_channel_status( else if (value & DC_I2C_SW_STATUS__DC_I2C_SW_DONE_MASK) return I2C_CHANNEL_OPERATION_SUCCEEDED; - /* in DAL2, I2C_RESULT_OK was returned */ - return I2C_CHANNEL_OPERATION_NOT_STARTED; + /* + * this is the case when HW used for communication, I2C_SW_STATUS + * could be zero + */ + return I2C_CHANNEL_OPERATION_SUCCEEDED; } static uint8_t get_hw_buffer_available_size( -- 2.7.4