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:
parent
9f7cab0623
commit
4e553f31fa
6 changed files with 6 additions and 13 deletions
|
@ -269,15 +269,12 @@ static int gpio_cmsdk_ahb_init(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PORT_PIN_MASK(n) \
|
|
||||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(n, ngpios))
|
|
||||||
|
|
||||||
#define CMSDK_AHB_GPIO_DEVICE(n) \
|
#define CMSDK_AHB_GPIO_DEVICE(n) \
|
||||||
static void gpio_cmsdk_port_##n##_config_func(struct device *dev); \
|
static void gpio_cmsdk_port_##n##_config_func(struct device *dev); \
|
||||||
\
|
\
|
||||||
static const struct gpio_cmsdk_ahb_cfg gpio_cmsdk_port_##n##_config = { \
|
static const struct gpio_cmsdk_ahb_cfg gpio_cmsdk_port_##n##_config = { \
|
||||||
.common = { \
|
.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)),\
|
.port = ((volatile struct gpio_cmsdk_ahb *)DT_INST_REG_ADDR(n)),\
|
||||||
.gpio_config_func = gpio_cmsdk_port_##n##_config_func, \
|
.gpio_config_func = gpio_cmsdk_port_##n##_config_func, \
|
||||||
|
|
|
@ -363,7 +363,7 @@ static struct gpio_esp32_data gpio_1_data = { /* 32..39 */
|
||||||
|
|
||||||
#define GPIO_DEVICE_INIT(_id) \
|
#define GPIO_DEVICE_INIT(_id) \
|
||||||
static struct gpio_driver_config gpio_##_id##_cfg = { \
|
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, \
|
DEVICE_AND_API_INIT(gpio_esp32_##_id, \
|
||||||
DT_INST_LABEL(_id), \
|
DT_INST_LABEL(_id), \
|
||||||
|
|
|
@ -243,7 +243,7 @@ static const struct gpio_driver_api imx_gpio_driver_api = {
|
||||||
static const struct imx_gpio_config imx_gpio_##n##_config = { \
|
static const struct imx_gpio_config imx_gpio_##n##_config = { \
|
||||||
.common = { \
|
.common = { \
|
||||||
.port_pin_mask = \
|
.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), \
|
.base = (GPIO_Type *)DT_INST_REG_ADDR(n), \
|
||||||
}; \
|
}; \
|
||||||
|
|
|
@ -170,8 +170,7 @@ BUILD_ASSERT(CONFIG_GPIO_LMP90XXX_INIT_PRIORITY >
|
||||||
static const struct gpio_lmp90xxx_config gpio_lmp90xxx_##id##_cfg = {\
|
static const struct gpio_lmp90xxx_config gpio_lmp90xxx_##id##_cfg = {\
|
||||||
.common = { \
|
.common = { \
|
||||||
.port_pin_mask = \
|
.port_pin_mask = \
|
||||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS( \
|
GPIO_PORT_PIN_MASK_FROM_DT_INST(id) \
|
||||||
DT_INST_PROP(id, ngpios)) \
|
|
||||||
}, \
|
}, \
|
||||||
.parent_dev_name = DT_INST_BUS_LABEL(id), \
|
.parent_dev_name = DT_INST_BUS_LABEL(id), \
|
||||||
}; \
|
}; \
|
||||||
|
|
|
@ -491,7 +491,7 @@ static int gpio_pca95xx_init(struct device *dev)
|
||||||
#define GPIO_PCA95XX_DEVICE_INSTANCE(inst) \
|
#define GPIO_PCA95XX_DEVICE_INSTANCE(inst) \
|
||||||
static const struct gpio_pca95xx_config gpio_pca95xx_##inst##_cfg = { \
|
static const struct gpio_pca95xx_config gpio_pca95xx_##inst##_cfg = { \
|
||||||
.common = { \
|
.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_master_dev_name = DT_INST_BUS_LABEL(inst), \
|
||||||
.i2c_slave_addr = DT_INST_REG_ADDR(inst), \
|
.i2c_slave_addr = DT_INST_REG_ADDR(inst), \
|
||||||
|
|
|
@ -255,9 +255,6 @@ static const struct gpio_driver_api gpio_stellaris_driver_api = {
|
||||||
.disable_callback = gpio_stellaris_disable_callback,
|
.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) \
|
#define STELLARIS_GPIO_DEVICE(n) \
|
||||||
static void port_## n ##_stellaris_config_func(struct device *dev); \
|
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 = {\
|
static const struct gpio_stellaris_config gpio_stellaris_port_## n ##_config = {\
|
||||||
.common = { \
|
.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), \
|
.base = DT_INST_REG_ADDR(n), \
|
||||||
.port_map = BIT_MASK(DT_INST_PROP(n, ngpios)), \
|
.port_map = BIT_MASK(DT_INST_PROP(n, ngpios)), \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue