All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	Jonas Jensen <jonas.jensen@gmail.com>,
	Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>,
	linux-arm-kernel@lists.infradead.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 02/11] watchdog: gemini/ftwdt010: rename driver and symbols
Date: Mon, 14 Aug 2017 08:01:05 -0700	[thread overview]
Message-ID: <20170814150105.GG14491@roeck-us.net> (raw)
In-Reply-To: <20170812184318.10144-3-linus.walleij@linaro.org>

On Sat, Aug 12, 2017 at 08:43:09PM +0200, Linus Walleij wrote:
> This renames all the driver files and symbols for the Gemini
> watchdog to FTWDT010 as it has been revealed that this IP block
> is a generic watchdog timer from Faraday Technology used in
> several SoC designs.
> 
> Select thid driver by default for the Gemini, it is a sensible
> driver to always have enabled.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/watchdog/Kconfig                          |  14 +--
>  drivers/watchdog/Makefile                         |   2 +-
>  drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} | 117 +++++++++++-----------
>  3 files changed, 68 insertions(+), 65 deletions(-)
>  rename drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} (50%)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c722cbfdc7e6..fd44a542036a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -321,16 +321,18 @@ config 977_WATCHDOG
>  
>  	  Not sure? It's safe to say N.
>  
> -config GEMINI_WATCHDOG
> -	tristate "Gemini watchdog"
> -	depends on ARCH_GEMINI
> +config FTWDT010_WATCHDOG
> +	tristate "Faraday Technology FTWDT010 watchdog"
> +	depends on ARM || COMPILE_TEST

Did you test this ? I am kind of wary about COMPILE_TEST in watchdog drivers.
I tried to enable that a while ago, and we had to spend a couple of releases
fixing the fallout (even though I had tried to make sure that everything
builds).

>  	select WATCHDOG_CORE
> +	default ARCH_GEMINI
>  	help
> -	  Say Y here if to include support for the watchdog timer
> -	  embedded in the Cortina Systems Gemini family of devices.
> +	  Say Y here if to include support for the Faraday Technology
> +	  FTWDT010 watchdog timer embedded in the Cortina Systems Gemini
> +	  family of devices.
>  
>  	  To compile this driver as a module, choose M here: the
> -	  module will be called gemini_wdt.
> +	  module will be called ftwdt010_wdt.
>  
>  config IXP4XX_WATCHDOG
>  	tristate "IXP4xx Watchdog"
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 56adf9fa67d0..df91d7db821c 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -45,7 +45,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
>  obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o
>  obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
>  obj-$(CONFIG_977_WATCHDOG) += wdt977.o
> -obj-$(CONFIG_GEMINI_WATCHDOG) += gemini_wdt.o
> +obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
>  obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
>  obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
>  obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
> diff --git a/drivers/watchdog/gemini_wdt.c b/drivers/watchdog/ftwdt010_wdt.c
> similarity index 50%
> rename from drivers/watchdog/gemini_wdt.c
> rename to drivers/watchdog/ftwdt010_wdt.c
> index 8155aa619e4c..637ffd812f0b 100644
> --- a/drivers/watchdog/gemini_wdt.c
> +++ b/drivers/watchdog/ftwdt010_wdt.c
> @@ -1,5 +1,5 @@
>  /*
> - * Watchdog driver for Cortina Systems Gemini SoC
> + * Watchdog driver for Faraday Technology FTWDT010
>   *
>   * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org>
>   *
> @@ -22,10 +22,10 @@
>  #include <linux/slab.h>
>  #include <linux/watchdog.h>
>  
> -#define GEMINI_WDCOUNTER	0x0
> -#define GEMINI_WDLOAD		0x4
> -#define GEMINI_WDRESTART	0x8
> -#define GEMINI_WDCR		0xC
> +#define FTWDT010_WDCOUNTER	0x0
> +#define FTWDT010_WDLOAD		0x4
> +#define FTWDT010_WDRESTART	0x8
> +#define FTWDT010_WDCR		0xC
>  
>  #define WDRESTART_MAGIC		0x5AB9
>  
> @@ -35,79 +35,79 @@
>  
>  #define WDT_CLOCK		5000000		/* 5 MHz */
>  
> -struct gemini_wdt {
> +struct ftwdt010_wdt {
>  	struct watchdog_device	wdd;
>  	struct device		*dev;
>  	void __iomem		*base;
>  };
>  
>  static inline
> -struct gemini_wdt *to_gemini_wdt(struct watchdog_device *wdd)
> +struct ftwdt010_wdt *to_ftwdt010_wdt(struct watchdog_device *wdd)
>  {
> -	return container_of(wdd, struct gemini_wdt, wdd);
> +	return container_of(wdd, struct ftwdt010_wdt, wdd);
>  }
>  
> -static int gemini_wdt_start(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_start(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(wdd->timeout * WDT_CLOCK, gwdt->base + GEMINI_WDLOAD);
> -	writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART);
> +	writel(wdd->timeout * WDT_CLOCK, gwdt->base + FTWDT010_WDLOAD);
> +	writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART);
>  	/* set clock before enabling */
>  	writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST,
> -			gwdt->base + GEMINI_WDCR);
> +			gwdt->base + FTWDT010_WDCR);
>  	writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST | WDCR_ENABLE,
> -			gwdt->base + GEMINI_WDCR);
> +			gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_stop(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_stop(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(0, gwdt->base + GEMINI_WDCR);
> +	writel(0, gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_ping(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_ping(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART);
> +	writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_set_timeout(struct watchdog_device *wdd,
> +static int ftwdt010_wdt_set_timeout(struct watchdog_device *wdd,
>  				  unsigned int timeout)
>  {
>  	wdd->timeout = timeout;
>  	if (watchdog_active(wdd))
> -		gemini_wdt_start(wdd);
> +		ftwdt010_wdt_start(wdd);
>  
>  	return 0;
>  }
>  
> -static irqreturn_t gemini_wdt_interrupt(int irq, void *data)
> +static irqreturn_t ftwdt010_wdt_interrupt(int irq, void *data)
>  {
> -	struct gemini_wdt *gwdt = data;
> +	struct ftwdt010_wdt *gwdt = data;
>  
>  	watchdog_notify_pretimeout(&gwdt->wdd);
>  
>  	return IRQ_HANDLED;
>  }
>  
> -static const struct watchdog_ops gemini_wdt_ops = {
> -	.start		= gemini_wdt_start,
> -	.stop		= gemini_wdt_stop,
> -	.ping		= gemini_wdt_ping,
> -	.set_timeout	= gemini_wdt_set_timeout,
> +static const struct watchdog_ops ftwdt010_wdt_ops = {
> +	.start		= ftwdt010_wdt_start,
> +	.stop		= ftwdt010_wdt_stop,
> +	.ping		= ftwdt010_wdt_ping,
> +	.set_timeout	= ftwdt010_wdt_set_timeout,
>  	.owner		= THIS_MODULE,
>  };
>  
> -static const struct watchdog_info gemini_wdt_info = {
> +static const struct watchdog_info ftwdt010_wdt_info = {
>  	.options	= WDIOF_KEEPALIVEPING
>  			| WDIOF_MAGICCLOSE
>  			| WDIOF_SETTIMEOUT,
> @@ -115,11 +115,11 @@ static const struct watchdog_info gemini_wdt_info = {
>  };
>  
>  
> -static int gemini_wdt_probe(struct platform_device *pdev)
> +static int ftwdt010_wdt_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct resource *res;
> -	struct gemini_wdt *gwdt;
> +	struct ftwdt010_wdt *gwdt;
>  	unsigned int reg;
>  	int irq;
>  	int ret;
> @@ -138,8 +138,8 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  
>  	gwdt->dev = dev;
> -	gwdt->wdd.info = &gemini_wdt_info;
> -	gwdt->wdd.ops = &gemini_wdt_ops;
> +	gwdt->wdd.info = &ftwdt010_wdt_info;
> +	gwdt->wdd.ops = &ftwdt010_wdt_ops;
>  	gwdt->wdd.min_timeout = 1;
>  	gwdt->wdd.max_timeout = 0xFFFFFFFF / WDT_CLOCK;
>  	gwdt->wdd.parent = dev;
> @@ -151,14 +151,14 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  	gwdt->wdd.timeout = 13U;
>  	watchdog_init_timeout(&gwdt->wdd, 0, dev);
>  
> -	reg = readw(gwdt->base + GEMINI_WDCR);
> +	reg = readw(gwdt->base + FTWDT010_WDCR);
>  	if (reg & WDCR_ENABLE) {
>  		/* Watchdog was enabled by the bootloader, disable it. */
>  		reg &= ~WDCR_ENABLE;
> -		writel(reg, gwdt->base + GEMINI_WDCR);
> +		writel(reg, gwdt->base + FTWDT010_WDCR);
>  	}
>  
> -	ret = devm_request_irq(dev, irq, gemini_wdt_interrupt, 0,
> +	ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0,
>  			       "watchdog bark", gwdt);
>  	if (ret)
>  		return ret;
> @@ -171,59 +171,60 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  
>  	/* Set up platform driver data */
>  	platform_set_drvdata(pdev, gwdt);
> -	dev_info(dev, "Gemini watchdog driver enabled\n");
> +	dev_info(dev, "FTWDT010 watchdog driver enabled\n");
>  
>  	return 0;
>  }
>  
> -static int __maybe_unused gemini_wdt_suspend(struct device *dev)
> +static int __maybe_unused ftwdt010_wdt_suspend(struct device *dev)
>  {
> -	struct gemini_wdt *gwdt = dev_get_drvdata(dev);
> +	struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev);
>  	unsigned int reg;
>  
> -	reg = readw(gwdt->base + GEMINI_WDCR);
> +	reg = readw(gwdt->base + FTWDT010_WDCR);
>  	reg &= ~WDCR_ENABLE;
> -	writel(reg, gwdt->base + GEMINI_WDCR);
> +	writel(reg, gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int __maybe_unused gemini_wdt_resume(struct device *dev)
> +static int __maybe_unused ftwdt010_wdt_resume(struct device *dev)
>  {
> -	struct gemini_wdt *gwdt = dev_get_drvdata(dev);
> +	struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev);
>  	unsigned int reg;
>  
>  	if (watchdog_active(&gwdt->wdd)) {
> -		reg = readw(gwdt->base + GEMINI_WDCR);
> +		reg = readw(gwdt->base + FTWDT010_WDCR);
>  		reg |= WDCR_ENABLE;
> -		writel(reg, gwdt->base + GEMINI_WDCR);
> +		writel(reg, gwdt->base + FTWDT010_WDCR);
>  	}
>  
>  	return 0;
>  }
>  
> -static const struct dev_pm_ops gemini_wdt_dev_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(gemini_wdt_suspend,
> -				gemini_wdt_resume)
> +static const struct dev_pm_ops ftwdt010_wdt_dev_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(ftwdt010_wdt_suspend,
> +				ftwdt010_wdt_resume)
>  };
>  
>  #ifdef CONFIG_OF
> -static const struct of_device_id gemini_wdt_match[] = {
> +static const struct of_device_id ftwdt010_wdt_match[] = {
> +	{ .compatible = "faraday,ftwdt010" },
>  	{ .compatible = "cortina,gemini-watchdog" },
>  	{},
>  };
> -MODULE_DEVICE_TABLE(of, gemini_wdt_match);
> +MODULE_DEVICE_TABLE(of, ftwdt010_wdt_match);
>  #endif
>  
> -static struct platform_driver gemini_wdt_driver = {
> -	.probe		= gemini_wdt_probe,
> +static struct platform_driver ftwdt010_wdt_driver = {
> +	.probe		= ftwdt010_wdt_probe,
>  	.driver		= {
> -		.name	= "gemini-wdt",
> -		.of_match_table = of_match_ptr(gemini_wdt_match),
> -		.pm = &gemini_wdt_dev_pm_ops,
> +		.name	= "ftwdt010-wdt",
> +		.of_match_table = of_match_ptr(ftwdt010_wdt_match),
> +		.pm = &ftwdt010_wdt_dev_pm_ops,
>  	},
>  };
> -module_platform_driver(gemini_wdt_driver);
> +module_platform_driver(ftwdt010_wdt_driver);
>  MODULE_AUTHOR("Linus Walleij");
> -MODULE_DESCRIPTION("Watchdog driver for Gemini");
> +MODULE_DESCRIPTION("Watchdog driver for Faraday Technology FTWDT010");
>  MODULE_LICENSE("GPL");
> -- 
> 2.13.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/11] watchdog: gemini/ftwdt010: rename driver and symbols
Date: Mon, 14 Aug 2017 08:01:05 -0700	[thread overview]
Message-ID: <20170814150105.GG14491@roeck-us.net> (raw)
In-Reply-To: <20170812184318.10144-3-linus.walleij@linaro.org>

On Sat, Aug 12, 2017 at 08:43:09PM +0200, Linus Walleij wrote:
> This renames all the driver files and symbols for the Gemini
> watchdog to FTWDT010 as it has been revealed that this IP block
> is a generic watchdog timer from Faraday Technology used in
> several SoC designs.
> 
> Select thid driver by default for the Gemini, it is a sensible
> driver to always have enabled.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/watchdog/Kconfig                          |  14 +--
>  drivers/watchdog/Makefile                         |   2 +-
>  drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} | 117 +++++++++++-----------
>  3 files changed, 68 insertions(+), 65 deletions(-)
>  rename drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} (50%)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c722cbfdc7e6..fd44a542036a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -321,16 +321,18 @@ config 977_WATCHDOG
>  
>  	  Not sure? It's safe to say N.
>  
> -config GEMINI_WATCHDOG
> -	tristate "Gemini watchdog"
> -	depends on ARCH_GEMINI
> +config FTWDT010_WATCHDOG
> +	tristate "Faraday Technology FTWDT010 watchdog"
> +	depends on ARM || COMPILE_TEST

Did you test this ? I am kind of wary about COMPILE_TEST in watchdog drivers.
I tried to enable that a while ago, and we had to spend a couple of releases
fixing the fallout (even though I had tried to make sure that everything
builds).

>  	select WATCHDOG_CORE
> +	default ARCH_GEMINI
>  	help
> -	  Say Y here if to include support for the watchdog timer
> -	  embedded in the Cortina Systems Gemini family of devices.
> +	  Say Y here if to include support for the Faraday Technology
> +	  FTWDT010 watchdog timer embedded in the Cortina Systems Gemini
> +	  family of devices.
>  
>  	  To compile this driver as a module, choose M here: the
> -	  module will be called gemini_wdt.
> +	  module will be called ftwdt010_wdt.
>  
>  config IXP4XX_WATCHDOG
>  	tristate "IXP4xx Watchdog"
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 56adf9fa67d0..df91d7db821c 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -45,7 +45,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
>  obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o
>  obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
>  obj-$(CONFIG_977_WATCHDOG) += wdt977.o
> -obj-$(CONFIG_GEMINI_WATCHDOG) += gemini_wdt.o
> +obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
>  obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
>  obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
>  obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
> diff --git a/drivers/watchdog/gemini_wdt.c b/drivers/watchdog/ftwdt010_wdt.c
> similarity index 50%
> rename from drivers/watchdog/gemini_wdt.c
> rename to drivers/watchdog/ftwdt010_wdt.c
> index 8155aa619e4c..637ffd812f0b 100644
> --- a/drivers/watchdog/gemini_wdt.c
> +++ b/drivers/watchdog/ftwdt010_wdt.c
> @@ -1,5 +1,5 @@
>  /*
> - * Watchdog driver for Cortina Systems Gemini SoC
> + * Watchdog driver for Faraday Technology FTWDT010
>   *
>   * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org>
>   *
> @@ -22,10 +22,10 @@
>  #include <linux/slab.h>
>  #include <linux/watchdog.h>
>  
> -#define GEMINI_WDCOUNTER	0x0
> -#define GEMINI_WDLOAD		0x4
> -#define GEMINI_WDRESTART	0x8
> -#define GEMINI_WDCR		0xC
> +#define FTWDT010_WDCOUNTER	0x0
> +#define FTWDT010_WDLOAD		0x4
> +#define FTWDT010_WDRESTART	0x8
> +#define FTWDT010_WDCR		0xC
>  
>  #define WDRESTART_MAGIC		0x5AB9
>  
> @@ -35,79 +35,79 @@
>  
>  #define WDT_CLOCK		5000000		/* 5 MHz */
>  
> -struct gemini_wdt {
> +struct ftwdt010_wdt {
>  	struct watchdog_device	wdd;
>  	struct device		*dev;
>  	void __iomem		*base;
>  };
>  
>  static inline
> -struct gemini_wdt *to_gemini_wdt(struct watchdog_device *wdd)
> +struct ftwdt010_wdt *to_ftwdt010_wdt(struct watchdog_device *wdd)
>  {
> -	return container_of(wdd, struct gemini_wdt, wdd);
> +	return container_of(wdd, struct ftwdt010_wdt, wdd);
>  }
>  
> -static int gemini_wdt_start(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_start(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(wdd->timeout * WDT_CLOCK, gwdt->base + GEMINI_WDLOAD);
> -	writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART);
> +	writel(wdd->timeout * WDT_CLOCK, gwdt->base + FTWDT010_WDLOAD);
> +	writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART);
>  	/* set clock before enabling */
>  	writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST,
> -			gwdt->base + GEMINI_WDCR);
> +			gwdt->base + FTWDT010_WDCR);
>  	writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST | WDCR_ENABLE,
> -			gwdt->base + GEMINI_WDCR);
> +			gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_stop(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_stop(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(0, gwdt->base + GEMINI_WDCR);
> +	writel(0, gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_ping(struct watchdog_device *wdd)
> +static int ftwdt010_wdt_ping(struct watchdog_device *wdd)
>  {
> -	struct gemini_wdt *gwdt = to_gemini_wdt(wdd);
> +	struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd);
>  
> -	writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART);
> +	writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART);
>  
>  	return 0;
>  }
>  
> -static int gemini_wdt_set_timeout(struct watchdog_device *wdd,
> +static int ftwdt010_wdt_set_timeout(struct watchdog_device *wdd,
>  				  unsigned int timeout)
>  {
>  	wdd->timeout = timeout;
>  	if (watchdog_active(wdd))
> -		gemini_wdt_start(wdd);
> +		ftwdt010_wdt_start(wdd);
>  
>  	return 0;
>  }
>  
> -static irqreturn_t gemini_wdt_interrupt(int irq, void *data)
> +static irqreturn_t ftwdt010_wdt_interrupt(int irq, void *data)
>  {
> -	struct gemini_wdt *gwdt = data;
> +	struct ftwdt010_wdt *gwdt = data;
>  
>  	watchdog_notify_pretimeout(&gwdt->wdd);
>  
>  	return IRQ_HANDLED;
>  }
>  
> -static const struct watchdog_ops gemini_wdt_ops = {
> -	.start		= gemini_wdt_start,
> -	.stop		= gemini_wdt_stop,
> -	.ping		= gemini_wdt_ping,
> -	.set_timeout	= gemini_wdt_set_timeout,
> +static const struct watchdog_ops ftwdt010_wdt_ops = {
> +	.start		= ftwdt010_wdt_start,
> +	.stop		= ftwdt010_wdt_stop,
> +	.ping		= ftwdt010_wdt_ping,
> +	.set_timeout	= ftwdt010_wdt_set_timeout,
>  	.owner		= THIS_MODULE,
>  };
>  
> -static const struct watchdog_info gemini_wdt_info = {
> +static const struct watchdog_info ftwdt010_wdt_info = {
>  	.options	= WDIOF_KEEPALIVEPING
>  			| WDIOF_MAGICCLOSE
>  			| WDIOF_SETTIMEOUT,
> @@ -115,11 +115,11 @@ static const struct watchdog_info gemini_wdt_info = {
>  };
>  
>  
> -static int gemini_wdt_probe(struct platform_device *pdev)
> +static int ftwdt010_wdt_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct resource *res;
> -	struct gemini_wdt *gwdt;
> +	struct ftwdt010_wdt *gwdt;
>  	unsigned int reg;
>  	int irq;
>  	int ret;
> @@ -138,8 +138,8 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  
>  	gwdt->dev = dev;
> -	gwdt->wdd.info = &gemini_wdt_info;
> -	gwdt->wdd.ops = &gemini_wdt_ops;
> +	gwdt->wdd.info = &ftwdt010_wdt_info;
> +	gwdt->wdd.ops = &ftwdt010_wdt_ops;
>  	gwdt->wdd.min_timeout = 1;
>  	gwdt->wdd.max_timeout = 0xFFFFFFFF / WDT_CLOCK;
>  	gwdt->wdd.parent = dev;
> @@ -151,14 +151,14 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  	gwdt->wdd.timeout = 13U;
>  	watchdog_init_timeout(&gwdt->wdd, 0, dev);
>  
> -	reg = readw(gwdt->base + GEMINI_WDCR);
> +	reg = readw(gwdt->base + FTWDT010_WDCR);
>  	if (reg & WDCR_ENABLE) {
>  		/* Watchdog was enabled by the bootloader, disable it. */
>  		reg &= ~WDCR_ENABLE;
> -		writel(reg, gwdt->base + GEMINI_WDCR);
> +		writel(reg, gwdt->base + FTWDT010_WDCR);
>  	}
>  
> -	ret = devm_request_irq(dev, irq, gemini_wdt_interrupt, 0,
> +	ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0,
>  			       "watchdog bark", gwdt);
>  	if (ret)
>  		return ret;
> @@ -171,59 +171,60 @@ static int gemini_wdt_probe(struct platform_device *pdev)
>  
>  	/* Set up platform driver data */
>  	platform_set_drvdata(pdev, gwdt);
> -	dev_info(dev, "Gemini watchdog driver enabled\n");
> +	dev_info(dev, "FTWDT010 watchdog driver enabled\n");
>  
>  	return 0;
>  }
>  
> -static int __maybe_unused gemini_wdt_suspend(struct device *dev)
> +static int __maybe_unused ftwdt010_wdt_suspend(struct device *dev)
>  {
> -	struct gemini_wdt *gwdt = dev_get_drvdata(dev);
> +	struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev);
>  	unsigned int reg;
>  
> -	reg = readw(gwdt->base + GEMINI_WDCR);
> +	reg = readw(gwdt->base + FTWDT010_WDCR);
>  	reg &= ~WDCR_ENABLE;
> -	writel(reg, gwdt->base + GEMINI_WDCR);
> +	writel(reg, gwdt->base + FTWDT010_WDCR);
>  
>  	return 0;
>  }
>  
> -static int __maybe_unused gemini_wdt_resume(struct device *dev)
> +static int __maybe_unused ftwdt010_wdt_resume(struct device *dev)
>  {
> -	struct gemini_wdt *gwdt = dev_get_drvdata(dev);
> +	struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev);
>  	unsigned int reg;
>  
>  	if (watchdog_active(&gwdt->wdd)) {
> -		reg = readw(gwdt->base + GEMINI_WDCR);
> +		reg = readw(gwdt->base + FTWDT010_WDCR);
>  		reg |= WDCR_ENABLE;
> -		writel(reg, gwdt->base + GEMINI_WDCR);
> +		writel(reg, gwdt->base + FTWDT010_WDCR);
>  	}
>  
>  	return 0;
>  }
>  
> -static const struct dev_pm_ops gemini_wdt_dev_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(gemini_wdt_suspend,
> -				gemini_wdt_resume)
> +static const struct dev_pm_ops ftwdt010_wdt_dev_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(ftwdt010_wdt_suspend,
> +				ftwdt010_wdt_resume)
>  };
>  
>  #ifdef CONFIG_OF
> -static const struct of_device_id gemini_wdt_match[] = {
> +static const struct of_device_id ftwdt010_wdt_match[] = {
> +	{ .compatible = "faraday,ftwdt010" },
>  	{ .compatible = "cortina,gemini-watchdog" },
>  	{},
>  };
> -MODULE_DEVICE_TABLE(of, gemini_wdt_match);
> +MODULE_DEVICE_TABLE(of, ftwdt010_wdt_match);
>  #endif
>  
> -static struct platform_driver gemini_wdt_driver = {
> -	.probe		= gemini_wdt_probe,
> +static struct platform_driver ftwdt010_wdt_driver = {
> +	.probe		= ftwdt010_wdt_probe,
>  	.driver		= {
> -		.name	= "gemini-wdt",
> -		.of_match_table = of_match_ptr(gemini_wdt_match),
> -		.pm = &gemini_wdt_dev_pm_ops,
> +		.name	= "ftwdt010-wdt",
> +		.of_match_table = of_match_ptr(ftwdt010_wdt_match),
> +		.pm = &ftwdt010_wdt_dev_pm_ops,
>  	},
>  };
> -module_platform_driver(gemini_wdt_driver);
> +module_platform_driver(ftwdt010_wdt_driver);
>  MODULE_AUTHOR("Linus Walleij");
> -MODULE_DESCRIPTION("Watchdog driver for Gemini");
> +MODULE_DESCRIPTION("Watchdog driver for Faraday Technology FTWDT010");
>  MODULE_LICENSE("GPL");
> -- 
> 2.13.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-08-14 15:01 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12 18:43 [PATCH 00/11] watchdog: Consolidate FTWDT010 derivatives Linus Walleij
2017-08-12 18:43 ` Linus Walleij
     [not found] ` <20170812184318.10144-1-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-12 18:43   ` [PATCH 01/11] watchdog: gemini/ftwdt010: rename DT bindings Linus Walleij
2017-08-12 18:43     ` Linus Walleij
2017-08-12 18:43     ` Linus Walleij
     [not found]     ` <20170812184318.10144-2-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-14 14:55       ` Guenter Roeck
2017-08-14 14:55         ` Guenter Roeck
2017-08-14 14:55         ` Guenter Roeck
2017-08-17 20:32       ` Rob Herring
2017-08-17 20:32         ` Rob Herring
2017-08-17 20:32         ` Rob Herring
2017-08-12 18:43   ` [PATCH 06/11] watchdog: ftwdt010: Extend DT bindings to derivatives Linus Walleij
2017-08-12 18:43     ` Linus Walleij
2017-08-12 18:43     ` Linus Walleij
     [not found]     ` <20170812184318.10144-7-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-17 20:34       ` Rob Herring
2017-08-17 20:34         ` Rob Herring
2017-08-17 20:34         ` Rob Herring
2017-08-12 18:43 ` [PATCH 02/11] watchdog: gemini/ftwdt010: rename driver and symbols Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-14 15:01   ` Guenter Roeck [this message]
2017-08-14 15:01     ` Guenter Roeck
2017-08-24 20:45     ` Linus Walleij
2017-08-24 20:45       ` Linus Walleij
2017-08-27 17:14       ` Guenter Roeck
2017-08-27 17:14         ` Guenter Roeck
2017-08-12 18:43 ` [PATCH 03/11] watchdog: ftwdt010: Make interrupt optional Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-14 15:09   ` Guenter Roeck
2017-08-14 15:09     ` Guenter Roeck
2017-08-12 18:43 ` [PATCH 04/11] watchdog: ftwdt010: Add clock support Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-14 16:05   ` Guenter Roeck
2017-08-14 16:05     ` Guenter Roeck
2017-08-24 20:32     ` Linus Walleij
2017-08-24 20:32       ` Linus Walleij
2017-08-25 23:28       ` Stephen Boyd
2017-08-25 23:28         ` Stephen Boyd
2017-08-27 17:12         ` Guenter Roeck
2017-08-27 17:12           ` Guenter Roeck
2017-08-27 17:06       ` Guenter Roeck
2017-08-27 17:06         ` Guenter Roeck
2017-10-10 19:51         ` Linus Walleij
2017-10-10 19:51           ` Linus Walleij
2017-10-10 20:06           ` Linus Walleij
2017-10-10 20:06             ` Linus Walleij
2017-10-12  3:39             ` Joel Stanley
2017-10-12  3:39               ` Joel Stanley
2017-08-12 18:43 ` [PATCH 05/11] watchdog: ftwdt010: Add restart support Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-12 18:43 ` [PATCH 07/11] watchdog: ftwdt010: Delete surplus bindings Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-12 18:43 ` [PATCH 08/11] watchdog: ftwdt010/moxart: Merge MOXA ART into FTWDT010 Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-14 16:09   ` Guenter Roeck
2017-08-14 16:09     ` Guenter Roeck
2017-08-24 20:34     ` Linus Walleij
2017-08-24 20:34       ` Linus Walleij
2017-08-12 18:43 ` [PATCH 09/11] watchdog: ftwdt010/aspeed: Merge Aspeed " Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-14 15:04   ` Guenter Roeck
2017-08-14 15:04     ` Guenter Roeck
2017-08-24 20:41     ` Linus Walleij
2017-08-24 20:41       ` Linus Walleij
2017-08-27 17:13       ` Guenter Roeck
2017-08-27 17:13         ` Guenter Roeck
2017-08-12 18:43 ` [PATCH 10/11] ARM: dts: fix PCLK name on Gemini and MOXA ART Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-08-12 18:43 ` [PATCH 11/11] ARM: dts: Add PCLK to the Aspeed watchdogs Linus Walleij
2017-08-12 18:43   ` Linus Walleij
2017-10-10 20:09   ` Linus Walleij
2017-10-10 20:09     ` Linus Walleij
2017-10-12  3:37     ` Joel Stanley
2017-10-12  3:37       ` Joel Stanley
2017-10-12  7:35       ` Linus Walleij
2017-10-12  7:35         ` Linus Walleij
2017-10-11  3:48   ` Andrew Jeffery
2017-10-11  3:48     ` Andrew Jeffery
2017-10-11  6:32     ` Linus Walleij
2017-10-11  6:32       ` Linus Walleij
2017-10-11  7:14       ` Andrew Jeffery
2017-10-11  7:14         ` Andrew Jeffery
2017-08-14  1:24 ` [PATCH 00/11] watchdog: Consolidate FTWDT010 derivatives Joel Stanley
2017-08-14  1:24   ` Joel Stanley
2017-08-14  3:08   ` Andrew Jeffery
2017-08-14  3:08     ` Andrew Jeffery
2017-08-14 12:36     ` Linus Walleij
2017-08-14 12:36       ` Linus Walleij
2017-08-14 12:31   ` Linus Walleij
2017-08-14 12:31     ` Linus Walleij
2017-08-14 12:39 ` Linus Walleij
2017-08-14 12:39   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170814150105.GG14491@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrew@aj.id.au \
    --cc=joel@jms.id.au \
    --cc=jonas.jensen@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.