drivers: sensor: fxas21002: Update driver to use gpio_dt_spec

Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
This commit is contained in:
Benjamin Björnsson 2022-06-19 08:29:21 +02:00 committed by Carles Cufí
commit e06359f616
3 changed files with 14 additions and 29 deletions

View file

@ -284,13 +284,9 @@ static const struct fxas21002_config fxas21002_config = {
.dr = CONFIG_FXAS21002_DR,
#ifdef CONFIG_FXAS21002_TRIGGER
#ifdef CONFIG_FXAS21002_DRDY_INT1
.gpio_name = DT_INST_GPIO_LABEL(0, int1_gpios),
.gpio_pin = DT_INST_GPIO_PIN(0, int1_gpios),
.gpio_flags = DT_INST_GPIO_FLAGS(0, int1_gpios),
.int_gpio = GPIO_DT_SPEC_INST_GET(0, int1_gpios),
#else
.gpio_name = DT_INST_GPIO_LABEL(0, int2_gpios),
.gpio_pin = DT_INST_GPIO_PIN(0, int2_gpios),
.gpio_flags = DT_INST_GPIO_FLAGS(0, int2_gpios),
.int_gpio = GPIO_DT_SPEC_INST_GET(0, int2_gpios),
#endif
#endif
};