diff mbox series

[5/7] watchdog: bcm7038_wdt: Add platform device id for bcm63xx-wdt

Message ID 20211028172322.4021440-6-f.fainelli@gmail.com (mailing list archive)
State New, archived
Headers show
Series Removal of bcm63xx-wdt | expand

Commit Message

Florian Fainelli Oct. 28, 2021, 5:23 p.m. UTC
In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
a platform_device_id table that allows both names to be matched.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/watchdog/bcm7038_wdt.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Guenter Roeck Oct. 28, 2021, 6:19 p.m. UTC | #1
On Thu, Oct 28, 2021 at 10:23:20AM -0700, Florian Fainelli wrote:
> In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
> a platform_device_id table that allows both names to be matched.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

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

> ---
>  drivers/watchdog/bcm7038_wdt.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
> index 506cd7ef9c77..2535f450e8a1 100644
> --- a/drivers/watchdog/bcm7038_wdt.c
> +++ b/drivers/watchdog/bcm7038_wdt.c
> @@ -223,6 +223,13 @@ static const struct of_device_id bcm7038_wdt_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
>  
> +static const struct platform_device_id bcm7038_wdt_devtype[] = {
> +	{ .name = "bcm7038-wdt" },
> +	{ .name = "bcm63xx-wdt" },
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(platform, bcm7038_wdt_devtype);
> +
>  static struct platform_driver bcm7038_wdt_driver = {
>  	.probe		= bcm7038_wdt_probe,
>  	.driver		= {
> -- 
> 2.25.1
>
Rafał Miłecki Oct. 29, 2021, 12:37 p.m. UTC | #2
On 2021-10-28 19:23, Florian Fainelli wrote:
> In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, 
> introduce
> a platform_device_id table that allows both names to be matched.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/watchdog/bcm7038_wdt.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/watchdog/bcm7038_wdt.c 
> b/drivers/watchdog/bcm7038_wdt.c
> index 506cd7ef9c77..2535f450e8a1 100644
> --- a/drivers/watchdog/bcm7038_wdt.c
> +++ b/drivers/watchdog/bcm7038_wdt.c
> @@ -223,6 +223,13 @@ static const struct of_device_id 
> bcm7038_wdt_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
> 
> +static const struct platform_device_id bcm7038_wdt_devtype[] = {
> +	{ .name = "bcm7038-wdt" },
> +	{ .name = "bcm63xx-wdt" },
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(platform, bcm7038_wdt_devtype);

Do we really want "bcm7038-wdt" here? I don't think it will ever be used
as apparently BCM7038 uses DT.

I'd also prefer to have Rob's comment on mapping blocks vs. mapping
registers.

If we were to map whole hardware blocks, we should have per-SoC
bindings and handling registers layouts in a driver. Right now
bcm63xx arch code maps selected part of hardware block that is
meant to match driver's logic (offsets 0x00 and 0x04).
Florian Fainelli Oct. 29, 2021, 6:34 p.m. UTC | #3
On 10/29/21 5:37 AM, Rafał Miłecki wrote:
> On 2021-10-28 19:23, Florian Fainelli wrote:
>> In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
>> a platform_device_id table that allows both names to be matched.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/watchdog/bcm7038_wdt.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/watchdog/bcm7038_wdt.c
>> b/drivers/watchdog/bcm7038_wdt.c
>> index 506cd7ef9c77..2535f450e8a1 100644
>> --- a/drivers/watchdog/bcm7038_wdt.c
>> +++ b/drivers/watchdog/bcm7038_wdt.c
>> @@ -223,6 +223,13 @@ static const struct of_device_id
>> bcm7038_wdt_match[] = {
>>  };
>>  MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
>>
>> +static const struct platform_device_id bcm7038_wdt_devtype[] = {
>> +    { .name = "bcm7038-wdt" },
>> +    { .name = "bcm63xx-wdt" },
>> +    { /* sentinel */ },
>> +};
>> +MODULE_DEVICE_TABLE(platform, bcm7038_wdt_devtype);
> 
> Do we really want "bcm7038-wdt" here? I don't think it will ever be used
> as apparently BCM7038 uses DT.

Let me dig through the platform_device_id code, but I believe we somehow do.
diff mbox series

Patch

diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
index 506cd7ef9c77..2535f450e8a1 100644
--- a/drivers/watchdog/bcm7038_wdt.c
+++ b/drivers/watchdog/bcm7038_wdt.c
@@ -223,6 +223,13 @@  static const struct of_device_id bcm7038_wdt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);
 
+static const struct platform_device_id bcm7038_wdt_devtype[] = {
+	{ .name = "bcm7038-wdt" },
+	{ .name = "bcm63xx-wdt" },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(platform, bcm7038_wdt_devtype);
+
 static struct platform_driver bcm7038_wdt_driver = {
 	.probe		= bcm7038_wdt_probe,
 	.driver		= {