From feaf21f80cb6ddb5dafa53056154707c18c6b2c2 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 2 Jan 2025 16:32:11 +1000 Subject: [PATCH] drivers: watchdog: kconfig option for callback support Add a non-configurable option which drivers can select to indicate that they do not support callbacks on watchdog expiry. Signed-off-by: Jordan Yates --- doc/releases/release-notes-4.1.rst | 3 +++ drivers/watchdog/Kconfig | 5 +++++ drivers/watchdog/Kconfig.gd32 | 1 + drivers/watchdog/Kconfig.rpi_pico | 1 + drivers/watchdog/Kconfig.smartbond | 1 + drivers/watchdog/Kconfig.stm32 | 1 + drivers/watchdog/Kconfig.tco | 1 + drivers/watchdog/Kconfig.ti_tps382x | 1 + 8 files changed, 14 insertions(+) diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst index dd567c240d3cef..3620b60c512551 100644 --- a/doc/releases/release-notes-4.1.rst +++ b/doc/releases/release-notes-4.1.rst @@ -257,6 +257,9 @@ Drivers and Sensors * Watchdog + * Added :kconfig:option:`CONFIG_HAS_WDT_NO_CALLBACKS` which drivers select when they do not support + a callback being provided in :c:struct:`wdt_timeout_cfg`. + * Wi-Fi Networking diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 36515a1f7e464c..38824f2f353885 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -20,6 +20,11 @@ config WDT_DISABLE_AT_BOOT help Disable watchdog at Zephyr system startup. +config HAS_WDT_NO_CALLBACKS + bool + help + Watchdog driver does not support callbacks. + module = WDT module-str = watchdog source "subsys/logging/Kconfig.template.log_config" diff --git a/drivers/watchdog/Kconfig.gd32 b/drivers/watchdog/Kconfig.gd32 index 7d149f17b50ae5..17c4e4a42618e7 100644 --- a/drivers/watchdog/Kconfig.gd32 +++ b/drivers/watchdog/Kconfig.gd32 @@ -14,6 +14,7 @@ config WWDGT_GD32 bool "GD32 Window watchdog timer (WWDGT) Driver" default y depends on DT_HAS_GD_GD32_WWDGT_ENABLED + select HAS_WDT_NO_CALLBACKS select USE_GD32_WWDGT help Enable the Window watchdog timer (WWDGT) driver for GD32 SoCs. diff --git a/drivers/watchdog/Kconfig.rpi_pico b/drivers/watchdog/Kconfig.rpi_pico index a48d1c49fef1b6..cc12dc4f837fc6 100644 --- a/drivers/watchdog/Kconfig.rpi_pico +++ b/drivers/watchdog/Kconfig.rpi_pico @@ -6,6 +6,7 @@ config WDT_RPI_PICO default y depends on DT_HAS_RASPBERRYPI_PICO_WATCHDOG_ENABLED select HAS_WDT_DISABLE_AT_BOOT + select HAS_WDT_NO_CALLBACKS config WDT_RPI_PICO_INITIAL_TIMEOUT int "Default watchdog timeout in us" diff --git a/drivers/watchdog/Kconfig.smartbond b/drivers/watchdog/Kconfig.smartbond index 9978a8332cbbeb..ba0da834ddc21d 100644 --- a/drivers/watchdog/Kconfig.smartbond +++ b/drivers/watchdog/Kconfig.smartbond @@ -8,6 +8,7 @@ config WDT_SMARTBOND default y depends on DT_HAS_RENESAS_SMARTBOND_WATCHDOG_ENABLED select HAS_WDT_DISABLE_AT_BOOT + select HAS_WDT_NO_CALLBACKS if !WDT_SMARTBOND_NMI help Enable watchdog driver for Smartbond line of MCUs diff --git a/drivers/watchdog/Kconfig.stm32 b/drivers/watchdog/Kconfig.stm32 index b35a4c7b97d76b..35ad0e4b9c224c 100644 --- a/drivers/watchdog/Kconfig.stm32 +++ b/drivers/watchdog/Kconfig.stm32 @@ -10,6 +10,7 @@ menuconfig IWDG_STM32 default y depends on DT_HAS_ST_STM32_WATCHDOG_ENABLED select HAS_WDT_DISABLE_AT_BOOT + select HAS_WDT_NO_CALLBACKS help Enable IWDG driver for STM32 line of MCUs diff --git a/drivers/watchdog/Kconfig.tco b/drivers/watchdog/Kconfig.tco index 7439ffbc8918c3..e3e235552d99fa 100644 --- a/drivers/watchdog/Kconfig.tco +++ b/drivers/watchdog/Kconfig.tco @@ -8,5 +8,6 @@ config WDT_TCO default y depends on DT_HAS_INTEL_TCO_WDT_ENABLED select HAS_WDT_DISABLE_AT_BOOT + select HAS_WDT_NO_CALLBACKS help Enable support for Intel TCO WDT driver. diff --git a/drivers/watchdog/Kconfig.ti_tps382x b/drivers/watchdog/Kconfig.ti_tps382x index 9ff0400af3ef99..31eeb566afe6be 100644 --- a/drivers/watchdog/Kconfig.ti_tps382x +++ b/drivers/watchdog/Kconfig.ti_tps382x @@ -7,6 +7,7 @@ config WDT_TI_TPS382X default y depends on DT_HAS_TI_TPS382X_ENABLED depends on GPIO + select HAS_WDT_NO_CALLBACKS help Enable WDT driver for TI TPS382x. This is an external IC and requires a GPIO connection from the processor.