[PATCH v3 1/2] driver: reset: spacemit-p1: add driver for poweroff/reboot

Aurelien Jarno aurelien at aurel32.net
Wed Oct 22 09:48:45 PDT 2025


On 2025-10-22 13:42, Troy Mitchell wrote:
> > > > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> > > > index 8248895ca9038..6577d73edbda4 100644
> > > > --- a/drivers/power/reset/Kconfig
> > > > +++ b/drivers/power/reset/Kconfig
> > > > @@ -283,6 +283,15 @@ config POWER_RESET_KEYSTONE
> > > >  	help
> > > >  	  Reboot support for the KEYSTONE SoCs.
> > > >  
> > > > +config POWER_RESET_SPACEMIT_P1
> > > > +	tristate "SpacemiT P1 poweroff and reset driver"
> > > > +	depends on ARCH_SPACEMIT || COMPILE_TEST
> > > ..
> > > > +	select MFD_SPACEMIT_P1
> > > I'd suggest to use "depends on" instead of "select", the reason is that
> > > using "select" will sometimes ignore the dependency, considering
> > > the reset driver here is tightly coupled with P1, so I think it's 
> > > reasonable to switch to use "depends on", also refer below link
> > > 
> > > https://lxr.linux.no/#linux+v6.7.1/Documentation/kbuild/kconfig-language.rst#L144
> > > 
> > >         select should be used with care. select will force
> > >         a symbol to a value without visiting the dependencies.
> > >         By abusing select you are able to select a symbol FOO even
> > >         if FOO depends on BAR that is not set.
> > >         In general use select only for non-visible symbols
> > >         (no prompts anywhere) and for symbols with no dependencies.
> > >         That will limit the usefulness but on the other hand avoid
> > >         the illegal configurations all over.
> > 
> > Thanks for the pointer, I'll fix that in the next version. I used 
> > REGULATOR_SPACEMIT_P1 and RTC_DRV_SPACEMIT_P1 as examples, they'll also 
> > need to be fixed.
> Yes, I have said here[1].
> Do you want to fix that? If you don't have time, I can do it.

For the reboot patch series, I'll do that in the v4, but I would 
appreciate if you can do it for the PMIC and RTC drivers. I guess it can 
be a patch series with the first patch being the one you already posted.

> > Note also that without the select, a default value has to be added to 
> > MFD_SPACEMIT_P1. 
> Yes, I will add it in my patch. Thanks.

Thanks.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien at aurel32.net                     http://aurel32.net



More information about the linux-riscv mailing list