Commit 0c0ddd6a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'linux-watchdog-5.6-rc3' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog fixes from Wim Van Sebroeck:

 - mtk_wdt needs RESET_CONTROLLER to build

 - da9062 driver fixes:
     - fix power management ops
     - do not ping the hw during stop()
     - add dependency on I2C

* tag 'linux-watchdog-5.6-rc3' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: da9062: Add dependency on I2C
  watchdog: da9062: fix power management ops
  watchdog: da9062: do not ping the hw during stop()
  watchdog: fix mtk_wdt.c RESET_CONTROLLER build error
parents bb65619e 44144c80
...@@ -207,6 +207,7 @@ config DA9063_WATCHDOG ...@@ -207,6 +207,7 @@ config DA9063_WATCHDOG
config DA9062_WATCHDOG config DA9062_WATCHDOG
tristate "Dialog DA9062/61 Watchdog" tristate "Dialog DA9062/61 Watchdog"
depends on MFD_DA9062 || COMPILE_TEST depends on MFD_DA9062 || COMPILE_TEST
depends on I2C
select WATCHDOG_CORE select WATCHDOG_CORE
help help
Support for the watchdog in the DA9062 and DA9061 PMICs. Support for the watchdog in the DA9062 and DA9061 PMICs.
...@@ -841,6 +842,7 @@ config MEDIATEK_WATCHDOG ...@@ -841,6 +842,7 @@ config MEDIATEK_WATCHDOG
tristate "Mediatek SoCs watchdog support" tristate "Mediatek SoCs watchdog support"
depends on ARCH_MEDIATEK || COMPILE_TEST depends on ARCH_MEDIATEK || COMPILE_TEST
select WATCHDOG_CORE select WATCHDOG_CORE
select RESET_CONTROLLER
help help
Say Y here to include support for the watchdog timer Say Y here to include support for the watchdog timer
in Mediatek SoCs. in Mediatek SoCs.
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/mfd/da9062/registers.h> #include <linux/mfd/da9062/registers.h>
#include <linux/mfd/da9062/core.h> #include <linux/mfd/da9062/core.h>
#include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -31,6 +32,7 @@ static const unsigned int wdt_timeout[] = { 0, 2, 4, 8, 16, 32, 65, 131 }; ...@@ -31,6 +32,7 @@ static const unsigned int wdt_timeout[] = { 0, 2, 4, 8, 16, 32, 65, 131 };
struct da9062_watchdog { struct da9062_watchdog {
struct da9062 *hw; struct da9062 *hw;
struct watchdog_device wdtdev; struct watchdog_device wdtdev;
bool use_sw_pm;
}; };
static unsigned int da9062_wdt_timeout_to_sel(unsigned int secs) static unsigned int da9062_wdt_timeout_to_sel(unsigned int secs)
...@@ -95,13 +97,6 @@ static int da9062_wdt_stop(struct watchdog_device *wdd) ...@@ -95,13 +97,6 @@ static int da9062_wdt_stop(struct watchdog_device *wdd)
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd); struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
int ret; int ret;
ret = da9062_reset_watchdog_timer(wdt);
if (ret) {
dev_err(wdt->hw->dev, "Failed to ping the watchdog (err = %d)\n",
ret);
return ret;
}
ret = regmap_update_bits(wdt->hw->regmap, ret = regmap_update_bits(wdt->hw->regmap,
DA9062AA_CONTROL_D, DA9062AA_CONTROL_D,
DA9062AA_TWDSCALE_MASK, DA9062AA_TWDSCALE_MASK,
...@@ -200,6 +195,8 @@ static int da9062_wdt_probe(struct platform_device *pdev) ...@@ -200,6 +195,8 @@ static int da9062_wdt_probe(struct platform_device *pdev)
if (!wdt) if (!wdt)
return -ENOMEM; return -ENOMEM;
wdt->use_sw_pm = device_property_present(dev, "dlg,use-sw-pm");
wdt->hw = chip; wdt->hw = chip;
wdt->wdtdev.info = &da9062_watchdog_info; wdt->wdtdev.info = &da9062_watchdog_info;
...@@ -226,6 +223,10 @@ static int da9062_wdt_probe(struct platform_device *pdev) ...@@ -226,6 +223,10 @@ static int da9062_wdt_probe(struct platform_device *pdev)
static int __maybe_unused da9062_wdt_suspend(struct device *dev) static int __maybe_unused da9062_wdt_suspend(struct device *dev)
{ {
struct watchdog_device *wdd = dev_get_drvdata(dev); struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
if (!wdt->use_sw_pm)
return 0;
if (watchdog_active(wdd)) if (watchdog_active(wdd))
return da9062_wdt_stop(wdd); return da9062_wdt_stop(wdd);
...@@ -236,6 +237,10 @@ static int __maybe_unused da9062_wdt_suspend(struct device *dev) ...@@ -236,6 +237,10 @@ static int __maybe_unused da9062_wdt_suspend(struct device *dev)
static int __maybe_unused da9062_wdt_resume(struct device *dev) static int __maybe_unused da9062_wdt_resume(struct device *dev)
{ {
struct watchdog_device *wdd = dev_get_drvdata(dev); struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
if (!wdt->use_sw_pm)
return 0;
if (watchdog_active(wdd)) if (watchdog_active(wdd))
return da9062_wdt_start(wdd); return da9062_wdt_start(wdd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment