[PATCH v3 3/5] reset: th1520: Prepare for supporting multiple controllers

Drew Fustini fustini at kernel.org
Wed Oct 29 05:54:25 PDT 2025


On Tue, Oct 14, 2025 at 01:10:30PM +0000, Yao Zi wrote:
> TH1520 SoC is divided into several subsystems, shipping distinct reset
> controllers with similar control logic. Let's make reset signal mapping
> a data structure specific to one compatible to prepare for introduction
> of more reset controllers in the future.
> 
> Signed-off-by: Yao Zi <ziyao at disroot.org>
> ---
>  drivers/reset/reset-th1520.c | 42 +++++++++++++++++++++++++-----------
>  1 file changed, 30 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/reset/reset-th1520.c b/drivers/reset/reset-th1520.c
> index 14d964a9c6b6..2b65a95ed021 100644
> --- a/drivers/reset/reset-th1520.c
> +++ b/drivers/reset/reset-th1520.c
[snip]
> @@ -138,22 +147,31 @@ static int th1520_reset_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->map))
>  		return PTR_ERR(priv->map);
>  
> -	/* Initialize GPU resets to asserted state */
> -	ret = regmap_update_bits(priv->map, TH1520_GPU_RST_CFG,
> -				 TH1520_GPU_RST_CFG_MASK, 0);
> -	if (ret)
> -		return ret;
> +	if (of_device_is_compatible(dev->of_node, "thead,th1520-reset")) {

Is there a reason that there is a now a conditional check for the
compatible here?

Thanks,
Drew



More information about the linux-riscv mailing list