watchdog: Add DA9063 PMIC watchdog driver.
Subsystems (2)
PATCH v5 1/1 watchdog: Add DA9063 PMIC watchdog driver.
From: Krystian Garbaciak <[email protected]>
This driver supports the watchdog device inside the DA9063 PMIC.
---
Notes:
Changes in v5:
- Kconfig: Add note about the module name.
- Change selector variables to int
- Style fixes
- use unsigned int to remove gcc verbose warning
- Integrate _kick() and _disable() into the calling functions
Changes in v4:
- Fixed indentation
- Fixed lock without unlock
- Check for parent device and device driver data in probe(). If not present, this is an invalid prober initialization, return -EINVAL.
Changes in v3:
- Cleanup error handling for timeout selection and setting
- Fix race condition due to late wdt drvdata setup
- Remove static struct watchdog_device. It is not initialized in the probe function
- Use WATCHDOG_NOWAYOUT_INIT_STATUS for the status
- Remove 0 shift using DA9063_TWDSCALE_SHIFT
drivers/watchdog/Kconfig | 9 ++ drivers/watchdog/Makefile | 1 + drivers/watchdog/da9063_wdt.c | 222 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 drivers/watchdog/da9063_wdt.c
drivers/watchdog/Kconfig +9 -0
@@ -87,6 +87,15 @@ config DA9055_WATCHDOG This driver can also be built as a module. If so, the module will be called da9055_wdt. +config DA9063_WATCHDOG + tristate "Dialog DA9063 Watchdog" + depends on MFD_DA9063 + select WATCHDOG_CORE + help + Support for the watchdog in the DA9063 PMIC. + + This driver can be built as a module. The module name is da9063_wdt. + config GPIO_WATCHDOG tristate "Watchdog device controlled through GPIO-line" depends on OF_GPIO
drivers/watchdog/Makefile +1 -0
@@ -172,6 +172,7 @@ obj-$(CONFIG_XEN_WDT) += xen_wdt.o # Architecture Independent obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o +obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o obj-$(CONFIG_GPIO_WATCHDOG) += gpio_wdt.o obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
drivers/watchdog/da9063_wdt.c new file +222 -0
222 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v5 1/1 watchdog: Add DA9063 PMIC watchdog driver.
On 26 August 2014 07:26, Markus Pargmann wrote
Quoted 2 lines
Subject: [PATCH v5] watchdog: Add DA9063 PMIC watchdog driver.
[...]
Quoted 8 lines
drivers/watchdog/da9063_wdt.c new file +8
-0+ +static int da9063_wdt_stop (struct watchdog_device *wdd) +{ +struct da9063_watchdog *wdt =watchdog_get_drvdata (wdd); +int ret; + +mutex_lock (&wdt->lock); + ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D,
drivers/watchdog/da9063_wdt.c line 102
Quoted 10 lines
drivers/watchdog/da9063_wdt.c new file +10
-0+DA9063_TWDSCALE_MASK , + DA9063_TWDSCALE_DISABLE); +if (ret) +dev_alert (wdt->da9063->dev,"Watchdog failed to stop (err = %d)\n" , + ret); +mutex_unlock (&wdt->lock); + +return ret; +} +
Hi Markus,
A quick typo.
ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D, should probably be wdt->da9063->regmap
Regards,
Steve
PATCH v5 1/1 watchdog: Add DA9063 PMIC watchdog driver.
Hi Steve,
Quoted 29 lines · Opensource [Steve Twiss]
On 26 August 2014 07:26, Markus Pargmann wrote
Quoted 2 lines
Subject: [PATCH v5] watchdog: Add DA9063 PMIC watchdog driver.
[...]
Quoted 8 lines
drivers/watchdog/da9063_wdt.c new file +8
-0+ +static int da9063_wdt_stop (struct watchdog_device *wdd) +{ +struct da9063_watchdog *wdt =watchdog_get_drvdata (wdd); +int ret; + +mutex_lock (&wdt->lock); + ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONTROL_D,drivers/watchdog/da9063_wdt.c line 102
Quoted 10 lines
drivers/watchdog/da9063_wdt.c new file +10
-0+DA9063_TWDSCALE_MASK , + DA9063_TWDSCALE_DISABLE); +if (ret) +dev_alert (wdt->da9063->dev,"Watchdog failed to stop (err = %d)\n" , + ret); +mutex_unlock (&wdt->lock); + +return ret; +} +Hi Markus,
Quoted 3 lines
A quick typo.
ret = regmap_update_bits(da9063->regmap,DA9063_REG_CONTROL_D, should probably bewdt->da9063->regmap
yes, thank you. It seems I forgot to execute my checkpatch script before sending. Sorry, will send a new version.
Best regards,
Markus
Signature · 11 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140827/30fdac58/attachment.sig>
PATCH v5 1/1 watchdog: Add DA9063 PMIC watchdog driver.
Quoted 5 lines · On 27 August 2014 09:12 Markus Pargmann wrote:
Hi Steve,
Quoted 3 lines · Opensource [Steve Twiss]
On 26 August 2014 07:26, Markus Pargmann wrote
Quoted 2 lines
Subject: [PATCH v5] watchdog: Add DA9063 PMIC watchdog driver.
[...]
Quoted 5 lines
[...] will send a new version.
Best regards,
Markus
Thanks Markus,
Hopefully -- if time permits I am also able to run a couple of tests on the watchdog driver. I will let you know the results as soon as I have them..
Regards,
Steve