Re: [PATCH 29/40] drm/amd/pm: Extend the I2C quirk table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 8, 2021 at 5:40 PM Luben Tuikov <luben.tuikov@xxxxxxx> wrote:
>
> Extend the I2C quirk table for SMU access
> controlled I2C adapters. Let the kernel I2C layer
> check that the messages all have the same address,
> and that their combined size doesn't exceed the
> maximum size of a SMU software I2C request.
>
> Suggested-by: Jean Delvare <jdelvare@xxxxxxx>
> Cc: Jean Delvare <jdelvare@xxxxxxx>
> Cc: Alexander Deucher <Alexander.Deucher@xxxxxxx>
> Cc: Andrey Grodzovsky <Andrey.Grodzovsky@xxxxxxx>
> Cc: Lijo Lazar <Lijo.Lazar@xxxxxxx>
> Cc: Stanley Yang <Stanley.Yang@xxxxxxx>
> Cc: Hawking Zhang <Hawking.Zhang@xxxxxxx>
> Signed-off-by: Luben Tuikov <luben.tuikov@xxxxxxx>

Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c       | 5 ++++-
>  drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c         | 5 ++++-
>  drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 5 ++++-
>  3 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> index 974740ac72fded..de8d7513042966 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> @@ -2006,8 +2006,11 @@ static const struct i2c_algorithm arcturus_i2c_algo = {
>
>
>  static const struct i2c_adapter_quirks arcturus_i2c_control_quirks = {
> -       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .flags = I2C_AQ_COMB | I2C_AQ_COMB_SAME_ADDR,
> +       .max_read_len  = MAX_SW_I2C_COMMANDS,
>         .max_write_len = MAX_SW_I2C_COMMANDS,
> +       .max_comb_1st_msg_len = 2,
> +       .max_comb_2nd_msg_len = MAX_SW_I2C_COMMANDS - 2,
>  };
>
>  static int arcturus_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> index 8ab06fa87edb04..1b8cd3746d0ebc 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> @@ -2800,8 +2800,11 @@ static const struct i2c_algorithm navi10_i2c_algo = {
>  };
>
>  static const struct i2c_adapter_quirks navi10_i2c_control_quirks = {
> -       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .flags = I2C_AQ_COMB | I2C_AQ_COMB_SAME_ADDR,
> +       .max_read_len  = MAX_SW_I2C_COMMANDS,
>         .max_write_len = MAX_SW_I2C_COMMANDS,
> +       .max_comb_1st_msg_len = 2,
> +       .max_comb_2nd_msg_len = MAX_SW_I2C_COMMANDS - 2,
>  };
>
>  static int navi10_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> index 91614ae186f7f5..b38127f8009d3d 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
> @@ -3488,8 +3488,11 @@ static const struct i2c_algorithm sienna_cichlid_i2c_algo = {
>  };
>
>  static const struct i2c_adapter_quirks sienna_cichlid_i2c_control_quirks = {
> -       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .flags = I2C_AQ_COMB | I2C_AQ_COMB_SAME_ADDR,
> +       .max_read_len  = MAX_SW_I2C_COMMANDS,
>         .max_write_len = MAX_SW_I2C_COMMANDS,
> +       .max_comb_1st_msg_len = 2,
> +       .max_comb_2nd_msg_len = MAX_SW_I2C_COMMANDS - 2,
>  };
>
>  static int sienna_cichlid_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
> --
> 2.32.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux