[PATCH v3 3/5] reset: th1520: Prepare for supporting multiple controllers
Yao Zi
ziyao at disroot.org
Wed Oct 29 08:13:46 PDT 2025
On Wed, Oct 29, 2025 at 12:54:25PM +0000, Drew Fustini wrote:
> 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?
Yes, this regmap operation is for initializing GPU resets and thus
modifies TH1520_GPU_RST_CFG, which only applies for the VO reset
controller (with compatible "thead,th1520-reset") but not others, or
other unrelated resets could be unexpectedly asserted.
> Thanks,
> Drew
Regards,
Yao Zi
More information about the linux-riscv
mailing list