Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e53c8ed authored by Jean-Baptiste Theou's avatar Jean-Baptiste Theou Committed by Wim Van Sebroeck
Browse files

watchdog: gpio_wdt: Add option for early registration



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: default avatarJean-Baptiste Theou <jtheou@adeneo-embedded.us>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent ef90174f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line

#
# Watchdog device configuration
#
@@ -113,6 +114,17 @@ config GPIO_WATCHDOG
	  If you say yes here you get support for watchdog device
	  controlled through GPIO-line.

config GPIO_WATCHDOG_ARCH_INITCALL
	bool "Register the watchdog as early as possible"
	depends on GPIO_WATCHDOG=y
	help
	  In some situations, the default initcall level (module_init)
	  in not early enough in the boot process to avoid the watchdog
	  to be triggered.
	  If you say yes here, the initcall level would be raised to
	  arch_initcall.
	  If in doubt, say N.

config MENF21BMC_WATCHDOG
	tristate "MEN 14F021P00 BMC Watchdog"
	depends on MFD_MENF21BMC
+9 −0
Original line number Diff line number Diff line
@@ -267,7 +267,16 @@ static struct platform_driver gpio_wdt_driver = {
	.probe	= gpio_wdt_probe,
	.remove	= gpio_wdt_remove,
};

#ifdef CONFIG_GPIO_WATCHDOG_ARCH_INITCALL
static int __init gpio_wdt_init(void)
{
	return platform_driver_register(&gpio_wdt_driver);
}
arch_initcall(gpio_wdt_init);
#else
module_platform_driver(gpio_wdt_driver);
#endif

MODULE_AUTHOR("Alexander Shiyan <shc_work@mail.ru>");
MODULE_DESCRIPTION("GPIO Watchdog");