Skip to content

Commit

Permalink
drivers: watchdog: kconfig option for callback support
Browse files Browse the repository at this point in the history
Add a non-configurable option which drivers can select to indicate that
they do not support callbacks on watchdog expiry.

(cherry picked from commit feaf21f)

Original-Signed-off-by: Jordan Yates <jordan@embeint.com>
GitOrigin-RevId: feaf21f
Cr-Build-Id: 8726498632650592545
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8726498632650592545
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I4b08a51ff20e416fb421c4f88a07a7f03e1a6e79
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6147344
Commit-Queue: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Bot-Commit: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
Jordan Yates authored and Chromeos LUCI committed Jan 6, 2025
1 parent b31fa5a commit fee4789
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/releases/release-notes-4.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.gd32
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.rpi_pico
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.smartbond
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.stm32
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.tco
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.ti_tps382x
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit fee4789

Please sign in to comment.