drivers: gpio: use new ngpios macros for cases embedded in macros

Fixup cases of GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(n, ngpios))
to use GPIO_PORT_PIN_MASK_FROM_DT_INST(n) instead.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-04 09:45:09 -05:00 committed by Kumar Gala
parent 9f7cab0623
commit 4e553f31fa
6 changed files with 6 additions and 13 deletions

View file

@ -269,15 +269,12 @@ static int gpio_cmsdk_ahb_init(struct device *dev)
return 0;
}
#define PORT_PIN_MASK(n) \
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(n, ngpios))
#define CMSDK_AHB_GPIO_DEVICE(n) \
static void gpio_cmsdk_port_##n##_config_func(struct device *dev); \
\
static const struct gpio_cmsdk_ahb_cfg gpio_cmsdk_port_##n##_config = { \
.common = { \
.port_pin_mask = PORT_PIN_MASK(n), \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \
}, \
.port = ((volatile struct gpio_cmsdk_ahb *)DT_INST_REG_ADDR(n)),\
.gpio_config_func = gpio_cmsdk_port_##n##_config_func, \

View file

@ -363,7 +363,7 @@ static struct gpio_esp32_data gpio_1_data = { /* 32..39 */
#define GPIO_DEVICE_INIT(_id) \
static struct gpio_driver_config gpio_##_id##_cfg = { \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(_id, ngpios)),\
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(_id), \
}; \
DEVICE_AND_API_INIT(gpio_esp32_##_id, \
DT_INST_LABEL(_id), \

View file

@ -243,7 +243,7 @@ static const struct gpio_driver_api imx_gpio_driver_api = {
static const struct imx_gpio_config imx_gpio_##n##_config = { \
.common = { \
.port_pin_mask = \
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(n, ngpios)), \
GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \
}, \
.base = (GPIO_Type *)DT_INST_REG_ADDR(n), \
}; \

View file

@ -170,8 +170,7 @@ BUILD_ASSERT(CONFIG_GPIO_LMP90XXX_INIT_PRIORITY >
static const struct gpio_lmp90xxx_config gpio_lmp90xxx_##id##_cfg = {\
.common = { \
.port_pin_mask = \
GPIO_PORT_PIN_MASK_FROM_NGPIOS( \
DT_INST_PROP(id, ngpios)) \
GPIO_PORT_PIN_MASK_FROM_DT_INST(id) \
}, \
.parent_dev_name = DT_INST_BUS_LABEL(id), \
}; \

View file

@ -491,7 +491,7 @@ static int gpio_pca95xx_init(struct device *dev)
#define GPIO_PCA95XX_DEVICE_INSTANCE(inst) \
static const struct gpio_pca95xx_config gpio_pca95xx_##inst##_cfg = { \
.common = { \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(inst, ngpios)), \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst), \
}, \
.i2c_master_dev_name = DT_INST_BUS_LABEL(inst), \
.i2c_slave_addr = DT_INST_REG_ADDR(inst), \

View file

@ -255,9 +255,6 @@ static const struct gpio_driver_api gpio_stellaris_driver_api = {
.disable_callback = gpio_stellaris_disable_callback,
};
#define PORT_PIN_MASK(n) \
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(n, ngpios))
#define STELLARIS_GPIO_DEVICE(n) \
static void port_## n ##_stellaris_config_func(struct device *dev); \
\
@ -265,7 +262,7 @@ static const struct gpio_driver_api gpio_stellaris_driver_api = {
\
static const struct gpio_stellaris_config gpio_stellaris_port_## n ##_config = {\
.common = { \
.port_pin_mask = PORT_PIN_MASK(n), \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \
}, \
.base = DT_INST_REG_ADDR(n), \
.port_map = BIT_MASK(DT_INST_PROP(n, ngpios)), \