[PATCH 2/3] clk: sophgo: Add support for newly added precise compatible

Inochi Amaoto posted 3 patches 9 months, 2 weeks ago
There is a newer version of this series
[PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Inochi Amaoto 9 months, 2 weeks ago
Add of device id definition for newly added precise compatible.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 drivers/clk/sophgo/clk-cv1800.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
index e0c4dc347579..e10221df6385 100644
--- a/drivers/clk/sophgo/clk-cv1800.c
+++ b/drivers/clk/sophgo/clk-cv1800.c
@@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
 
 static const struct of_device_id cv1800_clk_ids[] = {
 	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
+	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
 	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
+	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
 	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
+	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, cv1800_clk_ids);
-- 
2.49.0
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Alexander Sverdlin 9 months, 2 weeks ago
Hi Inochi!

On Wed, 2025-04-30 at 10:09 +0800, Inochi Amaoto wrote:
> Add of device id definition for newly added precise compatible.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  drivers/clk/sophgo/clk-cv1800.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> index e0c4dc347579..e10221df6385 100644
> --- a/drivers/clk/sophgo/clk-cv1800.c
> +++ b/drivers/clk/sophgo/clk-cv1800.c
> @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
>  
>  static const struct of_device_id cv1800_clk_ids[] = {
>  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
>  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
                                                           ^
Should it have been "cv1810_desc" instead?

>  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, cv1800_clk_ids);

-- 
Alexander Sverdlin.
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Inochi Amaoto 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 05:39:52PM +0200, Alexander Sverdlin wrote:
> Hi Inochi!
> 
> On Wed, 2025-04-30 at 10:09 +0800, Inochi Amaoto wrote:
> > Add of device id definition for newly added precise compatible.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > index e0c4dc347579..e10221df6385 100644
> > --- a/drivers/clk/sophgo/clk-cv1800.c
> > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> >  
> >  static const struct of_device_id cv1800_clk_ids[] = {
> >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> >  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> > +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
>                                                            ^
> Should it have been "cv1810_desc" instead?
> 

Yeah, this is a mistake. I will fix it.

> >  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> > +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, cv1800_clk_ids);
> 
> -- 
> Alexander Sverdlin.
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Conor Dooley 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> Add of device id definition for newly added precise compatible.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  drivers/clk/sophgo/clk-cv1800.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> index e0c4dc347579..e10221df6385 100644
> --- a/drivers/clk/sophgo/clk-cv1800.c
> +++ b/drivers/clk/sophgo/clk-cv1800.c
> @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
>  
>  static const struct of_device_id cv1800_clk_ids[] = {
>  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },

Given the same data is used here, should there not be fallbacks in the
dt for some of these? For example, 1812 to 1800? Or is that not okay,
because 1800 is not a real device id?

>  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
>  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, cv1800_clk_ids);
> -- 
> 2.49.0
> 
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Inochi Amaoto 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 04:33:39PM +0100, Conor Dooley wrote:
> On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> > Add of device id definition for newly added precise compatible.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > index e0c4dc347579..e10221df6385 100644
> > --- a/drivers/clk/sophgo/clk-cv1800.c
> > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> >  
> >  static const struct of_device_id cv1800_clk_ids[] = {
> >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> 
> Given the same data is used here, should there not be fallbacks in the
> dt for some of these? For example, 1812 to 1800? 

In default, there maybe not fallback for the whole series, I think.
But it is possible to use cv1800b as 

> Or is that not okay, because 1800 is not a real device id?

Yes, cv1800-clk and cv1810-clk is a old wildcard compatible, not a
real one. As this is not prefered, I want to fix this to have a
meaningful compatible.

Regards,
Inochi
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Conor Dooley 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 04:33:39PM +0100, Conor Dooley wrote:
> On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> > Add of device id definition for newly added precise compatible.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > index e0c4dc347579..e10221df6385 100644
> > --- a/drivers/clk/sophgo/clk-cv1800.c
> > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> >  
> >  static const struct of_device_id cv1800_clk_ids[] = {
> >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> 
> Given the same data is used here, should there not be fallbacks in the
> dt for some of these? For example, 1812 to 1800? Or is that not okay,
> because 1800 is not a real device id?
> 
> >  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> > +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
> >  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> > +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },

Actually, this one is a better example. sg2000 is not marked deprecated.
sg2002 uses the same match data. Why is no fallback to sg2000 used for
the sg2002 case?
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Inochi Amaoto 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 04:37:01PM +0100, Conor Dooley wrote:
> On Wed, Apr 30, 2025 at 04:33:39PM +0100, Conor Dooley wrote:
> > On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> > > Add of device id definition for newly added precise compatible.
> > > 
> > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > ---
> > >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > > index e0c4dc347579..e10221df6385 100644
> > > --- a/drivers/clk/sophgo/clk-cv1800.c
> > > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> > >  
> > >  static const struct of_device_id cv1800_clk_ids[] = {
> > >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> > 
> > Given the same data is used here, should there not be fallbacks in the
> > dt for some of these? For example, 1812 to 1800? Or is that not okay,
> > because 1800 is not a real device id?
> > 
> > >  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> > > +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
> > >  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> > > +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
> 
> Actually, this one is a better example. sg2000 is not marked deprecated.
> sg2002 uses the same match data. Why is no fallback to sg2000 used for
> the sg2002 case?

Yeah, It is a good idea. I will take it, thanks,

Regards,
Inochi
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Conor Dooley 9 months, 1 week ago
On Thu, May 01, 2025 at 06:43:07AM +0800, Inochi Amaoto wrote:
> On Wed, Apr 30, 2025 at 04:37:01PM +0100, Conor Dooley wrote:
> > On Wed, Apr 30, 2025 at 04:33:39PM +0100, Conor Dooley wrote:
> > > On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> > > > Add of device id definition for newly added precise compatible.
> > > > 
> > > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > > ---
> > > >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > > > index e0c4dc347579..e10221df6385 100644
> > > > --- a/drivers/clk/sophgo/clk-cv1800.c
> > > > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > > > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> > > >  
> > > >  static const struct of_device_id cv1800_clk_ids[] = {
> > > >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > > > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> > > 
> > > Given the same data is used here, should there not be fallbacks in the
> > > dt for some of these? For example, 1812 to 1800? Or is that not okay,
> > > because 1800 is not a real device id?
> > > 
> > > >  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> > > > +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
> > > >  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> > > > +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
> > 
> > Actually, this one is a better example. sg2000 is not marked deprecated.
> > sg2002 uses the same match data. Why is no fallback to sg2000 used for
> > the sg2002 case?
> 
> Yeah, It is a good idea. I will take it, thanks,

Can you point out the difference in the dt-binding patch when you do,
between the sg2000 being a real device and the others not?
Re: [PATCH 2/3] clk: sophgo: Add support for newly added precise compatible
Posted by Inochi Amaoto 9 months, 1 week ago
On Thu, May 01, 2025 at 03:22:17PM +0100, Conor Dooley wrote:
> On Thu, May 01, 2025 at 06:43:07AM +0800, Inochi Amaoto wrote:
> > On Wed, Apr 30, 2025 at 04:37:01PM +0100, Conor Dooley wrote:
> > > On Wed, Apr 30, 2025 at 04:33:39PM +0100, Conor Dooley wrote:
> > > > On Wed, Apr 30, 2025 at 10:09:30AM +0800, Inochi Amaoto wrote:
> > > > > Add of device id definition for newly added precise compatible.
> > > > > 
> > > > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > > > ---
> > > > >  drivers/clk/sophgo/clk-cv1800.c | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c
> > > > > index e0c4dc347579..e10221df6385 100644
> > > > > --- a/drivers/clk/sophgo/clk-cv1800.c
> > > > > +++ b/drivers/clk/sophgo/clk-cv1800.c
> > > > > @@ -1519,8 +1519,11 @@ static int cv1800_clk_probe(struct platform_device *pdev)
> > > > >  
> > > > >  static const struct of_device_id cv1800_clk_ids[] = {
> > > > >  	{ .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc },
> > > > > +	{ .compatible = "sophgo,cv1800b-clk", .data = &cv1800_desc },
> > > > 
> > > > Given the same data is used here, should there not be fallbacks in the
> > > > dt for some of these? For example, 1812 to 1800? Or is that not okay,
> > > > because 1800 is not a real device id?
> > > > 
> > > > >  	{ .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc },
> > > > > +	{ .compatible = "sophgo,cv1812h-clk", .data = &cv1800_desc },
> > > > >  	{ .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc },
> > > > > +	{ .compatible = "sophgo,sg2002-clk", .data = &sg2000_desc },
> > > 
> > > Actually, this one is a better example. sg2000 is not marked deprecated.
> > > sg2002 uses the same match data. Why is no fallback to sg2000 used for
> > > the sg2002 case?
> > 
> > Yeah, It is a good idea. I will take it, thanks,
> 
> Can you point out the difference in the dt-binding patch when you do,
> between the sg2000 being a real device and the others not?

I will, thanks for the reminder.

Regards,
Inochi