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:
Kumar Gala 2019-07-30 13:43:01 -05:00 committed by Maureen Helm
commit 4e7863dc41
18 changed files with 108 additions and 107 deletions

View file

@ -6,7 +6,7 @@
#include <init.h> #include <init.h>
#if defined CONFIG_PWM && defined DT_ATMEL_SAM_PWM_0 #if defined CONFIG_PWM && defined DT_INST_0_ATMEL_SAM_PWM
/* PWM on EXT1 connector, pin 7, channel 0, inverted */ /* PWM on EXT1 connector, pin 7, channel 0, inverted */
static const struct soc_gpio_pin pwm_ext1_pin7 = { static const struct soc_gpio_pin pwm_ext1_pin7 = {
PIO_PA0A_PWM0_PWMH0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A PIO_PA0A_PWM0_PWMH0, PIOA, ID_PIOA, SOC_GPIO_FUNC_A
@ -27,7 +27,7 @@ static int sam_e70_xplained_init(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);
#if defined CONFIG_PWM && DT_ATMEL_SAM_PWM_0 #if defined CONFIG_PWM && DT_INST_0_ATMEL_SAM_PWM
soc_gpio_configure(&pwm_ext1_pin7); soc_gpio_configure(&pwm_ext1_pin7);
soc_gpio_configure(&pwm_ext2_pin7); soc_gpio_configure(&pwm_ext2_pin7);
soc_gpio_configure(&pwm_ext2_pin8); soc_gpio_configure(&pwm_ext2_pin8);

View file

@ -165,7 +165,7 @@ static int dtmr_cmsdk_apb_init(struct device *dev)
} }
/* TIMER 0 */ /* TIMER 0 */
#ifdef DT_ARM_CMSDK_DTIMER_0 #ifdef DT_INST_0_ARM_CMSDK_DTIMER
static void dtimer_cmsdk_apb_config_0(struct device *dev); static void dtimer_cmsdk_apb_config_0(struct device *dev);
static const struct dtmr_cmsdk_apb_cfg dtmr_cmsdk_apb_cfg_0 = { static const struct dtmr_cmsdk_apb_cfg dtmr_cmsdk_apb_cfg_0 = {
@ -205,4 +205,4 @@ static void dtimer_cmsdk_apb_config_0(struct device *dev)
DEVICE_GET(dtmr_cmsdk_apb_0), 0); DEVICE_GET(dtmr_cmsdk_apb_0), 0);
irq_enable(DT_INST_0_ARM_CMSDK_DTIMER_IRQ_0); irq_enable(DT_INST_0_ARM_CMSDK_DTIMER_IRQ_0);
} }
#endif /* DT_ARM_CMSDK_DTIMER_0 */ #endif /* DT_INST_0_ARM_CMSDK_DTIMER */

View file

@ -160,7 +160,7 @@ static int tmr_cmsdk_apb_init(struct device *dev)
} }
/* TIMER 0 */ /* TIMER 0 */
#ifdef DT_ARM_CMSDK_TIMER_0 #ifdef DT_INST_0_ARM_CMSDK_TIMER
static void timer_cmsdk_apb_config_0(struct device *dev); static void timer_cmsdk_apb_config_0(struct device *dev);
static const struct tmr_cmsdk_apb_cfg tmr_cmsdk_apb_cfg_0 = { static const struct tmr_cmsdk_apb_cfg tmr_cmsdk_apb_cfg_0 = {
@ -198,10 +198,10 @@ static void timer_cmsdk_apb_config_0(struct device *dev)
DEVICE_GET(tmr_cmsdk_apb_0), 0); DEVICE_GET(tmr_cmsdk_apb_0), 0);
irq_enable(DT_INST_0_ARM_CMSDK_TIMER_IRQ_0); irq_enable(DT_INST_0_ARM_CMSDK_TIMER_IRQ_0);
} }
#endif /* DT_ARM_CMSDK_TIMER_0 */ #endif /* DT_INST_0_ARM_CMSDK_TIMER */
/* TIMER 1 */ /* TIMER 1 */
#ifdef DT_ARM_CMSDK_TIMER_1 #ifdef DT_INST_1_ARM_CMSDK_TIMER
static void timer_cmsdk_apb_config_1(struct device *dev); static void timer_cmsdk_apb_config_1(struct device *dev);
static const struct tmr_cmsdk_apb_cfg tmr_cmsdk_apb_cfg_1 = { static const struct tmr_cmsdk_apb_cfg tmr_cmsdk_apb_cfg_1 = {
@ -239,4 +239,4 @@ static void timer_cmsdk_apb_config_1(struct device *dev)
DEVICE_GET(tmr_cmsdk_apb_1), 0); DEVICE_GET(tmr_cmsdk_apb_1), 0);
irq_enable(DT_INST_1_ARM_CMSDK_TIMER_IRQ_0); irq_enable(DT_INST_1_ARM_CMSDK_TIMER_IRQ_0);
} }
#endif /* DT_ARM_CMSDK_TIMER_1 */ #endif /* DT_INST_1_ARM_CMSDK_TIMER */

View file

@ -62,7 +62,7 @@ struct ssd16xx_data {
u8_t scan_mode; u8_t scan_mode;
}; };
#if defined(DT_GD_GDE0213B1_0) #if defined(DT_INST_0_GD_GDE0213B1)
static u8_t ssd16xx_lut_initial[] = { static u8_t ssd16xx_lut_initial[] = {
0x22, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x11, 0x22, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x11,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -76,7 +76,7 @@ static u8_t ssd16xx_lut_default[] = {
0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00
}; };
#elif defined(DT_GD_GDE029A1_0) #elif defined(DT_INST_0_GD_GDE029A1)
static u8_t ssd16xx_lut_initial[] = { static u8_t ssd16xx_lut_initial[] = {
0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -90,7 +90,7 @@ static u8_t ssd16xx_lut_default[] = {
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
#elif defined(DT_HINK_E0154A05_0) #elif defined(DT_INST_0_HINK_E0154A05)
static u8_t ssd16xx_lut_initial[] = { static u8_t ssd16xx_lut_initial[] = {
0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, 0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22,
0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, 0x66, 0x69, 0x69, 0x59, 0x58, 0x99, 0x99, 0x88,

View file

@ -165,99 +165,99 @@ static const struct gpio_driver_api gpio_ht16k33_api = {
/* Support up to eight HT16K33 devices, each with three keyscan devices */ /* Support up to eight HT16K33 devices, each with three keyscan devices */
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_0 #ifdef DT_INST_0_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(0); GPIO_HT16K33_DEVICE(0);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_1 #ifdef DT_INST_1_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(1); GPIO_HT16K33_DEVICE(1);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_2 #ifdef DT_INST_2_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(2); GPIO_HT16K33_DEVICE(2);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_3 #ifdef DT_INST_3_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(3); GPIO_HT16K33_DEVICE(3);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_4 #ifdef DT_INST_4_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(4); GPIO_HT16K33_DEVICE(4);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_5 #ifdef DT_INST_5_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(5); GPIO_HT16K33_DEVICE(5);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_6 #ifdef DT_INST_6_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(6); GPIO_HT16K33_DEVICE(6);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_7 #ifdef DT_INST_7_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(7); GPIO_HT16K33_DEVICE(7);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_8 #ifdef DT_INST_8_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(8); GPIO_HT16K33_DEVICE(8);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_9 #ifdef DT_INST_9_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(9); GPIO_HT16K33_DEVICE(9);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_10 #ifdef DT_INST_10_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(10); GPIO_HT16K33_DEVICE(10);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_11 #ifdef DT_INST_11_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(11); GPIO_HT16K33_DEVICE(11);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_12 #ifdef DT_INST_12_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(12); GPIO_HT16K33_DEVICE(12);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_13 #ifdef DT_INST_13_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(13); GPIO_HT16K33_DEVICE(13);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_14 #ifdef DT_INST_14_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(14); GPIO_HT16K33_DEVICE(14);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_15 #ifdef DT_INST_15_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(15); GPIO_HT16K33_DEVICE(15);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_16 #ifdef DT_INST_16_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(16); GPIO_HT16K33_DEVICE(16);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_17 #ifdef DT_INST_17_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(17); GPIO_HT16K33_DEVICE(17);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_18 #ifdef DT_INST_18_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(18); GPIO_HT16K33_DEVICE(18);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_19 #ifdef DT_INST_19_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(19); GPIO_HT16K33_DEVICE(19);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_20 #ifdef DT_INST_20_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(20); GPIO_HT16K33_DEVICE(20);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_21 #ifdef DT_INST_21_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(21); GPIO_HT16K33_DEVICE(21);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_22 #ifdef DT_INST_22_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(22); GPIO_HT16K33_DEVICE(22);
#endif #endif
#ifdef DT_HOLTEK_HT16K33_KEYSCAN_23 #ifdef DT_INST_23_HOLTEK_HT16K33_KEYSCAN
GPIO_HT16K33_DEVICE(23); GPIO_HT16K33_DEVICE(23);
#endif #endif

View file

@ -183,7 +183,7 @@ static const struct i2c_driver_api i2c_gecko_driver_api = {
.transfer = i2c_gecko_transfer, .transfer = i2c_gecko_transfer,
}; };
#ifdef DT_SILABS_GECKO_I2C_0 #ifdef DT_INST_0_SILABS_GECKO_I2C
#define PIN_I2C_0_SDA {DT_INST_0_SILABS_GECKO_I2C_LOCATION_SDA_1, \ #define PIN_I2C_0_SDA {DT_INST_0_SILABS_GECKO_I2C_LOCATION_SDA_1, \
DT_INST_0_SILABS_GECKO_I2C_LOCATION_SDA_2, gpioModeWiredAnd, 1} DT_INST_0_SILABS_GECKO_I2C_LOCATION_SDA_2, gpioModeWiredAnd, 1}
@ -215,9 +215,9 @@ DEVICE_AND_API_INIT(i2c_gecko_0, DT_INST_0_SILABS_GECKO_I2C_LABEL,
&i2c_gecko_init, &i2c_gecko_data_0, &i2c_gecko_config_0, &i2c_gecko_init, &i2c_gecko_data_0, &i2c_gecko_config_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_gecko_driver_api); &i2c_gecko_driver_api);
#endif /* DT_SILABS_GECKO_I2C_0 */ #endif /* DT_INST_0_SILABS_GECKO_I2C */
#ifdef DT_SILABS_GECKO_I2C_1 #ifdef DT_INST_1_SILABS_GECKO_I2C
#define PIN_I2C_1_SDA {DT_INST_1_SILABS_GECKO_I2C_LOCATION_SDA_1, \ #define PIN_I2C_1_SDA {DT_INST_1_SILABS_GECKO_I2C_LOCATION_SDA_1, \
DT_INST_1_SILABS_GECKO_I2C_LOCATION_SDA_2, gpioModeWiredAnd, 1} DT_INST_1_SILABS_GECKO_I2C_LOCATION_SDA_2, gpioModeWiredAnd, 1}
@ -249,4 +249,4 @@ DEVICE_AND_API_INIT(i2c_gecko_1, DT_INST_1_SILABS_GECKO_I2C_LABEL,
&i2c_gecko_init, &i2c_gecko_data_1, &i2c_gecko_config_1, &i2c_gecko_init, &i2c_gecko_data_1, &i2c_gecko_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_gecko_driver_api); &i2c_gecko_driver_api);
#endif /* DT_SILABS_GECKO_I2C_1 */ #endif /* DT_INST_1_SILABS_GECKO_I2C */

View file

@ -120,18 +120,18 @@ DEVICE_AND_API_INIT(i2c_sbcon_##_num, DT_INST_##_num##_ARM_VERSATILE_I2C_LABEL,
&i2c_sbcon_dev_cfg_##_num, \ &i2c_sbcon_dev_cfg_##_num, \
PRE_KERNEL_2, CONFIG_I2C_INIT_PRIORITY, &api) PRE_KERNEL_2, CONFIG_I2C_INIT_PRIORITY, &api)
#ifdef DT_ARM_VERSATILE_I2C_0 #ifdef DT_INST_0_ARM_VERSATILE_I2C
DEFINE_I2C_SBCON(0); DEFINE_I2C_SBCON(0);
#endif #endif
#ifdef DT_ARM_VERSATILE_I2C_1 #ifdef DT_INST_1_ARM_VERSATILE_I2C
DEFINE_I2C_SBCON(1); DEFINE_I2C_SBCON(1);
#endif #endif
#ifdef DT_ARM_VERSATILE_I2C_2 #ifdef DT_INST_2_ARM_VERSATILE_I2C
DEFINE_I2C_SBCON(2); DEFINE_I2C_SBCON(2);
#endif #endif
#ifdef DT_ARM_VERSATILE_I2C_3 #ifdef DT_INST_3_ARM_VERSATILE_I2C
DEFINE_I2C_SBCON(3); DEFINE_I2C_SBCON(3);
#endif #endif

View file

@ -203,7 +203,7 @@ static int i2c_eeprom_slave_init(struct device *dev)
return 0; return 0;
} }
#ifdef DT_ATMEL_AT24_0 #ifdef DT_INST_0_ATMEL_AT24
static struct i2c_eeprom_slave_data i2c_eeprom_slave_0_dev_data; static struct i2c_eeprom_slave_data i2c_eeprom_slave_0_dev_data;
@ -222,9 +222,9 @@ DEVICE_AND_API_INIT(i2c_eeprom_slave_0, DT_INST_0_ATMEL_AT24_LABEL,
POST_KERNEL, CONFIG_I2C_SLAVE_INIT_PRIORITY, POST_KERNEL, CONFIG_I2C_SLAVE_INIT_PRIORITY,
&api_funcs); &api_funcs);
#endif /* DT_ATMEL_AT24_0 */ #endif /* DT_INST_0_ATMEL_AT24 */
#ifdef DT_ATMEL_AT24_1 #ifdef DT_INST_1_ATMEL_AT24
static struct i2c_eeprom_slave_data i2c_eeprom_slave_1_dev_data; static struct i2c_eeprom_slave_data i2c_eeprom_slave_1_dev_data;
@ -243,4 +243,4 @@ DEVICE_AND_API_INIT(i2c_eeprom_slave_1, DT_INST_1_ATMEL_AT24_LABEL,
POST_KERNEL, CONFIG_I2C_SLAVE_INIT_PRIORITY, POST_KERNEL, CONFIG_I2C_SLAVE_INIT_PRIORITY,
&api_funcs); &api_funcs);
#endif /* DT_ATMEL_AT24_1 */ #endif /* DT_INST_1_ATMEL_AT24 */

View file

@ -502,7 +502,7 @@ DEVICE_AND_API_INIT(ht16k33_##id, DT_INST_##id##_HOLTEK_HT16K33_LABEL, \
/* Support up to eight HT16K33 devices */ /* Support up to eight HT16K33 devices */
#ifdef DT_HOLTEK_HT16K33_0 #ifdef DT_INST_0_HOLTEK_HT16K33
#ifdef DT_INST_0_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_0_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(0); HT16K33_DEVICE_WITH_IRQ(0);
#else #else
@ -510,7 +510,7 @@ HT16K33_DEVICE(0);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_1 #ifdef DT_INST_1_HOLTEK_HT16K33
#ifdef DT_INST_1_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_1_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(1); HT16K33_DEVICE_WITH_IRQ(1);
#else #else
@ -518,7 +518,7 @@ HT16K33_DEVICE(1);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_2 #ifdef DT_INST_2_HOLTEK_HT16K33
#ifdef DT_INST_2_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_2_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(2); HT16K33_DEVICE_WITH_IRQ(2);
#else #else
@ -526,7 +526,7 @@ HT16K33_DEVICE(2);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_3 #ifdef DT_INST_3_HOLTEK_HT16K33
#ifdef DT_INST_3_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_3_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(3); HT16K33_DEVICE_WITH_IRQ(3);
#else #else
@ -534,7 +534,7 @@ HT16K33_DEVICE(3);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_4 #ifdef DT_INST_4_HOLTEK_HT16K33
#ifdef DT_INST_4_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_4_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(4); HT16K33_DEVICE_WITH_IRQ(4);
#else #else
@ -542,7 +542,7 @@ HT16K33_DEVICE(4);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_5 #ifdef DT_INST_5_HOLTEK_HT16K33
#ifdef DT_INST_5_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_5_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(5); HT16K33_DEVICE_WITH_IRQ(5);
#else #else
@ -550,7 +550,7 @@ HT16K33_DEVICE(5);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_6 #ifdef DT_INST_6_HOLTEK_HT16K33
#ifdef DT_INST_6_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_6_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(6); HT16K33_DEVICE_WITH_IRQ(6);
#else #else
@ -558,7 +558,7 @@ HT16K33_DEVICE(6);
#endif #endif
#endif #endif
#ifdef DT_HOLTEK_HT16K33_7 #ifdef DT_INST_7_HOLTEK_HT16K33
#ifdef DT_INST_7_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER #ifdef DT_INST_7_HOLTEK_HT16K33_IRQ_GPIOS_CONTROLLER
HT16K33_DEVICE_WITH_IRQ(7); HT16K33_DEVICE_WITH_IRQ(7);
#else #else

View file

@ -9,7 +9,7 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#ifdef DT_COLORWAY_LPD8806_0 #ifdef DT_INST_0_COLORWAY_LPD8806
#define DT_INST_0_COLORWAY_LPD880X DT_INST_0_COLORWAY_LPD8806 #define DT_INST_0_COLORWAY_LPD880X DT_INST_0_COLORWAY_LPD8806
#define DT_INST_0_COLORWAY_LPD880X_BASE_ADDRESS DT_INST_0_COLORWAY_LPD8806_BASE_ADDRESS #define DT_INST_0_COLORWAY_LPD880X_BASE_ADDRESS DT_INST_0_COLORWAY_LPD8806_BASE_ADDRESS
#define DT_INST_0_COLORWAY_LPD880X_BUS_NAME DT_INST_0_COLORWAY_LPD8806_BUS_NAME #define DT_INST_0_COLORWAY_LPD880X_BUS_NAME DT_INST_0_COLORWAY_LPD8806_BUS_NAME

View file

@ -90,7 +90,7 @@ static const struct pwm_driver_api sam_pwm_driver_api = {
.get_cycles_per_sec = sam_pwm_get_cycles_per_sec, .get_cycles_per_sec = sam_pwm_get_cycles_per_sec,
}; };
#ifdef DT_ATMEL_SAM_PWM_0 #ifdef DT_INST_0_ATMEL_SAM_PWM
static const struct sam_pwm_config sam_pwm_config_0 = { static const struct sam_pwm_config sam_pwm_config_0 = {
.regs = (Pwm *)DT_INST_0_ATMEL_SAM_PWM_BASE_ADDRESS, .regs = (Pwm *)DT_INST_0_ATMEL_SAM_PWM_BASE_ADDRESS,
.id = DT_INST_0_ATMEL_SAM_PWM_PERIPHERAL_ID, .id = DT_INST_0_ATMEL_SAM_PWM_PERIPHERAL_ID,
@ -102,9 +102,9 @@ DEVICE_AND_API_INIT(sam_pwm_0, DT_INST_0_ATMEL_SAM_PWM_LABEL, &sam_pwm_init,
NULL, &sam_pwm_config_0, NULL, &sam_pwm_config_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&sam_pwm_driver_api); &sam_pwm_driver_api);
#endif /* DT_ATMEL_SAM_PWM_0 */ #endif /* DT_INST_0_ATMEL_SAM_PWM */
#ifdef DT_ATMEL_SAM_PWM_1 #ifdef DT_INST_1_ATMEL_SAM_PWM
static const struct sam_pwm_config sam_pwm_config_1 = { static const struct sam_pwm_config sam_pwm_config_1 = {
.regs = (Pwm *)DT_INST_1_ATMEL_SAM_PWM_BASE_ADDRESS, .regs = (Pwm *)DT_INST_1_ATMEL_SAM_PWM_BASE_ADDRESS,
.id = DT_INST_1_ATMEL_SAM_PWM_PERIPHERAL_ID, .id = DT_INST_1_ATMEL_SAM_PWM_PERIPHERAL_ID,
@ -116,4 +116,4 @@ DEVICE_AND_API_INIT(sam_pwm_1, DT_INST_1_ATMEL_SAM_PWM_LABEL, &sam_pwm_init,
NULL, &sam_pwm_config_1, NULL, &sam_pwm_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&sam_pwm_driver_api); &sam_pwm_driver_api);
#endif /* DT_ATMEL_SAM_PWM_1 */ #endif /* DT_INST_1_ATMEL_SAM_PWM */

View file

@ -10,7 +10,7 @@ menuconfig UART_SAM0
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT select SERIAL_SUPPORT_INTERRUPT
# the ASYNC implementation requires a DMA controller # the ASYNC implementation requires a DMA controller
select SERIAL_SUPPORT_ASYNC if ($(dt_int_val,DT_ATMEL_SAM0_DMAC_0) != 0) select SERIAL_SUPPORT_ASYNC if ($(dt_int_val,DT_INST_0_ATMEL_SAM0_DMAC) != 0)
select DMA if UART_ASYNC_API select DMA if UART_ASYNC_API
help help
This option enables the SERCOMx USART driver for Atmel SAM0 MCUs. This option enables the SERCOMx USART driver for Atmel SAM0 MCUs.

View file

@ -310,7 +310,7 @@ static const struct uart_driver_api leuart_gecko_driver_api = {
#endif #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, \ #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} 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
#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, \ #define PIN_LEUART_1_RXD {DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_1, \
DT_SILABS_GECKO_LEUART_1_LOCATION_RX_2, gpioModeInput, 1} DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_2, gpioModeInput, 1}
#define PIN_LEUART_1_TXD {DT_SILABS_GECKO_LEUART_1_LOCATION_TX_1, \ #define PIN_LEUART_1_TXD {DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_1, \
DT_SILABS_GECKO_LEUART_1_LOCATION_TX_2, gpioModePushPull, 1} DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_2, gpioModePushPull, 1}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void leuart_gecko_config_func_1(struct device *dev); static void leuart_gecko_config_func_1(struct device *dev);
#endif #endif
static const struct leuart_gecko_config leuart_gecko_1_config = { 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, .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_rx = PIN_LEUART_1_RXD,
.pin_tx = PIN_LEUART_1_TXD, .pin_tx = PIN_LEUART_1_TXD,
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION #ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
.loc_rx = DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0, .loc_rx = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0,
.loc_tx = DT_SILABS_GECKO_LEUART_1_LOCATION_TX_0, .loc_tx = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_0,
#else #else
#if DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0 \ #if DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0 \
!= DT_SILABS_GECKO_LEUART_1_LOCATION_TX_0 != DT_INST_1_SILABS_GECKO_LEUART_LOCATION_TX_0
#error LEUART_1 DTS location-* properties must have identical value #error LEUART_1 DTS location-* properties must have identical value
#endif #endif
.loc = DT_SILABS_GECKO_LEUART_1_LOCATION_RX_0, .loc = DT_INST_1_SILABS_GECKO_LEUART_LOCATION_RX_0,
#endif #endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = leuart_gecko_config_func_1, .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 #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void leuart_gecko_config_func_1(struct device *dev) static void leuart_gecko_config_func_1(struct device *dev)
{ {
IRQ_CONNECT(DT_SILABS_GECKO_LEUART_1_IRQ_0, IRQ_CONNECT(DT_INST_1_SILABS_GECKO_LEUART_IRQ_0,
DT_SILABS_GECKO_LEUART_1_IRQ_0_PRIORITY, DT_INST_1_SILABS_GECKO_LEUART_IRQ_0_PRIORITY,
leuart_gecko_isr, DEVICE_GET(leuart_1), 0); 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
#endif /* DT_SILABS_GECKO_LEUART_1 */ #endif /* DT_INST_1_SILABS_GECKO_LEUART */

View file

@ -456,7 +456,7 @@ static const struct uart_driver_api uart_cmsdk_apb_driver_api = {
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */ #endif /* CONFIG_UART_INTERRUPT_DRIVEN */
}; };
#ifdef DT_ARM_CMSDK_UART_0 #ifdef DT_INST_0_ARM_CMSDK_UART
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_cmsdk_apb_irq_config_func_0(struct device *dev); static void uart_cmsdk_apb_irq_config_func_0(struct device *dev);
@ -519,9 +519,9 @@ static void uart_cmsdk_apb_irq_config_func_0(struct device *dev)
#endif #endif
#endif #endif
#endif /* DT_ARM_CMSDK_UART_0 */ #endif /* DT_INST_0_ARM_CMSDK_UART */
#ifdef DT_ARM_CMSDK_UART_1 #ifdef DT_INST_1_ARM_CMSDK_UART
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_cmsdk_apb_irq_config_func_1(struct device *dev); static void uart_cmsdk_apb_irq_config_func_1(struct device *dev);
@ -584,9 +584,9 @@ static void uart_cmsdk_apb_irq_config_func_1(struct device *dev)
#endif #endif
#endif #endif
#endif /* DT_ARM_CMSDK_UART_1 */ #endif /* DT_INST_1_ARM_CMSDK_UART */
#ifdef DT_ARM_CMSDK_UART_2 #ifdef DT_INST_2_ARM_CMSDK_UART
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_cmsdk_apb_irq_config_func_2(struct device *dev); static void uart_cmsdk_apb_irq_config_func_2(struct device *dev);
@ -623,7 +623,7 @@ DEVICE_AND_API_INIT(uart_cmsdk_apb_2,
static void uart_cmsdk_apb_irq_config_func_2(struct device *dev) static void uart_cmsdk_apb_irq_config_func_2(struct device *dev)
{ {
IRQ_CONNECT(CMSDK_APB_UART_2_IRQ, IRQ_CONNECT(CMSDK_APB_UART_2_IRQ,
DT_ARM_CMSDK_UART_2_IRQ_PRIORITY, DT_INST_2_ARM_CMSDK_UART_IRQ_PRIORITY,
uart_cmsdk_apb_isr, uart_cmsdk_apb_isr,
DEVICE_GET(uart_cmsdk_apb_2), DEVICE_GET(uart_cmsdk_apb_2),
0); 0);
@ -649,9 +649,9 @@ static void uart_cmsdk_apb_irq_config_func_2(struct device *dev)
#endif #endif
#endif #endif
#endif /* DT_ARM_CMSDK_UART_2 */ #endif /* DT_INST_2_ARM_CMSDK_UART */
#ifdef DT_ARM_CMSDK_UART_3 #ifdef DT_INST_3_ARM_CMSDK_UART
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_cmsdk_apb_irq_config_func_3(struct device *dev); static void uart_cmsdk_apb_irq_config_func_3(struct device *dev);
@ -688,7 +688,7 @@ DEVICE_AND_API_INIT(uart_cmsdk_apb_3,
static void uart_cmsdk_apb_irq_config_func_3(struct device *dev) static void uart_cmsdk_apb_irq_config_func_3(struct device *dev)
{ {
IRQ_CONNECT(CMSDK_APB_UART_3_IRQ, IRQ_CONNECT(CMSDK_APB_UART_3_IRQ,
DT_ARM_CMSDK_UART_3_IRQ_PRIORITY, DT_INST_3_ARM_CMSDK_UART_IRQ_PRIORITY,
uart_cmsdk_apb_isr, uart_cmsdk_apb_isr,
DEVICE_GET(uart_cmsdk_apb_3), DEVICE_GET(uart_cmsdk_apb_3),
0); 0);
@ -714,9 +714,9 @@ static void uart_cmsdk_apb_irq_config_func_3(struct device *dev)
#endif #endif
#endif #endif
#endif /* DT_ARM_CMSDK_UART_3 */ #endif /* DT_INST_3_ARM_CMSDK_UART */
#ifdef DT_ARM_CMSDK_UART_4 #ifdef DT_INST_4_ARM_CMSDK_UART
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_cmsdk_apb_irq_config_func_4(struct device *dev); static void uart_cmsdk_apb_irq_config_func_4(struct device *dev);
@ -753,7 +753,7 @@ DEVICE_AND_API_INIT(uart_cmsdk_apb_4,
static void uart_cmsdk_apb_irq_config_func_4(struct device *dev) static void uart_cmsdk_apb_irq_config_func_4(struct device *dev)
{ {
IRQ_CONNECT(CMSDK_APB_UART_4_IRQ, IRQ_CONNECT(CMSDK_APB_UART_4_IRQ,
DT_ARM_CMSDK_UART_4_IRQ_PRIORITY, DT_INST_4_ARM_CMSDK_UART_IRQ_PRIORITY,
uart_cmsdk_apb_isr, uart_cmsdk_apb_isr,
DEVICE_GET(uart_cmsdk_apb_4), DEVICE_GET(uart_cmsdk_apb_4),
0); 0);
@ -779,4 +779,4 @@ static void uart_cmsdk_apb_irq_config_func_4(struct device *dev)
#endif #endif
#endif #endif
#endif /* DT_ARM_CMSDK_UART_4 */ #endif /* DT_INST_4_ARM_CMSDK_UART */

View file

@ -294,7 +294,7 @@ static const struct uart_driver_api uart_gecko_driver_api = {
#endif #endif
}; };
#ifdef DT_SILABS_GECKO_UART_0 #ifdef DT_INST_0_SILABS_GECKO_UART
#define PIN_UART0_RXD {DT_INST_0_SILABS_GECKO_UART_LOCATION_RX_1, \ #define PIN_UART0_RXD {DT_INST_0_SILABS_GECKO_UART_LOCATION_RX_1, \
DT_INST_0_SILABS_GECKO_UART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_0_SILABS_GECKO_UART_LOCATION_RX_2, gpioModeInput, 1}
@ -347,9 +347,9 @@ static void uart_gecko_config_func_0(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_UART_0 */ #endif /* DT_INST_0_SILABS_GECKO_UART */
#ifdef DT_SILABS_GECKO_UART_1 #ifdef DT_INST_1_SILABS_GECKO_UART
#define PIN_UART1_RXD {DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_1, \ #define PIN_UART1_RXD {DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_1, \
DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_2, gpioModeInput, 1}
@ -402,9 +402,9 @@ static void uart_gecko_config_func_1(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_UART_1 */ #endif /* DT_INST_1_SILABS_GECKO_UART */
#ifdef DT_SILABS_GECKO_USART_0 #ifdef DT_INST_0_SILABS_GECKO_USART
#define PIN_USART0_RXD {DT_INST_0_SILABS_GECKO_USART_LOCATION_RX_1, \ #define PIN_USART0_RXD {DT_INST_0_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_INST_0_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_0_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
@ -458,9 +458,9 @@ static void usart_gecko_config_func_0(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_USART_0 */ #endif /* DT_INST_0_SILABS_GECKO_USART */
#ifdef DT_SILABS_GECKO_USART_1 #ifdef DT_INST_1_SILABS_GECKO_USART
#define PIN_USART1_RXD {DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_1, \ #define PIN_USART1_RXD {DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
@ -514,9 +514,9 @@ static void usart_gecko_config_func_1(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_USART_1 */ #endif /* DT_INST_1_SILABS_GECKO_USART */
#ifdef DT_SILABS_GECKO_USART_2 #ifdef DT_INST_2_SILABS_GECKO_USART
#define PIN_USART2_RXD {DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_1, \ #define PIN_USART2_RXD {DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
@ -570,9 +570,9 @@ static void usart_gecko_config_func_2(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_USART_2 */ #endif /* DT_INST_2_SILABS_GECKO_USART */
#ifdef DT_SILABS_GECKO_USART_3 #ifdef DT_INST_3_SILABS_GECKO_USART
#define PIN_USART3_RXD {DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_1, \ #define PIN_USART3_RXD {DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1} DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
@ -626,4 +626,4 @@ static void usart_gecko_config_func_3(struct device *dev)
} }
#endif #endif
#endif /* DT_SILABS_GECKO_USART_3 */ #endif /* DT_INST_3_SILABS_GECKO_USART */

View file

@ -56,6 +56,7 @@ class DTCompatible(DTDirective):
compat_instance = 'DT_' + str_to_label(compat) + '_' + str(instance_id) compat_instance = 'DT_' + str_to_label(compat) + '_' + str(instance_id)
insert_defs(node_path, {compat_instance: '1'}, {}) insert_defs(node_path, {compat_instance: '1'}, {})
deprecated_main.append(compat_instance)
# Generate defines of the form: # Generate defines of the form:
# #define DT_<COMPAT>_<INSTANCE ID>_BUS_<BUS> 1 # #define DT_<COMPAT>_<INSTANCE ID>_BUS_<BUS> 1

View file

@ -201,12 +201,12 @@ def write_bus(dev):
def write_existence_flags(dev): def write_existence_flags(dev):
# Generate #defines of the form # Generate #defines of the form
# #
# #define DT_<COMPAT>_<INSTANCE> 1 # #define DT_INST_<INSTANCE>_<COMPAT> 1
# #
# These are flags for which devices exist. # These are flags for which devices exist.
for compat in dev.compats: for compat in dev.compats:
out("{}_{}".format(str2ident(compat), dev.instance_no[compat]), 1) out("INST_{}_{}".format(dev.instance_no[compat], str2ident(compat)), 1)
def reg_addr_ident(reg): def reg_addr_ident(reg):

View file

@ -160,7 +160,7 @@ void test_eeprom_slave(void)
* label property ("EEPROM_SLAVE_0") rather than the generated * label property ("EEPROM_SLAVE_0") rather than the generated
* macro DT_INST_0_ATMEL_AT24_LABEL. There is no guarantee that * macro DT_INST_0_ATMEL_AT24_LABEL. There is no guarantee that
* the index for the compatible is persistent across builds; * the index for the compatible is persistent across builds;
* for example DT_ATMEL_AT24_0 might refer to "EEPROM_SLAVE_1" * for example DT_INST_0_ATMEL_AT24 might refer to "EEPROM_SLAVE_1"
* if the order of the node declarations were changed in the * if the order of the node declarations were changed in the
* overlay file. * overlay file.
* *