drivers: counter: rtc_stm32: convert to DT_INST defines
Convert driver to use DT_INST_ defines. Removed DT_RTC_0 fixup macros but keep DT_RTC_NAME_0 as it is still in use across RTC users. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
0c9b537edf
commit
f289a6f3be
9 changed files with 14 additions and 53 deletions
|
@ -348,8 +348,8 @@ static const struct rtc_stm32_config rtc_config = {
|
|||
.channels = 1,
|
||||
},
|
||||
.pclken = {
|
||||
.enr = DT_RTC_0_CLOCK_BITS,
|
||||
.bus = DT_RTC_0_CLOCK_BUS,
|
||||
.enr = DT_INST_0_ST_STM32_RTC_CLOCK_BITS,
|
||||
.bus = DT_INST_0_ST_STM32_RTC_CLOCK_BUS,
|
||||
},
|
||||
.ll_rtc_config = {
|
||||
.HourFormat = LL_RTC_HOURFORMAT_24HOUR,
|
||||
|
@ -378,13 +378,14 @@ static const struct counter_driver_api rtc_stm32_driver_api = {
|
|||
.get_max_relative_alarm = rtc_stm32_get_max_relative_alarm,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(rtc_stm32, DT_RTC_0_NAME, &rtc_stm32_init,
|
||||
DEVICE_AND_API_INIT(rtc_stm32, DT_INST_0_ST_STM32_RTC_LABEL, &rtc_stm32_init,
|
||||
&rtc_data, &rtc_config, PRE_KERNEL_1,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &rtc_stm32_driver_api);
|
||||
|
||||
static void rtc_stm32_irq_config(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(DT_RTC_0_IRQ, DT_RTC_0_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_INST_0_ST_STM32_RTC_IRQ_0,
|
||||
DT_INST_0_ST_STM32_RTC_IRQ_0_PRIORITY,
|
||||
rtc_stm32_isr, DEVICE_GET(rtc_stm32), 0);
|
||||
irq_enable(DT_RTC_0_IRQ);
|
||||
irq_enable(DT_INST_0_ST_STM32_RTC_IRQ_0);
|
||||
}
|
||||
|
|
|
@ -256,12 +256,7 @@
|
|||
#define DT_TIM_STM32_20_CLOCK_BITS DT_ST_STM32_TIMERS_40015000_CLOCK_BITS
|
||||
#define DT_TIM_STM32_20_CLOCK_BUS DT_ST_STM32_TIMERS_40015000_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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
|
|
|
@ -485,12 +485,7 @@
|
|||
#define DT_TIM_STM32_14_CLOCK_BITS DT_ST_STM32_TIMERS_40002000_CLOCK_BITS
|
||||
#define DT_TIM_STM32_14_CLOCK_BUS DT_ST_STM32_TIMERS_40002000_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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
|
|
|
@ -365,12 +365,7 @@
|
|||
#define DT_TIM_STM32_14_CLOCK_BITS DT_ST_STM32_TIMERS_40002000_CLOCK_BITS
|
||||
#define DT_TIM_STM32_14_CLOCK_BUS DT_ST_STM32_TIMERS_40002000_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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_FLASH_DEV_BASE_ADDRESS DT_ST_STM32F7_FLASH_CONTROLLER_40023C00_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_ST_STM32F7_FLASH_CONTROLLER_40023C00_LABEL
|
||||
|
|
|
@ -149,12 +149,7 @@
|
|||
#define DT_I2C_3_CLOCK_BITS DT_ST_STM32_I2C_V2_40007800_CLOCK_BITS
|
||||
#define DT_I2C_3_CLOCK_BUS DT_ST_STM32_I2C_V2_40007800_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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_SPI_1_BASE_ADDRESS DT_ST_STM32_SPI_FIFO_40013000_BASE_ADDRESS
|
||||
#define DT_SPI_1_IRQ_PRI DT_ST_STM32_SPI_FIFO_40013000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -181,11 +181,6 @@
|
|||
#define DT_UART_STM32_UART_8_CLOCK_BUS DT_ST_STM32_UART_40007C00_CLOCK_BUS
|
||||
#define DT_UART_STM32_UART_8_HW_FLOW_CONTROL DT_ST_STM32_UART_40007C00_HW_FLOW_CONTROL
|
||||
|
||||
#define DT_RTC_0_BASE_ADDRESS DT_ST_STM32_RTC_58004000_BASE_ADDRESS
|
||||
#define DT_RTC_0_IRQ_PRI DT_ST_STM32_RTC_58004000_IRQ_0_PRIORITY
|
||||
#define DT_RTC_0_IRQ DT_ST_STM32_RTC_58004000_IRQ_0
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_58004000_LABEL
|
||||
#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_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -125,10 +125,5 @@
|
|||
|
||||
#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL
|
||||
|
||||
#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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -179,12 +179,7 @@
|
|||
#define DT_I2C_4_CLOCK_BITS DT_ST_STM32_I2C_V2_40008400_CLOCK_BITS
|
||||
#define DT_I2C_4_CLOCK_BUS DT_ST_STM32_I2C_V2_40008400_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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_SPI_1_BASE_ADDRESS DT_ST_STM32_SPI_FIFO_40013000_BASE_ADDRESS
|
||||
#define DT_SPI_1_IRQ_PRI DT_ST_STM32_SPI_FIFO_40013000_IRQ_0_PRIORITY
|
||||
|
|
|
@ -80,12 +80,7 @@
|
|||
#define DT_UART_STM32_LPUART_1_CLOCK_BUS DT_ST_STM32_LPUART_40008000_CLOCK_BUS
|
||||
#define DT_UART_STM32_LPUART_1_HW_FLOW_CONTROL DT_ST_STM32_LPUART_40008000_HW_FLOW_CONTROL
|
||||
|
||||
#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
|
||||
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
|
||||
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
|
||||
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
|
||||
#define DT_RTC_0_NAME DT_INST_0_ST_STM32_RTC_LABEL
|
||||
|
||||
#define DT_FLASH_DEV_BASE_ADDRESS DT_ST_STM32WB_FLASH_CONTROLLER_58004000_BASE_ADDRESS
|
||||
#define DT_FLASH_DEV_NAME DT_ST_STM32WB_FLASH_CONTROLLER_58004000_LABEL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue