aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/gpio_wdt.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-07-27watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()Wei Yongjun1-0/+2
Add missing platform_set_drvdata() in gpio_wdt_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-12-28watchdog: gpio: Do not use device pointer from struct watchdog_deviceGuenter Roeck1-1/+2
The device pointer in struct watchdog_device has a different lifetime than the driver code and should not be used in drivers. Use the pointer to the parent device instead. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-12-13watchdog: gpio_wdt: use core reboot notifierDamien Riegel1-33/+2
Get rid of the custom reboot notifier block registration and use the one provided by the watchdog core. Note that this watchdog used to stop unconditionnaly on SYS_HALT and SYS_POWER_OFF. The core function now calls ops->stop on SYS_HALT and SYS_DOWN. To prevent the watchdog from being stopped on reboot, the "always-running" property must be set, otherwise it will now be stopped. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirlinux.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-09-09Watchdog: Fix parent of watchdog_devicesPratyush Anand1-0/+1
/sys/class/watchdog/watchdogn/device/modalias can help to identify the driver/module for a given watchdog node. However, many wdt devices do not set their parent and so, we do not see an entry for device in sysfs for such devices. This patch fixes parent of watchdog_device so that /sys/class/watchdog/watchdogn/device is populated. Exceptions: booke, diag288, octeon, softdog and w83627hf -- They do not have any parent. Not sure, how we can identify driver for these devices. Signed-off-by: Pratyush Anand <panand@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-09-09watchdog: gpio-wdt: ping already at startup for always running devicesUwe Kleine-König1-30/+30
During probe for an always-running watchdog a timer is setup to constantly ping the watchdog while the device is not open. The gpio to ping the watchdog is setup to inactive. For a watchdog with hw_algo = "toggle" this results in a ping depending on the initial state of the gpio, for hw_algo = "level" no ping is generated. Make sure that the first automatic ping is sent immediately and not only when the timer expires the first time. This makes the machine survive in case more than half of the watchdog timeout is already elapsed. (Which is very probable for the chip I'm faced with that has a timeout of one second.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-09-09watchdog: gpio-wdt: be more strict about hw_algo matchingUwe Kleine-König1-2/+2
strncmp(algo, "toggle", 6) doesn't compare the trailing '\0' byte, so using hw_algo = "toggleboggle" is recognized the same way as hw_algo = "toggle" . While this doesn't introduce any problems for a device tree that sticks to the documented settings it's still ugly. Fix this by using strcmp to only match on "toggle" and "level". Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-06-29watchdog: gpio_wdt: Add option for early registrationJean-Baptiste Theou1-0/+9
In some situation, mainly when it's not possible to disable a watchdog, you may want the watchdog driver to be started as soon as possible. Adding GPIO_WATCHDOG_ARCH_INITCALL to raise initcall from module_init to arch_initcall. This patch require watchdog registration deferral mechanism Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-02-17watchdog: gpio_wdt: Add "always_running" feature to GPIO watchdogMike Looijmans1-8/+29
On some chips, like the TPS386000, the trigger cannot be disabled and the CPU must keep toggling the line at all times. Add a switch "always_running" to keep toggling the GPIO line regardless of the state of the soft part of the watchdog. The "armed" member keeps track of whether a timeout must also cause a reset. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2014-10-20watchdog: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-01-28watchdog: GPIO-controlled watchdogAlexander Shiyan1-0/+254
This patch adds a watchdog driver for devices controlled through GPIO, (Analog Devices ADM706, Maxim MAX823, National NE555 etc). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>