Commit 09f6dd6e authored by Lewis Huang's avatar Lewis Huang Committed by Alex Deucher

drm/amd/display: init hw i2c speed

[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: default avatarLewis Huang <Lewis.Huang@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 947daab2
...@@ -339,7 +339,7 @@ static void release_engine( ...@@ -339,7 +339,7 @@ static void release_engine(
bool safe_to_reset; bool safe_to_reset;
/* Restore original HW engine speed */ /* 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 */ /* Reset HW engine */
{ {
...@@ -371,7 +371,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine( ...@@ -371,7 +371,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
{ {
uint32_t counter = 0; uint32_t counter = 0;
enum gpio_result result; enum gpio_result result;
uint32_t current_speed;
struct dce_i2c_hw *dce_i2c_hw = NULL; struct dce_i2c_hw *dce_i2c_hw = NULL;
if (!ddc) if (!ddc)
...@@ -409,11 +408,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine( ...@@ -409,11 +408,6 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
dce_i2c_hw->ddc = ddc; 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)) { if (!setup_engine(dce_i2c_hw)) {
release_engine(dce_i2c_hw); release_engine(dce_i2c_hw);
return NULL; return NULL;
...@@ -613,7 +607,6 @@ void dce_i2c_hw_construct( ...@@ -613,7 +607,6 @@ void dce_i2c_hw_construct(
dce_i2c_hw->buffer_used_bytes = 0; dce_i2c_hw->buffer_used_bytes = 0;
dce_i2c_hw->transaction_count = 0; dce_i2c_hw->transaction_count = 0;
dce_i2c_hw->engine_keep_power_up_count = 1; 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->default_speed = DEFAULT_I2C_HW_SPEED;
dce_i2c_hw->send_reset_length = 0; dce_i2c_hw->send_reset_length = 0;
dce_i2c_hw->setup_limit = I2C_SETUP_TIME_LIMIT_DCE; dce_i2c_hw->setup_limit = I2C_SETUP_TIME_LIMIT_DCE;
......
...@@ -256,7 +256,6 @@ struct i2c_request_transaction_data { ...@@ -256,7 +256,6 @@ struct i2c_request_transaction_data {
struct dce_i2c_hw { struct dce_i2c_hw {
struct ddc *ddc; struct ddc *ddc;
uint32_t original_speed;
uint32_t engine_keep_power_up_count; uint32_t engine_keep_power_up_count;
uint32_t transaction_count; uint32_t transaction_count;
uint32_t buffer_used_bytes; uint32_t buffer_used_bytes;
......
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