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:
Leandro Pereira 2018-06-01 12:32:25 -07:00 committed by Maureen Helm
commit 158ea970ea
11 changed files with 15 additions and 40 deletions

View file

@ -14,6 +14,16 @@ menuconfig 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
bool
prompt "Disable at boot"

View file

@ -25,11 +25,4 @@ config WDOG_CMSDK_APB_START_AT_BOOT
it must be reloaded before the counter reaches 0, otherwise
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

View file

@ -12,13 +12,6 @@ menuconfig WDT_ESP32
help
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
int "IRQ line for watchdog interrupt"
depends on WDT_ESP32

View file

@ -14,13 +14,6 @@ config WDT_QMSI
This driver is simply a shim driver based on the watchdog
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
int "Interrupt priority"
depends on WDT_QMSI

View file

@ -18,10 +18,3 @@ config WDT_SAM_DISABLE_AT_BOOT
default y
help
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.

View file

@ -22,13 +22,6 @@ config IWDG_STM32_START_AT_BOOT
it must be reloaded before the counter reaches 0, otherwise
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
int "Value for IWDG timeout in [us]"
depends on IWDG_STM32

View file

@ -173,7 +173,7 @@ static struct iwdg_stm32_data iwdg_stm32_dev_data = {
.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,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&iwdg_stm32_api);

View file

@ -202,7 +202,7 @@ static int wdog_cmsdk_apb_init(struct device *dev)
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,
NULL, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,

View file

@ -228,7 +228,7 @@ static const struct wdt_driver_api wdt_api = {
.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,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&wdt_api);

View file

@ -90,7 +90,7 @@ static const struct wdt_sam_dev_cfg wdt_sam_config = {
.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,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&wdt_sam_api);

View file

@ -153,6 +153,6 @@ static int wdt_sam0_init(struct device *dev)
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,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &wdt_sam0_api);