Am Montag, 9. Dezember 2024, 13:33:29 CET schrieb Andy Yan:
> From: Andy Yan <andy....@rock-chips.com>
> 
> There is a version number hardcoded in the VOP VERSION_INFO
> register, and the version number increments sequentially based
> on the production order of the SOC.
> 
> So using this version number to distinguish different VOP features
> will simplify the code.
> 
> Signed-off-by: Andy Yan <andy....@rock-chips.com>
> Tested-by: Michael Riesch <michael.rie...@wolfvision.net> # on RK3568
> Tested-by: Detlev Casanova <detlev.casan...@collabora.com>

> @@ -798,6 +798,7 @@ static void rk3588_vop2_power_domain_enable_all(struct 
> vop2 *vop2)
>  static void vop2_enable(struct vop2 *vop2)
>  {
>       int ret;
> +     u32 version;
>  
>       ret = pm_runtime_resume_and_get(vop2->dev);
>       if (ret < 0) {
> @@ -817,10 +818,19 @@ static void vop2_enable(struct vop2 *vop2)
>               return;
>       }
>  
> +     version = vop2_readl(vop2, RK3568_VERSION_INFO);
> +     if (version != vop2->version) {
> +             drm_err(vop2->drm, "Hardware version(0x%08x) mismatch\n", 
> version);
> +             return;
> +     }

style-nit: please add a blank line here.

> +     /*
> +      * rk3566 share the same vop version with rk3568, so
> +      * wen need to use soc_id for identification here.
> +      */
>       if (vop2->data->soc_id == 3566)
>               vop2_writel(vop2, RK3568_OTP_WIN_EN, 1);
>  

otherwise, looks good.

Thanks
Heiko


Reply via email to