Re: [PATCH 17/40] drm/amdgpu/pm: ADD I2C quirk adapter 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:
>
> From: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
>
> To be used by kernel clients of the adapter.
>
> 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: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
> Suggested-by: Lazar Lijo <Lijo.Lazar@xxxxxxx>
> Signed-off-by: Luben Tuikov <luben.tuikov@xxxxxxx>
> Reviewed-by: Luben Tuikov <luben.tuikov@xxxxxxx>

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

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c       | 7 +++++++
>  drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c         | 6 ++++++
>  drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 ++++++
>  3 files changed, 19 insertions(+)
>
> 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 409299a608e1b3..c2d6d7c8129593 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
> @@ -2004,6 +2004,12 @@ static const struct i2c_algorithm arcturus_i2c_algo = {
>         .functionality = arcturus_i2c_func,
>  };
>
> +
> +static const struct i2c_adapter_quirks arcturus_i2c_control_quirks = {
> +       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .max_write_len = MAX_SW_I2C_COMMANDS,
> +};
> +
>  static int arcturus_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
>  {
>         struct amdgpu_device *adev = to_amdgpu_device(control);
> @@ -2013,6 +2019,7 @@ static int arcturus_i2c_control_init(struct smu_context *smu, struct i2c_adapter
>         control->class = I2C_CLASS_SPD | I2C_CLASS_HWMON;
>         control->dev.parent = &adev->pdev->dev;
>         control->algo = &arcturus_i2c_algo;
> +       control->quirks = &arcturus_i2c_control_quirks;
>         snprintf(control->name, sizeof(control->name), "AMDGPU SMU");
>
>         res = i2c_add_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 4010b891f25678..56000463f64e45 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> @@ -2799,6 +2799,11 @@ static const struct i2c_algorithm navi10_i2c_algo = {
>         .functionality = navi10_i2c_func,
>  };
>
> +static const struct i2c_adapter_quirks navi10_i2c_control_quirks = {
> +       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .max_write_len = MAX_SW_I2C_COMMANDS,
> +};
> +
>  static int navi10_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
>  {
>         struct amdgpu_device *adev = to_amdgpu_device(control);
> @@ -2809,6 +2814,7 @@ static int navi10_i2c_control_init(struct smu_context *smu, struct i2c_adapter *
>         control->dev.parent = &adev->pdev->dev;
>         control->algo = &navi10_i2c_algo;
>         snprintf(control->name, sizeof(control->name), "AMDGPU SMU");
> +       control->quirks = &navi10_i2c_control_quirks;
>
>         res = i2c_add_adapter(control);
>         if (res)
> 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 d5b750d84112fa..86804f3b0a951b 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
> @@ -3487,6 +3487,11 @@ static const struct i2c_algorithm sienna_cichlid_i2c_algo = {
>         .functionality = sienna_cichlid_i2c_func,
>  };
>
> +static const struct i2c_adapter_quirks sienna_cichlid_i2c_control_quirks = {
> +       .max_read_len = MAX_SW_I2C_COMMANDS,
> +       .max_write_len = MAX_SW_I2C_COMMANDS,
> +};
> +
>  static int sienna_cichlid_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control)
>  {
>         struct amdgpu_device *adev = to_amdgpu_device(control);
> @@ -3497,6 +3502,7 @@ static int sienna_cichlid_i2c_control_init(struct smu_context *smu, struct i2c_a
>         control->dev.parent = &adev->pdev->dev;
>         control->algo = &sienna_cichlid_i2c_algo;
>         snprintf(control->name, sizeof(control->name), "AMDGPU SMU");
> +       control->quirks = &sienna_cichlid_i2c_control_quirks;
>
>         res = i2c_add_adapter(control);
>         if (res)
> --
> 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