Commit 4981a661 authored by Tony Cheng's avatar Tony Cheng Committed by Alex Deucher

drm/amd/display: fix bug where we are creating bogus i2c aux

[WHY]
we were using  6 instances based on i2caux_dce110.c

[HOW]
pass in how many instances to ctor
Signed-off-by: default avatarTony Cheng <tony.cheng@amd.com>
Reviewed-by: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b81e5aa3
...@@ -97,6 +97,7 @@ struct i2caux *dal_i2caux_dce100_create( ...@@ -97,6 +97,7 @@ struct i2caux *dal_i2caux_dce100_create(
dal_i2caux_dce110_construct(i2caux_dce110, dal_i2caux_dce110_construct(i2caux_dce110,
ctx, ctx,
ARRAY_SIZE(dce100_aux_regs),
dce100_aux_regs, dce100_aux_regs,
dce100_hw_engine_regs, dce100_hw_engine_regs,
&i2c_shift, &i2c_shift,
......
...@@ -199,6 +199,7 @@ static const struct dce110_i2c_hw_engine_mask i2c_mask = { ...@@ -199,6 +199,7 @@ static const struct dce110_i2c_hw_engine_mask i2c_mask = {
void dal_i2caux_dce110_construct( void dal_i2caux_dce110_construct(
struct i2caux_dce110 *i2caux_dce110, struct i2caux_dce110 *i2caux_dce110,
struct dc_context *ctx, struct dc_context *ctx,
unsigned int num_i2caux_inst,
const struct dce110_aux_registers aux_regs[], const struct dce110_aux_registers aux_regs[],
const struct dce110_i2c_hw_engine_registers i2c_hw_engine_regs[], const struct dce110_i2c_hw_engine_registers i2c_hw_engine_regs[],
const struct dce110_i2c_hw_engine_shift *i2c_shift, const struct dce110_i2c_hw_engine_shift *i2c_shift,
...@@ -251,7 +252,7 @@ void dal_i2caux_dce110_construct( ...@@ -251,7 +252,7 @@ void dal_i2caux_dce110_construct(
dal_i2c_hw_engine_dce110_create(&hw_arg_dce110); dal_i2c_hw_engine_dce110_create(&hw_arg_dce110);
++i; ++i;
} while (i < ARRAY_SIZE(hw_ddc_lines)); } while (i < num_i2caux_inst);
/* Create AUX engines for all lines which has assisted HW AUX /* Create AUX engines for all lines which has assisted HW AUX
* 'i' (loop counter) used as DDC/AUX engine_id */ * 'i' (loop counter) used as DDC/AUX engine_id */
...@@ -272,7 +273,7 @@ void dal_i2caux_dce110_construct( ...@@ -272,7 +273,7 @@ void dal_i2caux_dce110_construct(
dal_aux_engine_dce110_create(&aux_init_data); dal_aux_engine_dce110_create(&aux_init_data);
++i; ++i;
} while (i < ARRAY_SIZE(hw_aux_lines)); } while (i < num_i2caux_inst);
/*TODO Generic I2C SW and HW*/ /*TODO Generic I2C SW and HW*/
} }
...@@ -303,6 +304,7 @@ struct i2caux *dal_i2caux_dce110_create( ...@@ -303,6 +304,7 @@ struct i2caux *dal_i2caux_dce110_create(
dal_i2caux_dce110_construct(i2caux_dce110, dal_i2caux_dce110_construct(i2caux_dce110,
ctx, ctx,
ARRAY_SIZE(dce110_aux_regs),
dce110_aux_regs, dce110_aux_regs,
i2c_hw_engine_regs, i2c_hw_engine_regs,
&i2c_shift, &i2c_shift,
......
...@@ -45,6 +45,7 @@ struct i2caux *dal_i2caux_dce110_create( ...@@ -45,6 +45,7 @@ struct i2caux *dal_i2caux_dce110_create(
void dal_i2caux_dce110_construct( void dal_i2caux_dce110_construct(
struct i2caux_dce110 *i2caux_dce110, struct i2caux_dce110 *i2caux_dce110,
struct dc_context *ctx, struct dc_context *ctx,
unsigned int num_i2caux_inst,
const struct dce110_aux_registers *aux_regs, const struct dce110_aux_registers *aux_regs,
const struct dce110_i2c_hw_engine_registers *i2c_hw_engine_regs, const struct dce110_i2c_hw_engine_registers *i2c_hw_engine_regs,
const struct dce110_i2c_hw_engine_shift *i2c_shift, const struct dce110_i2c_hw_engine_shift *i2c_shift,
......
...@@ -93,6 +93,7 @@ static void construct( ...@@ -93,6 +93,7 @@ static void construct(
{ {
dal_i2caux_dce110_construct(i2caux_dce110, dal_i2caux_dce110_construct(i2caux_dce110,
ctx, ctx,
ARRAY_SIZE(dce112_aux_regs),
dce112_aux_regs, dce112_aux_regs,
dce112_hw_engine_regs, dce112_hw_engine_regs,
&i2c_shift, &i2c_shift,
......
...@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dce120_create( ...@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dce120_create(
dal_i2caux_dce110_construct(i2caux_dce110, dal_i2caux_dce110_construct(i2caux_dce110,
ctx, ctx,
ARRAY_SIZE(dce120_aux_regs),
dce120_aux_regs, dce120_aux_regs,
dce120_hw_engine_regs, dce120_hw_engine_regs,
&i2c_shift, &i2c_shift,
......
...@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dcn10_create( ...@@ -111,6 +111,7 @@ struct i2caux *dal_i2caux_dcn10_create(
dal_i2caux_dce110_construct(i2caux_dce110, dal_i2caux_dce110_construct(i2caux_dce110,
ctx, ctx,
ARRAY_SIZE(dcn10_aux_regs),
dcn10_aux_regs, dcn10_aux_regs,
dcn10_hw_engine_regs, dcn10_hw_engine_regs,
&i2c_shift, &i2c_shift,
......
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