watchdog: pm8916_wdt: Report reboot reason
authorStephan Gerhold <stephan.gerhold@kernkonzept.com>
Wed, 29 Jun 2022 08:48:15 +0000 (10:48 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 23 Jul 2022 12:21:28 +0000 (14:21 +0200)
commite7c54a412f49e9a9b8145d96a34ff3a06375dd43
treee20a3fbde9b1cc608a513f513991430f551a2bc6
parent4e5b406514fce00b16b7fc8cc5a6c9ec51518b0a
watchdog: pm8916_wdt: Report reboot reason

The PM8916 PMIC provides "power-off reason" (POFF_REASON) registers
to allow detecting why the board was powered off or rebooted. This
can be used to expose if a reset happened due to a watchdog timeout.
The watchdog API also provides status bits for overtemperature and
undervoltage which happen to be reported in the same PMIC register.

Make this information available as part of the watchdog device
so userspace can decide to handle the situation accordingly.

Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220629084816.125515-3-stephan.gerhold@kernkonzept.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/pm8916_wdt.c