drivers: gpio: Convert drivers to new DT device macros
Convert gpio drivers to use new DT variants of the DEVICE APIs. DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE DEVICE_GET -> DEVICE_DT_GET DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE etc.. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
4cfd2a1943
commit
569155701c
27 changed files with 136 additions and 116 deletions
|
@ -558,7 +558,7 @@ static int gpio_stm32_init(const struct device *device)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define GPIO_DEVICE_INIT(__name, __suffix, __base_addr, __port, __cenr, __bus) \
|
||||
#define GPIO_DEVICE_INIT(__node, __suffix, __base_addr, __port, __cenr, __bus) \
|
||||
static const struct gpio_stm32_config gpio_stm32_cfg_## __suffix = { \
|
||||
.common = { \
|
||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_NGPIOS(16U), \
|
||||
|
@ -568,9 +568,9 @@ static int gpio_stm32_init(const struct device *device)
|
|||
.pclken = { .bus = __bus, .enr = __cenr } \
|
||||
}; \
|
||||
static struct gpio_stm32_data gpio_stm32_data_## __suffix; \
|
||||
DEVICE_AND_API_INIT(gpio_stm32_## __suffix, \
|
||||
__name, \
|
||||
DEVICE_DT_DEFINE(__node, \
|
||||
gpio_stm32_init, \
|
||||
device_pm_control_nop, \
|
||||
&gpio_stm32_data_## __suffix, \
|
||||
&gpio_stm32_cfg_## __suffix, \
|
||||
POST_KERNEL, \
|
||||
|
@ -578,7 +578,7 @@ static int gpio_stm32_init(const struct device *device)
|
|||
&gpio_stm32_driver)
|
||||
|
||||
#define GPIO_DEVICE_INIT_STM32(__suffix, __SUFFIX) \
|
||||
GPIO_DEVICE_INIT(DT_LABEL(DT_NODELABEL(gpio##__suffix)), \
|
||||
GPIO_DEVICE_INIT(DT_NODELABEL(gpio##__suffix), \
|
||||
__suffix, \
|
||||
DT_REG_ADDR(DT_NODELABEL(gpio##__suffix)), \
|
||||
STM32_PORT##__SUFFIX, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue