diff mbox series

[2/4] reset: simple: add support for Sophgo CV1800B

Message ID 20250209122936.2338821-3-inochiama@gmail.com (mailing list archive)
State Handled Elsewhere
Headers show
Series riscv: sophgo: cv18xx: Add reset generator support | expand

Checks

Context Check Description
bjorn/pre-ci_am success Success
bjorn/build-rv32-defconfig success build-rv32-defconfig
bjorn/build-rv64-clang-allmodconfig success build-rv64-clang-allmodconfig
bjorn/build-rv64-gcc-allmodconfig success build-rv64-gcc-allmodconfig
bjorn/build-rv64-nommu-k210-defconfig success build-rv64-nommu-k210-defconfig
bjorn/build-rv64-nommu-k210-virt success build-rv64-nommu-k210-virt
bjorn/checkpatch success checkpatch
bjorn/dtb-warn-rv64 success dtb-warn-rv64
bjorn/header-inline success header-inline
bjorn/kdoc success kdoc
bjorn/module-param success module-param
bjorn/verify-fixes success verify-fixes
bjorn/verify-signedoff success verify-signedoff

Commit Message

Inochi Amaoto Feb. 9, 2025, 12:29 p.m. UTC
Reuse reset-simple driver for the Sophgo CV1800B reset generator.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 drivers/reset/reset-simple.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Yixun Lan Feb. 9, 2025, 1:46 p.m. UTC | #1
Hi

On 20:29 Sun 09 Feb     , Inochi Amaoto wrote:
> Reuse reset-simple driver for the Sophgo CV1800B reset generator.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  drivers/reset/reset-simple.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c
> index 276067839830..79e94ecfe4f5 100644
> --- a/drivers/reset/reset-simple.c
> +++ b/drivers/reset/reset-simple.c
> @@ -151,6 +151,8 @@ static const struct of_device_id reset_simple_dt_ids[] = {
>  	{ .compatible = "snps,dw-high-reset" },
>  	{ .compatible = "snps,dw-low-reset",
>  		.data = &reset_simple_active_low },
> +	{ .compatible = "sophgo,cv1800b-reset",
> +		.data = &reset_simple_active_low },
I think this isn't really a problem, but..

quite a lot SoCs use the "simple active low" IP,
can we introduce a generic compatible? so can set as fallback..
intead of growing this compatible data each time for new SoC

>  	{ .compatible = "sophgo,sg2042-reset",
>  		.data = &reset_simple_active_low },
>  	{ /* sentinel */ },
> -- 
> 2.48.1
>
Inochi Amaoto Feb. 10, 2025, 4:50 a.m. UTC | #2
On Sun, Feb 09, 2025 at 01:46:52PM +0000, Yixun Lan wrote:
> Hi
> 
> On 20:29 Sun 09 Feb     , Inochi Amaoto wrote:
> > Reuse reset-simple driver for the Sophgo CV1800B reset generator.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  drivers/reset/reset-simple.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c
> > index 276067839830..79e94ecfe4f5 100644
> > --- a/drivers/reset/reset-simple.c
> > +++ b/drivers/reset/reset-simple.c
> > @@ -151,6 +151,8 @@ static const struct of_device_id reset_simple_dt_ids[] = {
> >  	{ .compatible = "snps,dw-high-reset" },
> >  	{ .compatible = "snps,dw-low-reset",
> >  		.data = &reset_simple_active_low },
> > +	{ .compatible = "sophgo,cv1800b-reset",
> > +		.data = &reset_simple_active_low },
> I think this isn't really a problem, but..
> 
> quite a lot SoCs use the "simple active low" IP,
> can we introduce a generic compatible? so can set as fallback..
> intead of growing this compatible data each time for new SoC
> 

I have already considered this idea and design something like
"reset-simple-high" and "reset-simple-low" to cover these
generic scenarios. But adding something like this is too hard
for me to migrate existing devices. So finally I drop this and
added the device id, as I am not sure whether is better.

Regards,
Inochi
diff mbox series

Patch

diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c
index 276067839830..79e94ecfe4f5 100644
--- a/drivers/reset/reset-simple.c
+++ b/drivers/reset/reset-simple.c
@@ -151,6 +151,8 @@  static const struct of_device_id reset_simple_dt_ids[] = {
 	{ .compatible = "snps,dw-high-reset" },
 	{ .compatible = "snps,dw-low-reset",
 		.data = &reset_simple_active_low },
+	{ .compatible = "sophgo,cv1800b-reset",
+		.data = &reset_simple_active_low },
 	{ .compatible = "sophgo,sg2042-reset",
 		.data = &reset_simple_active_low },
 	{ /* sentinel */ },