diff mbox series

[v1,1/2] watchdog: starfive-wdt: Add JH8100 watchdog compatible string

Message ID 20231209142723.2060196-2-jisheng.teoh@starfivetech.com (mailing list archive)
State Superseded
Headers show
Series Add StarFive JH8100 watchdog | expand

Commit Message

Ji Sheng Teoh Dec. 9, 2023, 2:27 p.m. UTC
Add "starfive,jh8100-wdt" compatible for StarFive's JH8100 watchdog.
JH8100 watchdog reuses JH7110 register mapping.

Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
---
 drivers/watchdog/starfive-wdt.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck Dec. 9, 2023, 3:06 p.m. UTC | #1
On 12/9/23 06:27, Ji Sheng Teoh wrote:
> Add "starfive,jh8100-wdt" compatible for StarFive's JH8100 watchdog.
> JH8100 watchdog reuses JH7110 register mapping.
> 
> Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
> Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/starfive-wdt.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
> index 5f501b41faf9..31785bb373d5 100644
> --- a/drivers/watchdog/starfive-wdt.c
> +++ b/drivers/watchdog/starfive-wdt.c
> @@ -581,6 +581,7 @@ static const struct dev_pm_ops starfive_wdt_pm_ops = {
>   static const struct of_device_id starfive_wdt_match[] = {
>   	{ .compatible = "starfive,jh7100-wdt", .data = &starfive_wdt_jh7100_variant },
>   	{ .compatible = "starfive,jh7110-wdt", .data = &starfive_wdt_jh7110_variant },
> +	{ .compatible = "starfive,jh8100-wdt", .data = &starfive_wdt_jh7110_variant },
>   	{ /* sentinel */ }
>   };
>   MODULE_DEVICE_TABLE(of, starfive_wdt_match);
Krzysztof Kozlowski Dec. 11, 2023, 10:06 a.m. UTC | #2
On 09/12/2023 15:27, Ji Sheng Teoh wrote:
> Add "starfive,jh8100-wdt" compatible for StarFive's JH8100 watchdog.
> JH8100 watchdog reuses JH7110 register mapping.
> 
> Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
> Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
> ---
>  drivers/watchdog/starfive-wdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
> index 5f501b41faf9..31785bb373d5 100644
> --- a/drivers/watchdog/starfive-wdt.c
> +++ b/drivers/watchdog/starfive-wdt.c
> @@ -581,6 +581,7 @@ static const struct dev_pm_ops starfive_wdt_pm_ops = {
>  static const struct of_device_id starfive_wdt_match[] = {
>  	{ .compatible = "starfive,jh7100-wdt", .data = &starfive_wdt_jh7100_variant },
>  	{ .compatible = "starfive,jh7110-wdt", .data = &starfive_wdt_jh7110_variant },
> +	{ .compatible = "starfive,jh8100-wdt", .data = &starfive_wdt_jh7110_variant },

Device is compatible, so why not expressing it in the bindings and
dropping this change?

Best regards,
Krzysztof
Ji Sheng Teoh Dec. 11, 2023, 4:47 p.m. UTC | #3
On Mon, 11 Dec 2023 11:06:42 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> On 09/12/2023 15:27, Ji Sheng Teoh wrote:
> > Add "starfive,jh8100-wdt" compatible for StarFive's JH8100 watchdog.
> > JH8100 watchdog reuses JH7110 register mapping.
> > 
> > Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
> > Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
> > ---
> >  drivers/watchdog/starfive-wdt.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/watchdog/starfive-wdt.c
> > b/drivers/watchdog/starfive-wdt.c index 5f501b41faf9..31785bb373d5
> > 100644 --- a/drivers/watchdog/starfive-wdt.c
> > +++ b/drivers/watchdog/starfive-wdt.c
> > @@ -581,6 +581,7 @@ static const struct dev_pm_ops
> > starfive_wdt_pm_ops = { static const struct of_device_id
> > starfive_wdt_match[] = { { .compatible = "starfive,jh7100-wdt",
> > .data = &starfive_wdt_jh7100_variant }, { .compatible =
> > "starfive,jh7110-wdt", .data = &starfive_wdt_jh7110_variant },
> > +	{ .compatible = "starfive,jh8100-wdt", .data =
> > &starfive_wdt_jh7110_variant },  
> 
> Device is compatible, so why not expressing it in the bindings and
> dropping this change?
> 
> Best regards,
> Krzysztof
> 

Ok, will drop this change.

Thanks,
Ji Sheng
Xingyu Wu Dec. 12, 2023, 3:01 a.m. UTC | #4
On 2023/12/12 0:47, Ji Sheng Teoh wrote:
> On Mon, 11 Dec 2023 11:06:42 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
>> On 09/12/2023 15:27, Ji Sheng Teoh wrote:
>> > Add "starfive,jh8100-wdt" compatible for StarFive's JH8100 watchdog.
>> > JH8100 watchdog reuses JH7110 register mapping.
>> > 
>> > Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
>> > Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
>> > ---
>> >  drivers/watchdog/starfive-wdt.c | 1 +
>> >  1 file changed, 1 insertion(+)
>> > 
>> > diff --git a/drivers/watchdog/starfive-wdt.c
>> > b/drivers/watchdog/starfive-wdt.c index 5f501b41faf9..31785bb373d5
>> > 100644 --- a/drivers/watchdog/starfive-wdt.c
>> > +++ b/drivers/watchdog/starfive-wdt.c
>> > @@ -581,6 +581,7 @@ static const struct dev_pm_ops
>> > starfive_wdt_pm_ops = { static const struct of_device_id
>> > starfive_wdt_match[] = { { .compatible = "starfive,jh7100-wdt",
>> > .data = &starfive_wdt_jh7100_variant }, { .compatible =
>> > "starfive,jh7110-wdt", .data = &starfive_wdt_jh7110_variant },
>> > +	{ .compatible = "starfive,jh8100-wdt", .data =
>> > &starfive_wdt_jh7110_variant },  
>> 
>> Device is compatible, so why not expressing it in the bindings and
>> dropping this change?
>> 
>> Best regards,
>> Krzysztof
>> 
> 
> Ok, will drop this change.
> 
> Thanks,
> Ji Sheng

Hi Ji Sheng,

You can add the compatible "starfive,jh8100-wdt" in the bindings and add this:

	compatible = "starfive,jh8100-wdt", "starfive,jh7110-wdt";

in the dts. I think it would be better and does not change the driver.

Best regards,
Xingyu Wu
Ji Sheng Teoh Dec. 12, 2023, 3:27 a.m. UTC | #5
On Tue, 12 Dec 2023 11:01:21 +0800
Xingyu Wu <xingyu.wu@starfivetech.com> wrote:

> On 2023/12/12 0:47, Ji Sheng Teoh wrote:
> > On Mon, 11 Dec 2023 11:06:42 +0100
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> >   
> >> On 09/12/2023 15:27, Ji Sheng Teoh wrote:  
> >> > Add "starfive,jh8100-wdt" compatible for StarFive's JH8100
> >> > watchdog. JH8100 watchdog reuses JH7110 register mapping.
> >> > 
> >> > Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
> >> > Signed-off-by: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
> >> > ---
> >> >  drivers/watchdog/starfive-wdt.c | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> > 
> >> > diff --git a/drivers/watchdog/starfive-wdt.c
> >> > b/drivers/watchdog/starfive-wdt.c index
> >> > 5f501b41faf9..31785bb373d5 100644 ---
> >> > a/drivers/watchdog/starfive-wdt.c +++
> >> > b/drivers/watchdog/starfive-wdt.c @@ -581,6 +581,7 @@ static
> >> > const struct dev_pm_ops starfive_wdt_pm_ops = { static const
> >> > struct of_device_id starfive_wdt_match[] = { { .compatible =
> >> > "starfive,jh7100-wdt", .data = &starfive_wdt_jh7100_variant }, {
> >> > .compatible = "starfive,jh7110-wdt", .data =
> >> > &starfive_wdt_jh7110_variant },
> >> > +	{ .compatible = "starfive,jh8100-wdt", .data =
> >> > &starfive_wdt_jh7110_variant },    
> >> 
> >> Device is compatible, so why not expressing it in the bindings and
> >> dropping this change?
> >> 
> >> Best regards,
> >> Krzysztof
> >>   
> > 
> > Ok, will drop this change.
> > 
> > Thanks,
> > Ji Sheng  
> 
> Hi Ji Sheng,
> 
> You can add the compatible "starfive,jh8100-wdt" in the bindings and
> add this:
> 
> 	compatible = "starfive,jh8100-wdt", "starfive,jh7110-wdt";
> 
> in the dts. I think it would be better and does not change the driver.
> 
> Best regards,
> Xingyu Wu

Thanks for the suggestion, will go with this approach.
I have respin a v2 for this, as it only requires small changes.
v2: https://lore.kernel.org/all/20231212031731.2498584-2-jisheng.teoh@starfivetech.com/
diff mbox series

Patch

diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
index 5f501b41faf9..31785bb373d5 100644
--- a/drivers/watchdog/starfive-wdt.c
+++ b/drivers/watchdog/starfive-wdt.c
@@ -581,6 +581,7 @@  static const struct dev_pm_ops starfive_wdt_pm_ops = {
 static const struct of_device_id starfive_wdt_match[] = {
 	{ .compatible = "starfive,jh7100-wdt", .data = &starfive_wdt_jh7100_variant },
 	{ .compatible = "starfive,jh7110-wdt", .data = &starfive_wdt_jh7110_variant },
+	{ .compatible = "starfive,jh8100-wdt", .data = &starfive_wdt_jh7110_variant },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, starfive_wdt_match);