diff --git a/boards/arm/particle_boron/board.c b/boards/arm/particle_boron/board.c index 505d66ed85..0213cd62fe 100644 --- a/boards/arm/particle_boron/board.c +++ b/boards/arm/particle_boron/board.c @@ -9,25 +9,22 @@ #include #include "board.h" +#define ANT_UFLn_GPIO_SPEC GPIO_DT_SPEC_GET(DT_NODELABEL(sky13351), vctl1_gpios) + static inline void external_antenna(bool on) { - const struct device *gpio_dev; + struct gpio_dt_spec ufl_gpio = ANT_UFLn_GPIO_SPEC; /* * On power-up the SKY13351 is left uncontrolled, so neither * PCB nor external antenna is selected. Select the PCB * antenna. */ - gpio_dev = device_get_binding(ANT_UFLn_GPIO_NAME); - if (!gpio_dev) { + if (!device_is_ready(ufl_gpio.port)) { return; } - gpio_pin_configure(gpio_dev, ANT_UFLn_GPIO_PIN, - ANT_UFLn_GPIO_FLAGS - | (on - ? GPIO_OUTPUT_ACTIVE - : GPIO_OUTPUT_INACTIVE)); + gpio_pin_configure_dt(&ufl_gpio, (on ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE)); } static int board_particle_boron_init(const struct device *dev) diff --git a/boards/arm/particle_boron/board.h b/boards/arm/particle_boron/board.h index c8b6882ba5..3c57614eb8 100644 --- a/boards/arm/particle_boron/board.h +++ b/boards/arm/particle_boron/board.h @@ -16,9 +16,4 @@ #define V_INT_DETECT_GPIO_PIN 2 #define V_INT_DETECT_GPIO_FLAGS GPIO_ACTIVE_HIGH -/* SKYWORKS SKY13351 antenna selection settings (only use vctl1) */ -#define ANT_UFLn_GPIO_NAME DT_GPIO_LABEL(DT_INST(0, skyworks_sky13351), vctl1_gpios) -#define ANT_UFLn_GPIO_FLAGS DT_GPIO_FLAGS(DT_INST(0, skyworks_sky13351), vctl1_gpios) -#define ANT_UFLn_GPIO_PIN DT_GPIO_PIN(DT_INST(0, skyworks_sky13351), vctl1_gpios) - #endif /* __INC_BOARD_H */ diff --git a/boards/arm/particle_boron/particle_boron.dts b/boards/arm/particle_boron/particle_boron.dts index fbe2e54a17..d1535f9da6 100644 --- a/boards/arm/particle_boron/particle_boron.dts +++ b/boards/arm/particle_boron/particle_boron.dts @@ -14,7 +14,7 @@ model = "Particle Boron"; compatible = "particle,boron", "particle,feather"; - sky13351 { + sky13351: sky13351 { compatible = "skyworks,sky13351"; vctl1-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; /* on Boron VCTL2 is inverted VCTL1 signal via SN74LVC1G04