boards: particle_boron: Use GPIO_DT_SPEC for gpio handling

Convert gpio handling to use GPIO_DT_SPEC as this removes the use
of DT_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-01 18:17:41 -05:00 committed by Carles Cufí
parent 0f2ec0222c
commit 9c3ab19a93
3 changed files with 6 additions and 14 deletions

View file

@ -9,25 +9,22 @@
#include <zephyr/drivers/gpio.h>
#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)

View file

@ -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 */

View file

@ -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