drivers: watchdog: Use common name configuration for all drivers
Each driver seemed to use their own Kconfig option to set the name for their drivers. This makes writing example/test code difficult as each one of them will have to special case for each of the supported platforms. Use a consistent CONFIG_WDT_0_NAME option in all drivers. Fixes #8094. Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
parent
eefeb2b050
commit
158ea970ea
11 changed files with 15 additions and 40 deletions
|
@ -14,6 +14,16 @@ menuconfig WATCHDOG
|
||||||
|
|
||||||
if WATCHDOG
|
if WATCHDOG
|
||||||
|
|
||||||
|
if !HAS_DTS_WDT
|
||||||
|
|
||||||
|
config WDT_0_NAME
|
||||||
|
string "Watchdog driver instance name"
|
||||||
|
default "WATCHDOG_0"
|
||||||
|
help
|
||||||
|
Set the name used by the watchdog device during registation.
|
||||||
|
|
||||||
|
endif # HAS_DTS_WDT
|
||||||
|
|
||||||
config WDT_DISABLE_AT_BOOT
|
config WDT_DISABLE_AT_BOOT
|
||||||
bool
|
bool
|
||||||
prompt "Disable at boot"
|
prompt "Disable at boot"
|
||||||
|
|
|
@ -25,11 +25,4 @@ config WDOG_CMSDK_APB_START_AT_BOOT
|
||||||
it must be reloaded before the counter reaches 0, otherwise
|
it must be reloaded before the counter reaches 0, otherwise
|
||||||
the MCU will be reset.
|
the MCU will be reset.
|
||||||
|
|
||||||
config WDOG_CMSDK_APB_DEVICE_NAME
|
|
||||||
string "Device name for CMSDK APB Watchdog"
|
|
||||||
depends on WDOG_CMSDK_APB
|
|
||||||
default "WATCHDOG_0"
|
|
||||||
help
|
|
||||||
Set the name used by WDOG device during registration.
|
|
||||||
|
|
||||||
endif # SOC_FAMILY_ARM
|
endif # SOC_FAMILY_ARM
|
||||||
|
|
|
@ -12,13 +12,6 @@ menuconfig WDT_ESP32
|
||||||
help
|
help
|
||||||
Enable WDT driver for ESP32.
|
Enable WDT driver for ESP32.
|
||||||
|
|
||||||
config WDT_ESP32_DEVICE_NAME
|
|
||||||
string "Device name for Watchdog (WDT)"
|
|
||||||
depends on WDT_ESP32
|
|
||||||
default "WATCHDOG_0"
|
|
||||||
help
|
|
||||||
Set the name used by WDT device during registration.
|
|
||||||
|
|
||||||
config WDT_ESP32_IRQ
|
config WDT_ESP32_IRQ
|
||||||
int "IRQ line for watchdog interrupt"
|
int "IRQ line for watchdog interrupt"
|
||||||
depends on WDT_ESP32
|
depends on WDT_ESP32
|
||||||
|
|
|
@ -14,13 +14,6 @@ config WDT_QMSI
|
||||||
This driver is simply a shim driver based on the watchdog
|
This driver is simply a shim driver based on the watchdog
|
||||||
driver provided by the QMSI BSP.
|
driver provided by the QMSI BSP.
|
||||||
|
|
||||||
config WDT_0_NAME
|
|
||||||
string "Watchdog driver instance name"
|
|
||||||
default "WATCHDOG_0"
|
|
||||||
depends on WDT_QMSI
|
|
||||||
help
|
|
||||||
Watchdog driver instance name
|
|
||||||
|
|
||||||
config WDT_0_IRQ_PRI
|
config WDT_0_IRQ_PRI
|
||||||
int "Interrupt priority"
|
int "Interrupt priority"
|
||||||
depends on WDT_QMSI
|
depends on WDT_QMSI
|
||||||
|
|
|
@ -18,10 +18,3 @@ config WDT_SAM_DISABLE_AT_BOOT
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Select this option to disable the WDT during boot.
|
Select this option to disable the WDT during boot.
|
||||||
|
|
||||||
config WDT_SAM_DEVICE_NAME
|
|
||||||
string "Device name for Watchdog (WDT)"
|
|
||||||
depends on WDT_SAM
|
|
||||||
default "WDT"
|
|
||||||
help
|
|
||||||
Set the name used by WDT device during registration.
|
|
||||||
|
|
|
@ -22,13 +22,6 @@ config IWDG_STM32_START_AT_BOOT
|
||||||
it must be reloaded before the counter reaches 0, otherwise
|
it must be reloaded before the counter reaches 0, otherwise
|
||||||
the MCU will be reset.
|
the MCU will be reset.
|
||||||
|
|
||||||
config IWDG_STM32_DEVICE_NAME
|
|
||||||
string "Device name for Independent Watchdog (IWDG)"
|
|
||||||
depends on IWDG_STM32
|
|
||||||
default "IWDG"
|
|
||||||
help
|
|
||||||
Set the name used by IWDG device during registration.
|
|
||||||
|
|
||||||
config IWDG_STM32_TIMEOUT
|
config IWDG_STM32_TIMEOUT
|
||||||
int "Value for IWDG timeout in [us]"
|
int "Value for IWDG timeout in [us]"
|
||||||
depends on IWDG_STM32
|
depends on IWDG_STM32
|
||||||
|
|
|
@ -173,7 +173,7 @@ static struct iwdg_stm32_data iwdg_stm32_dev_data = {
|
||||||
.Instance = IWDG
|
.Instance = IWDG
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(iwdg_stm32, CONFIG_IWDG_STM32_DEVICE_NAME,
|
DEVICE_AND_API_INIT(iwdg_stm32, CONFIG_WDT_0_NAME,
|
||||||
iwdg_stm32_init, &iwdg_stm32_dev_data, NULL,
|
iwdg_stm32_init, &iwdg_stm32_dev_data, NULL,
|
||||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
&iwdg_stm32_api);
|
&iwdg_stm32_api);
|
||||||
|
|
|
@ -202,7 +202,7 @@ static int wdog_cmsdk_apb_init(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(wdog_cmsdk_apb, CONFIG_WDOG_CMSDK_APB_DEVICE_NAME,
|
DEVICE_AND_API_INIT(wdog_cmsdk_apb, CONFIG_WDT_0_NAME,
|
||||||
wdog_cmsdk_apb_init,
|
wdog_cmsdk_apb_init,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
|
|
@ -228,7 +228,7 @@ static const struct wdt_driver_api wdt_api = {
|
||||||
.reload = wdt_esp32_reload
|
.reload = wdt_esp32_reload
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(wdt_esp32, CONFIG_WDT_ESP32_DEVICE_NAME, wdt_esp32_init,
|
DEVICE_AND_API_INIT(wdt_esp32, CONFIG_WDT_0_NAME, wdt_esp32_init,
|
||||||
&shared_data, NULL,
|
&shared_data, NULL,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
&wdt_api);
|
&wdt_api);
|
||||||
|
|
|
@ -90,7 +90,7 @@ static const struct wdt_sam_dev_cfg wdt_sam_config = {
|
||||||
.regs = WDT
|
.regs = WDT
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(wdt_sam, CONFIG_WDT_SAM_DEVICE_NAME, wdt_sam_init,
|
DEVICE_AND_API_INIT(wdt_sam, CONFIG_WDT_0_NAME, wdt_sam_init,
|
||||||
NULL, &wdt_sam_config,
|
NULL, &wdt_sam_config,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
&wdt_sam_api);
|
&wdt_sam_api);
|
||||||
|
|
|
@ -153,6 +153,6 @@ static int wdt_sam0_init(struct device *dev)
|
||||||
|
|
||||||
static struct wdt_sam0_dev_data wdt_sam0_data;
|
static struct wdt_sam0_dev_data wdt_sam0_data;
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(wdt_sam0, CONFIG_WDT_SAM0_LABEL, wdt_sam0_init,
|
DEVICE_AND_API_INIT(wdt_sam0, CONFIG_WDT_0_NAME, wdt_sam0_init,
|
||||||
&wdt_sam0_data, NULL, PRE_KERNEL_1,
|
&wdt_sam0_data, NULL, PRE_KERNEL_1,
|
||||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &wdt_sam0_api);
|
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &wdt_sam0_api);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue