]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: init hw i2c speed
authorLewis Huang <Lewis.Huang@amd.com>
Tue, 14 Jan 2020 03:08:34 +0000 (11:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 22 Jan 2020 21:55:28 +0000 (16:55 -0500)
[Why]
Driver didn't init hw i2c speed cause hdcp hw cannot
send command, because the default value of speed register
is 0x2.

[How]
Restore the default speed when release i2c engine

Signed-off-by: Lewis Huang <Lewis.Huang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h

index 49d490214060382e3d0e7491bdc30e276dfd3262..066188ba79498abfc0d523f8b76a26337da4ba1d 100644 (file)
@@ -339,7 +339,7 @@ static void release_engine(
        bool safe_to_reset;
 
        /* Restore original HW engine speed */
-       REG_WRITE(SPEED, dce_i2c_hw->original_speed);
+       set_speed(dce_i2c_hw, dce_i2c_hw->default_speed);
 
        /* Reset HW engine */
        {
@@ -371,7 +371,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
 {
        uint32_t counter = 0;
        enum gpio_result result;
-       uint32_t current_speed;
        struct dce_i2c_hw *dce_i2c_hw = NULL;
 
        if (!ddc)
@@ -409,11 +408,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
 
        dce_i2c_hw->ddc = ddc;
 
-       current_speed = REG_READ(SPEED);
-
-       if (current_speed)
-               dce_i2c_hw->original_speed = current_speed;
-
        if (!setup_engine(dce_i2c_hw)) {
                release_engine(dce_i2c_hw);
                return NULL;
@@ -613,7 +607,6 @@ void dce_i2c_hw_construct(
        dce_i2c_hw->buffer_used_bytes = 0;
        dce_i2c_hw->transaction_count = 0;
        dce_i2c_hw->engine_keep_power_up_count = 1;
-       dce_i2c_hw->original_speed = DEFAULT_I2C_HW_SPEED;
        dce_i2c_hw->default_speed = DEFAULT_I2C_HW_SPEED;
        dce_i2c_hw->send_reset_length = 0;
        dce_i2c_hw->setup_limit = I2C_SETUP_TIME_LIMIT_DCE;
index d4b2037f7d74f10d336b4286a943eb94334cc11f..fb055e6883c0b7044a6497aaf443b58d3fc44694 100644 (file)
@@ -256,7 +256,6 @@ struct i2c_request_transaction_data {
 
 struct dce_i2c_hw {
        struct ddc *ddc;
-       uint32_t original_speed;
        uint32_t engine_keep_power_up_count;
        uint32_t transaction_count;
        uint32_t buffer_used_bytes;