drivers: watchdog: wwdg_stm32: convert to DT_INST defines
Convert driver to use DT_INST_ defines. Signed-off-by: Kumar Gala <kumar.gala@linaro.org> Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
921226493b
commit
c44a4d84e0
|
@ -259,13 +259,13 @@ static struct wwdg_stm32_data wwdg_stm32_dev_data = {
|
|||
|
||||
static struct wwdg_stm32_config wwdg_stm32_dev_config = {
|
||||
.pclken = {
|
||||
.enr = DT_WWDT_0_CLOCK_BITS,
|
||||
.bus = DT_WWDT_0_CLOCK_BUS
|
||||
.enr = DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS,
|
||||
.bus = DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
},
|
||||
.Instance = (WWDG_TypeDef *)DT_WWDT_0_BASE_ADDRESS,
|
||||
.Instance = (WWDG_TypeDef *)DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(wwdg_stm32, DT_WWDT_0_NAME,
|
||||
DEVICE_AND_API_INIT(wwdg_stm32, DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL,
|
||||
wwdg_stm32_init, &wwdg_stm32_dev_data, &wwdg_stm32_dev_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&wwdg_stm32_api);
|
||||
|
@ -274,8 +274,9 @@ static void wwdg_stm32_irq_config(struct device *dev)
|
|||
{
|
||||
WWDG_TypeDef *wwdg = WWDG_STM32_STRUCT(dev);
|
||||
|
||||
IRQ_CONNECT(DT_WWDT_0_IRQ, DT_WWDT_0_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0,
|
||||
DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY,
|
||||
wwdg_stm32_isr, DEVICE_GET(wwdg_stm32), 0);
|
||||
irq_enable(DT_WWDT_0_IRQ);
|
||||
irq_enable(DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0);
|
||||
LL_WWDG_EnableIT_EWKUP(wwdg);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define WDT_DEV_NAME DT_ALIAS_WATCHDOG0_LABEL
|
||||
#else
|
||||
#ifdef CONFIG_WWDG_STM32
|
||||
#define WDT_DEV_NAME DT_WWDT_0_NAME
|
||||
#define WDT_DEV_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#else
|
||||
#define WDT_DEV_NAME DT_WDT_0_NAME
|
||||
#endif
|
||||
|
|
|
@ -190,13 +190,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012400_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012400_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012400_IRQ_0_PRIORITY
|
||||
|
|
|
@ -211,13 +211,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012400_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012400_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012400_IRQ_0_PRIORITY
|
||||
|
|
|
@ -150,13 +150,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012000_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012000_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -265,13 +265,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_50000000_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_50000000_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_50000000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -494,13 +494,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012000_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012000_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -392,13 +392,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012000_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012000_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -99,11 +99,4 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -253,11 +253,4 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -188,11 +188,4 @@
|
|||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_58004000_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_58004000_CLOCK_BUS
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -135,13 +135,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_40012400_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_40012400_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_40012400_IRQ_0_PRIORITY
|
||||
|
|
|
@ -125,13 +125,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_RTC_0_BASE_ADDRESS DT_ST_STM32_RTC_40002800_BASE_ADDRESS
|
||||
#define DT_RTC_0_IRQ_PRI DT_ST_STM32_RTC_40002800_IRQ_0_PRIORITY
|
||||
#define DT_RTC_0_IRQ DT_ST_STM32_RTC_40002800_IRQ_0
|
||||
|
|
|
@ -314,13 +314,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_ADC_1_BASE_ADDRESS DT_ST_STM32_ADC_50040000_BASE_ADDRESS
|
||||
#define DT_ADC_1_IRQ DT_ST_STM32_ADC_50040000_IRQ_0
|
||||
#define DT_ADC_1_IRQ_PRI DT_ST_STM32_ADC_50040000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -389,11 +389,4 @@
|
|||
#define DT_I2C_5_CLOCK_BITS DT_ST_STM32_I2C_V2_40015000_CLOCK_BITS
|
||||
#define DT_I2C_5_CLOCK_BUS DT_ST_STM32_I2C_V2_40015000_CLOCK_BUS
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -157,13 +157,6 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS
|
||||
#define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0
|
||||
#define DT_WWDT_0_IRQ_PRI DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0_PRIORITY
|
||||
#define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS
|
||||
#define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS
|
||||
|
||||
#define DT_LPTIM_1_BASE_ADDRESS DT_ST_STM32_TIMERS_40007C00_BASE_ADDRESS
|
||||
#define DT_LPTIM_1_IRQ DT_ST_STM32_TIMERS_40007C00_IRQ_0
|
||||
#define DT_LPTIM_1_IRQ_PRI DT_ST_STM32_TIMERS_40007C00_IRQ_0_PRIORITY
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#define WDT_DEV_NAME DT_ALIAS_WATCHDOG0_LABEL
|
||||
#else
|
||||
#ifdef CONFIG_WWDG_STM32
|
||||
#define WDT_DEV_NAME DT_WWDT_0_NAME
|
||||
#define WDT_DEV_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL
|
||||
#else
|
||||
#define WDT_DEV_NAME DT_WDT_0_NAME
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue