linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: wm831x_wdt: Remove GPIO handling
@ 2020-02-29 11:50 Linus Walleij
  2020-02-29 14:40 ` Guenter Roeck
  2020-03-02  9:15 ` Charles Keepax
  0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2020-02-29 11:50 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: linux-watchdog, Linus Walleij, Richard Fitzgerald,
	Charles Keepax, Mark Brown

An attempt to convert the driver to using GPIO descriptors
(see Link tag) was discouraged in favor of deleting the
handling of the update GPIO altogehter since there are
no in-tree users.

This patch deletes the GPIO handling instead.

Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/linux-watchdog/20200210102209.289379-1-linus.walleij@linaro.org/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
I am also fine with the elder patch being applied, obviously.
---
 drivers/watchdog/wm831x_wdt.c    | 27 ---------------------------
 include/linux/mfd/wm831x/pdata.h |  1 -
 2 files changed, 28 deletions(-)

diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c
index 030ce240620d..d96ad8f38bd2 100644
--- a/drivers/watchdog/wm831x_wdt.c
+++ b/drivers/watchdog/wm831x_wdt.c
@@ -13,7 +13,6 @@
 #include <linux/platform_device.h>
 #include <linux/watchdog.h>
 #include <linux/uaccess.h>
-#include <linux/gpio.h>
 
 #include <linux/mfd/wm831x/core.h>
 #include <linux/mfd/wm831x/pdata.h>
@@ -29,7 +28,6 @@ struct wm831x_wdt_drvdata {
 	struct watchdog_device wdt;
 	struct wm831x *wm831x;
 	struct mutex lock;
-	int update_gpio;
 	int update_state;
 };
 
@@ -103,14 +101,6 @@ static int wm831x_wdt_ping(struct watchdog_device *wdt_dev)
 
 	mutex_lock(&driver_data->lock);
 
-	if (driver_data->update_gpio) {
-		gpio_set_value_cansleep(driver_data->update_gpio,
-					driver_data->update_state);
-		driver_data->update_state = !driver_data->update_state;
-		ret = 0;
-		goto out;
-	}
-
 	reg = wm831x_reg_read(wm831x, WM831X_WATCHDOG);
 
 	if (!(reg & WM831X_WDOG_RST_SRC)) {
@@ -239,23 +229,6 @@ static int wm831x_wdt_probe(struct platform_device *pdev)
 		reg |= pdata->secondary << WM831X_WDOG_SECACT_SHIFT;
 		reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT;
 
-		if (pdata->update_gpio) {
-			ret = devm_gpio_request_one(dev, pdata->update_gpio,
-						    GPIOF_OUT_INIT_LOW,
-						    "Watchdog update");
-			if (ret < 0) {
-				dev_err(wm831x->dev,
-					"Failed to request update GPIO: %d\n",
-					ret);
-				return ret;
-			}
-
-			driver_data->update_gpio = pdata->update_gpio;
-
-			/* Make sure the watchdog takes hardware updates */
-			reg |= WM831X_WDOG_RST_SRC;
-		}
-
 		ret = wm831x_reg_unlock(wm831x);
 		if (ret == 0) {
 			ret = wm831x_reg_write(wm831x, WM831X_WATCHDOG, reg);
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index 986986fe4e4e..75aa94dadf1c 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -89,7 +89,6 @@ enum wm831x_watchdog_action {
 
 struct wm831x_watchdog_pdata {
 	enum wm831x_watchdog_action primary, secondary;
-	int update_gpio;
 	unsigned int software:1;
 };
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: wm831x_wdt: Remove GPIO handling
  2020-02-29 11:50 [PATCH] watchdog: wm831x_wdt: Remove GPIO handling Linus Walleij
@ 2020-02-29 14:40 ` Guenter Roeck
  2020-03-02  9:15 ` Charles Keepax
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-02-29 14:40 UTC (permalink / raw)
  To: Linus Walleij, Wim Van Sebroeck
  Cc: linux-watchdog, Richard Fitzgerald, Charles Keepax, Mark Brown

On 2/29/20 3:50 AM, Linus Walleij wrote:
> An attempt to convert the driver to using GPIO descriptors
> (see Link tag) was discouraged in favor of deleting the
> handling of the update GPIO altogehter since there are
> no in-tree users.
> 
> This patch deletes the GPIO handling instead.
> 
> Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
> Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
> Cc: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/linux-watchdog/20200210102209.289379-1-linus.walleij@linaro.org/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

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

> ---
> I am also fine with the elder patch being applied, obviously.
> ---
>  drivers/watchdog/wm831x_wdt.c    | 27 ---------------------------
>  include/linux/mfd/wm831x/pdata.h |  1 -
>  2 files changed, 28 deletions(-)
> 
> diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c
> index 030ce240620d..d96ad8f38bd2 100644
> --- a/drivers/watchdog/wm831x_wdt.c
> +++ b/drivers/watchdog/wm831x_wdt.c
> @@ -13,7 +13,6 @@
>  #include <linux/platform_device.h>
>  #include <linux/watchdog.h>
>  #include <linux/uaccess.h>
> -#include <linux/gpio.h>
>  
>  #include <linux/mfd/wm831x/core.h>
>  #include <linux/mfd/wm831x/pdata.h>
> @@ -29,7 +28,6 @@ struct wm831x_wdt_drvdata {
>  	struct watchdog_device wdt;
>  	struct wm831x *wm831x;
>  	struct mutex lock;
> -	int update_gpio;
>  	int update_state;
>  };
>  
> @@ -103,14 +101,6 @@ static int wm831x_wdt_ping(struct watchdog_device *wdt_dev)
>  
>  	mutex_lock(&driver_data->lock);
>  
> -	if (driver_data->update_gpio) {
> -		gpio_set_value_cansleep(driver_data->update_gpio,
> -					driver_data->update_state);
> -		driver_data->update_state = !driver_data->update_state;
> -		ret = 0;
> -		goto out;
> -	}
> -
>  	reg = wm831x_reg_read(wm831x, WM831X_WATCHDOG);
>  
>  	if (!(reg & WM831X_WDOG_RST_SRC)) {
> @@ -239,23 +229,6 @@ static int wm831x_wdt_probe(struct platform_device *pdev)
>  		reg |= pdata->secondary << WM831X_WDOG_SECACT_SHIFT;
>  		reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT;
>  
> -		if (pdata->update_gpio) {
> -			ret = devm_gpio_request_one(dev, pdata->update_gpio,
> -						    GPIOF_OUT_INIT_LOW,
> -						    "Watchdog update");
> -			if (ret < 0) {
> -				dev_err(wm831x->dev,
> -					"Failed to request update GPIO: %d\n",
> -					ret);
> -				return ret;
> -			}
> -
> -			driver_data->update_gpio = pdata->update_gpio;
> -
> -			/* Make sure the watchdog takes hardware updates */
> -			reg |= WM831X_WDOG_RST_SRC;
> -		}
> -
>  		ret = wm831x_reg_unlock(wm831x);
>  		if (ret == 0) {
>  			ret = wm831x_reg_write(wm831x, WM831X_WATCHDOG, reg);
> diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
> index 986986fe4e4e..75aa94dadf1c 100644
> --- a/include/linux/mfd/wm831x/pdata.h
> +++ b/include/linux/mfd/wm831x/pdata.h
> @@ -89,7 +89,6 @@ enum wm831x_watchdog_action {
>  
>  struct wm831x_watchdog_pdata {
>  	enum wm831x_watchdog_action primary, secondary;
> -	int update_gpio;
>  	unsigned int software:1;
>  };
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: wm831x_wdt: Remove GPIO handling
  2020-02-29 11:50 [PATCH] watchdog: wm831x_wdt: Remove GPIO handling Linus Walleij
  2020-02-29 14:40 ` Guenter Roeck
@ 2020-03-02  9:15 ` Charles Keepax
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2020-03-02  9:15 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wim Van Sebroeck, Guenter Roeck, linux-watchdog,
	Richard Fitzgerald, Mark Brown

On Sat, Feb 29, 2020 at 12:50:46PM +0100, Linus Walleij wrote:
> An attempt to convert the driver to using GPIO descriptors
> (see Link tag) was discouraged in favor of deleting the
> handling of the update GPIO altogehter since there are
> no in-tree users.
> 
> This patch deletes the GPIO handling instead.
> 
> Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
> Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
> Cc: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/linux-watchdog/20200210102209.289379-1-linus.walleij@linaro.org/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-02  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-29 11:50 [PATCH] watchdog: wm831x_wdt: Remove GPIO handling Linus Walleij
2020-02-29 14:40 ` Guenter Roeck
2020-03-02  9:15 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).