dts: Make instance defines consistent
We generated a define for each instance to convey its existance of the form: #define DT_<COMPAT>_<INSTANCE> 1 However we renamed all other instance defines to be of the form DT_INST_<INSTANCE>_<FOO>. To make things consistent we now generate a define of the form: #define DT_INST_<INSTANCE>_<COMPAT> 1 We also now deprecate the DT_<COMPAT>_<INSTANCE> form and fixup all uses to use the new form. Fixes: #17650 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
4620bbf0c8
commit
4e7863dc41
18 changed files with 108 additions and 107 deletions
|
@ -310,7 +310,7 @@ static const struct uart_driver_api leuart_gecko_driver_api = {
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef DT_SILABS_GECKO_LEUART_0
|
||||
#ifdef DT_INST_0_SILABS_GECKO_LEUART
|
||||
|
||||
#define PIN_LEUART_0_RXD {DT_INST_0_SILABS_GECKO_LEUART_LOCATION_RX_1, \
|
||||
DT_INST_0_SILABS_GECKO_LEUART_LOCATION_RX_2, gpioModeInput, 1}
|
||||
|
@ -361,34 +361,34 @@ static void leuart_gecko_config_func_0(struct device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* DT_SILABS_GECKO_LEUART_0 */
|
||||
#endif /* DT_INST_0_SILABS_GECKO_LEUART */
|
||||
|
||||
#ifdef DT_SILABS_GECKO_LEUART_1
|
||||
#ifdef DT_INST_1_SILABS_GECKO_LEUART
|
||||
|
||||
#define PIN_LEUART_1_RXD {DT_SILABS_GECKO_LEUART_1_LOCATION_RX_1, \
|
||||
DT_SILABS_GECKO_LEUART_1_LOCATION_RX_2, gpioModeInput, 1}
|
||||
#define PIN_LEUART_1_TXD {DT_SILABS_GECKO_LEUART_1_LOCATION_TX_1, \
|
||||
DT_SILABS_GECKO_LEUART_1_LOCATION_TX_2, gpioModePushPull, 1}
|
||||
#define PIN_LEUART_1_RXD {DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_1, \
|
||||
DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_2, gpioModeInput, 1}
|
||||
#define PIN_LEUART_1_TXD {DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_1, \
|
||||
DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_2, gpioModePushPull, 1}
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
static void leuart_gecko_config_func_1(struct device *dev);
|
||||
#endif
|
||||
|
||||
static const struct leuart_gecko_config leuart_gecko_1_config = {
|
||||
.base = (LEUART_TypeDef *)DT_SILABS_GECKO_LEUART_1_BASE_ADDRESS,
|
||||
.base = (LEUART_TypeDef *)DT_INST_1_SILABS_GECKO_LEUART_BASE_ADDRESS,
|
||||
.clock = cmuClock_LEUART0,
|
||||
.baud_rate = DT_SILABS_GECKO_LEUART_1_CURRENT_SPEED,
|
||||
.baud_rate = DT_INST_1_SILABS_GECKO_LEUART_CURRENT_SPEED,
|
||||
.pin_rx = PIN_LEUART_1_RXD,
|
||||
.pin_tx = PIN_LEUART_1_TXD,
|
||||
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
|
||||
.loc_rx = DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0,
|
||||
.loc_tx = DT_SILABS_GECKO_LEUART_1_LOCATION_TX_0,
|
||||
.loc_rx = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0,
|
||||
.loc_tx = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_0,
|
||||
#else
|
||||
#if DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0 \
|
||||
!= DT_SILABS_GECKO_LEUART_1_LOCATION_TX_0
|
||||
#if DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0 \
|
||||
!= DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_0
|
||||
#error LEUART_1 DTS location-* properties must have identical value
|
||||
#endif
|
||||
.loc = DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0,
|
||||
.loc = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0,
|
||||
#endif
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
.irq_config_func = leuart_gecko_config_func_1,
|
||||
|
@ -406,12 +406,12 @@ DEVICE_AND_API_INIT(leuart_1, DT_INST_1_SILABS_GECKO_LEUART_LABEL,
|
|||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
static void leuart_gecko_config_func_1(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(DT_SILABS_GECKO_LEUART_1_IRQ_0,
|
||||
DT_SILABS_GECKO_LEUART_1_IRQ_0_PRIORITY,
|
||||
IRQ_CONNECT(DT_INST_1_SILABS_GECKO_LEUART_IRQ_0,
|
||||
DT_INST_1_SILABS_GECKO_LEUART_IRQ_0_PRIORITY,
|
||||
leuart_gecko_isr, DEVICE_GET(leuart_1), 0);
|
||||
|
||||
irq_enable(DT_SILABS_GECKO_LEUART_1_IRQ_0);
|
||||
irq_enable(DT_INST_1_SILABS_GECKO_LEUART_IRQ_0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DT_SILABS_GECKO_LEUART_1 */
|
||||
#endif /* DT_INST_1_SILABS_GECKO_LEUART */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue