gpio: mcux: Convert to use DT_ prefixed defines
The gpio mcux driver has been using non DT_ prefixed defines for DT generated defines. Switch to use DT_ prefixed ones as we want to deprecated the non DT_ prefixed defines. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
f087cd0774
commit
93a9e0b3fe
1 changed files with 30 additions and 30 deletions
|
@ -240,9 +240,9 @@ static const struct gpio_driver_api gpio_mcux_driver_api = {
|
|||
static int gpio_mcux_porta_init(struct device *dev);
|
||||
|
||||
static const struct gpio_mcux_config gpio_mcux_porta_config = {
|
||||
.gpio_base = (GPIO_Type *) GPIO_A_BASE_ADDRESS,
|
||||
.gpio_base = (GPIO_Type *) DT_NXP_KINETIS_GPIO_GPIO_A_BASE_ADDRESS,
|
||||
.port_base = PORTA,
|
||||
#ifdef GPIO_A_IRQ
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_A_IRQ
|
||||
.flags = GPIO_INT,
|
||||
#else
|
||||
.flags = 0,
|
||||
|
@ -251,7 +251,7 @@ static const struct gpio_mcux_config gpio_mcux_porta_config = {
|
|||
|
||||
static struct gpio_mcux_data gpio_mcux_porta_data;
|
||||
|
||||
DEVICE_AND_API_INIT(gpio_mcux_porta, GPIO_A_LABEL,
|
||||
DEVICE_AND_API_INIT(gpio_mcux_porta, DT_NXP_KINETIS_GPIO_GPIO_A_LABEL,
|
||||
gpio_mcux_porta_init,
|
||||
&gpio_mcux_porta_data, &gpio_mcux_porta_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
|
@ -259,11 +259,11 @@ DEVICE_AND_API_INIT(gpio_mcux_porta, GPIO_A_LABEL,
|
|||
|
||||
static int gpio_mcux_porta_init(struct device *dev)
|
||||
{
|
||||
#ifdef GPIO_A_IRQ
|
||||
IRQ_CONNECT(GPIO_A_IRQ, GPIO_A_IRQ_PRIORITY,
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_A_IRQ
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_GPIO_GPIO_A_IRQ, DT_NXP_KINETIS_GPIO_GPIO_A_IRQ_PRIORITY,
|
||||
gpio_mcux_port_isr, DEVICE_GET(gpio_mcux_porta), 0);
|
||||
|
||||
irq_enable(GPIO_A_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_GPIO_GPIO_A_IRQ);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
@ -276,9 +276,9 @@ static int gpio_mcux_porta_init(struct device *dev)
|
|||
static int gpio_mcux_portb_init(struct device *dev);
|
||||
|
||||
static const struct gpio_mcux_config gpio_mcux_portb_config = {
|
||||
.gpio_base = (GPIO_Type *) GPIO_B_BASE_ADDRESS,
|
||||
.gpio_base = (GPIO_Type *) DT_NXP_KINETIS_GPIO_GPIO_B_BASE_ADDRESS,
|
||||
.port_base = PORTB,
|
||||
#ifdef GPIO_B_IRQ
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_B_IRQ
|
||||
.flags = GPIO_INT,
|
||||
#else
|
||||
.flags = 0,
|
||||
|
@ -287,7 +287,7 @@ static const struct gpio_mcux_config gpio_mcux_portb_config = {
|
|||
|
||||
static struct gpio_mcux_data gpio_mcux_portb_data;
|
||||
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portb, GPIO_B_LABEL,
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portb, DT_NXP_KINETIS_GPIO_GPIO_B_LABEL,
|
||||
gpio_mcux_portb_init,
|
||||
&gpio_mcux_portb_data, &gpio_mcux_portb_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
|
@ -295,11 +295,11 @@ DEVICE_AND_API_INIT(gpio_mcux_portb, GPIO_B_LABEL,
|
|||
|
||||
static int gpio_mcux_portb_init(struct device *dev)
|
||||
{
|
||||
#ifdef GPIO_B_IRQ
|
||||
IRQ_CONNECT(GPIO_B_IRQ, GPIO_B_IRQ_PRIORITY,
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_B_IRQ
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_GPIO_GPIO_B_IRQ, DT_NXP_KINETIS_GPIO_GPIO_B_IRQ_PRIORITY,
|
||||
gpio_mcux_port_isr, DEVICE_GET(gpio_mcux_portb), 0);
|
||||
|
||||
irq_enable(GPIO_B_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_GPIO_GPIO_B_IRQ);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
@ -312,9 +312,9 @@ static int gpio_mcux_portb_init(struct device *dev)
|
|||
static int gpio_mcux_portc_init(struct device *dev);
|
||||
|
||||
static const struct gpio_mcux_config gpio_mcux_portc_config = {
|
||||
.gpio_base = (GPIO_Type *) GPIO_C_BASE_ADDRESS,
|
||||
.gpio_base = (GPIO_Type *) DT_NXP_KINETIS_GPIO_GPIO_C_BASE_ADDRESS,
|
||||
.port_base = PORTC,
|
||||
#ifdef GPIO_C_IRQ
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_C_IRQ
|
||||
.flags = GPIO_INT,
|
||||
#else
|
||||
.flags = 0,
|
||||
|
@ -323,7 +323,7 @@ static const struct gpio_mcux_config gpio_mcux_portc_config = {
|
|||
|
||||
static struct gpio_mcux_data gpio_mcux_portc_data;
|
||||
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portc, GPIO_C_LABEL,
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portc, DT_NXP_KINETIS_GPIO_GPIO_C_LABEL,
|
||||
gpio_mcux_portc_init,
|
||||
&gpio_mcux_portc_data, &gpio_mcux_portc_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
|
@ -331,11 +331,11 @@ DEVICE_AND_API_INIT(gpio_mcux_portc, GPIO_C_LABEL,
|
|||
|
||||
static int gpio_mcux_portc_init(struct device *dev)
|
||||
{
|
||||
#ifdef GPIO_C_IRQ
|
||||
IRQ_CONNECT(GPIO_C_IRQ, GPIO_C_IRQ_PRIORITY,
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_C_IRQ
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_GPIO_GPIO_C_IRQ, DT_NXP_KINETIS_GPIO_GPIO_C_IRQ_PRIORITY,
|
||||
gpio_mcux_port_isr, DEVICE_GET(gpio_mcux_portc), 0);
|
||||
|
||||
irq_enable(GPIO_C_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_GPIO_GPIO_C_IRQ);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
@ -348,9 +348,9 @@ static int gpio_mcux_portc_init(struct device *dev)
|
|||
static int gpio_mcux_portd_init(struct device *dev);
|
||||
|
||||
static const struct gpio_mcux_config gpio_mcux_portd_config = {
|
||||
.gpio_base = (GPIO_Type *) GPIO_D_BASE_ADDRESS,
|
||||
.gpio_base = (GPIO_Type *) DT_NXP_KINETIS_GPIO_GPIO_D_BASE_ADDRESS,
|
||||
.port_base = PORTD,
|
||||
#ifdef GPIO_D_IRQ
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_D_IRQ
|
||||
.flags = GPIO_INT,
|
||||
#else
|
||||
.flags = 0,
|
||||
|
@ -359,7 +359,7 @@ static const struct gpio_mcux_config gpio_mcux_portd_config = {
|
|||
|
||||
static struct gpio_mcux_data gpio_mcux_portd_data;
|
||||
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portd, GPIO_D_LABEL,
|
||||
DEVICE_AND_API_INIT(gpio_mcux_portd, DT_NXP_KINETIS_GPIO_GPIO_D_LABEL,
|
||||
gpio_mcux_portd_init,
|
||||
&gpio_mcux_portd_data, &gpio_mcux_portd_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
|
@ -367,11 +367,11 @@ DEVICE_AND_API_INIT(gpio_mcux_portd, GPIO_D_LABEL,
|
|||
|
||||
static int gpio_mcux_portd_init(struct device *dev)
|
||||
{
|
||||
#ifdef GPIO_D_IRQ
|
||||
IRQ_CONNECT(GPIO_D_IRQ, GPIO_D_IRQ_PRIORITY,
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_D_IRQ
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_GPIO_GPIO_D_IRQ, DT_NXP_KINETIS_GPIO_GPIO_D_IRQ_PRIORITY,
|
||||
gpio_mcux_port_isr, DEVICE_GET(gpio_mcux_portd), 0);
|
||||
|
||||
irq_enable(GPIO_D_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_GPIO_GPIO_D_IRQ);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
@ -384,9 +384,9 @@ static int gpio_mcux_portd_init(struct device *dev)
|
|||
static int gpio_mcux_porte_init(struct device *dev);
|
||||
|
||||
static const struct gpio_mcux_config gpio_mcux_porte_config = {
|
||||
.gpio_base = (GPIO_Type *) GPIO_E_BASE_ADDRESS,
|
||||
.gpio_base = (GPIO_Type *) DT_NXP_KINETIS_GPIO_GPIO_E_BASE_ADDRESS,
|
||||
.port_base = PORTE,
|
||||
#ifdef GPIO_E_IRQ
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_E_IRQ
|
||||
.flags = GPIO_INT,
|
||||
#else
|
||||
.flags = 0,
|
||||
|
@ -395,7 +395,7 @@ static const struct gpio_mcux_config gpio_mcux_porte_config = {
|
|||
|
||||
static struct gpio_mcux_data gpio_mcux_porte_data;
|
||||
|
||||
DEVICE_AND_API_INIT(gpio_mcux_porte, GPIO_E_LABEL,
|
||||
DEVICE_AND_API_INIT(gpio_mcux_porte, DT_NXP_KINETIS_GPIO_GPIO_E_LABEL,
|
||||
gpio_mcux_porte_init,
|
||||
&gpio_mcux_porte_data, &gpio_mcux_porte_config,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
|
@ -403,11 +403,11 @@ DEVICE_AND_API_INIT(gpio_mcux_porte, GPIO_E_LABEL,
|
|||
|
||||
static int gpio_mcux_porte_init(struct device *dev)
|
||||
{
|
||||
#ifdef GPIO_E_IRQ
|
||||
IRQ_CONNECT(GPIO_E_IRQ, GPIO_E_IRQ_PRIORITY,
|
||||
#ifdef DT_NXP_KINETIS_GPIO_GPIO_E_IRQ
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_GPIO_GPIO_E_IRQ, DT_NXP_KINETIS_GPIO_GPIO_E_IRQ_PRIORITY,
|
||||
gpio_mcux_port_isr, DEVICE_GET(gpio_mcux_porte), 0);
|
||||
|
||||
irq_enable(GPIO_E_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_GPIO_GPIO_E_IRQ);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue