drivers: gpio: cc32xx: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
4192254ef2
commit
81ac58697e
1 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,8 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define DT_DRV_COMPAT ti_cc32xx_gpio
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <device.h>
|
#include <device.h>
|
||||||
|
@ -277,7 +279,7 @@ static const struct gpio_driver_api api_funcs = {
|
||||||
#ifdef CONFIG_GPIO_CC32XX_A0
|
#ifdef CONFIG_GPIO_CC32XX_A0
|
||||||
static const struct gpio_cc32xx_config gpio_cc32xx_a0_config = {
|
static const struct gpio_cc32xx_config gpio_cc32xx_a0_config = {
|
||||||
.common = {
|
.common = {
|
||||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_0_TI_CC32XX_GPIO_NGPIOS),
|
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(0, ngpios)),
|
||||||
},
|
},
|
||||||
.port_base = DT_GPIO_CC32XX_A0_BASE_ADDRESS,
|
.port_base = DT_GPIO_CC32XX_A0_BASE_ADDRESS,
|
||||||
.irq_num = DT_GPIO_CC32XX_A0_IRQ+16,
|
.irq_num = DT_GPIO_CC32XX_A0_IRQ+16,
|
||||||
|
@ -311,7 +313,7 @@ DEVICE_AND_API_INIT(gpio_cc32xx_a0, DT_GPIO_CC32XX_A0_NAME,
|
||||||
#ifdef CONFIG_GPIO_CC32XX_A1
|
#ifdef CONFIG_GPIO_CC32XX_A1
|
||||||
static const struct gpio_cc32xx_config gpio_cc32xx_a1_config = {
|
static const struct gpio_cc32xx_config gpio_cc32xx_a1_config = {
|
||||||
.common = {
|
.common = {
|
||||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_1_TI_CC32XX_GPIO_NGPIOS),
|
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(1, ngpios)),
|
||||||
},
|
},
|
||||||
.port_base = DT_GPIO_CC32XX_A1_BASE_ADDRESS,
|
.port_base = DT_GPIO_CC32XX_A1_BASE_ADDRESS,
|
||||||
.irq_num = DT_GPIO_CC32XX_A1_IRQ+16,
|
.irq_num = DT_GPIO_CC32XX_A1_IRQ+16,
|
||||||
|
@ -345,7 +347,7 @@ DEVICE_AND_API_INIT(gpio_cc32xx_a1, DT_GPIO_CC32XX_A1_NAME,
|
||||||
#ifdef CONFIG_GPIO_CC32XX_A2
|
#ifdef CONFIG_GPIO_CC32XX_A2
|
||||||
static const struct gpio_cc32xx_config gpio_cc32xx_a2_config = {
|
static const struct gpio_cc32xx_config gpio_cc32xx_a2_config = {
|
||||||
.common = {
|
.common = {
|
||||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_2_TI_CC32XX_GPIO_NGPIOS),
|
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(2, ngpios)),
|
||||||
},
|
},
|
||||||
.port_base = DT_GPIO_CC32XX_A2_BASE_ADDRESS,
|
.port_base = DT_GPIO_CC32XX_A2_BASE_ADDRESS,
|
||||||
.irq_num = DT_GPIO_CC32XX_A2_IRQ+16,
|
.irq_num = DT_GPIO_CC32XX_A2_IRQ+16,
|
||||||
|
@ -379,7 +381,7 @@ DEVICE_AND_API_INIT(gpio_cc32xx_a2, DT_GPIO_CC32XX_A2_NAME,
|
||||||
#ifdef CONFIG_GPIO_CC32XX_A3
|
#ifdef CONFIG_GPIO_CC32XX_A3
|
||||||
static const struct gpio_cc32xx_config gpio_cc32xx_a3_config = {
|
static const struct gpio_cc32xx_config gpio_cc32xx_a3_config = {
|
||||||
.common = {
|
.common = {
|
||||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_3_TI_CC32XX_GPIO_NGPIOS),
|
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(3, ngpios)),
|
||||||
},
|
},
|
||||||
.port_base = DT_GPIO_CC32XX_A3_BASE_ADDRESS,
|
.port_base = DT_GPIO_CC32XX_A3_BASE_ADDRESS,
|
||||||
.irq_num = DT_GPIO_CC32XX_A3_IRQ+16,
|
.irq_num = DT_GPIO_CC32XX_A3_IRQ+16,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue