drivers: all: mcux: remove conditional support for pinctrl

The MCUX platform always uses pinctrl, there's no need to keep extra
macrology around pinctrl. Also updated driver's Kconfig options to
`select PINCTRL` (note that some already did).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-04-19 16:41:53 +02:00 committed by Carles Cufí
commit 989d103d53
30 changed files with 47 additions and 291 deletions

View file

@ -14,9 +14,7 @@
#include <fsl_common.h>
#include <fsl_gpio.h>
#ifdef CONFIG_PINCTRL
#include <zephyr/drivers/pinctrl.h>
#endif
#include <zephyr/drivers/gpio/gpio_utils.h>
@ -29,12 +27,10 @@ struct mcux_igpio_config {
/* gpio_driver_config needs to be first */
struct gpio_driver_config common;
GPIO_Type *base;
#ifdef CONFIG_PINCTRL
const struct pinctrl_soc_pinmux *pin_muxes;
const struct gpio_pin_gaps *pin_gaps;
uint8_t mux_count;
uint8_t gap_count;
#endif
};
struct mcux_igpio_data {
@ -50,7 +46,6 @@ static int mcux_igpio_configure(const struct device *dev,
const struct mcux_igpio_config *config = dev->config;
GPIO_Type *base = config->base;
#ifdef CONFIG_PINCTRL
struct pinctrl_soc_pin pin_cfg;
int cfg_idx = pin, i;
@ -195,16 +190,6 @@ static int mcux_igpio_configure(const struct device *dev,
/* cfg register will be set by pinctrl_configure_pins */
pin_cfg.pin_ctrl_flags = reg;
pinctrl_configure_pins(&pin_cfg, 1, PINCTRL_REG_NONE);
#else
/* Without pinctrl, no support for GPIO flags */
if ((flags & GPIO_SINGLE_ENDED) != 0) {
return -ENOTSUP;
}
if (((flags & GPIO_PULL_UP) != 0) || ((flags & GPIO_PULL_DOWN) != 0)) {
return -ENOTSUP;
}
#endif /* CONFIG_PINCTRL */
if (((flags & GPIO_INPUT) != 0) && ((flags & GPIO_OUTPUT) != 0)) {
return -ENOTSUP;
@ -366,7 +351,6 @@ static const struct gpio_driver_api mcux_igpio_driver_api = {
};
#ifdef CONFIG_PINCTRL
/* These macros will declare an array of pinctrl_soc_pinmux types */
#define PINMUX_INIT(node, prop, idx) MCUX_IMX_PINMUX(DT_PROP_BY_IDX(node, prop, idx)),
#define MCUX_IGPIO_PIN_DECLARE(n) \
@ -380,10 +364,6 @@ static const struct gpio_driver_api mcux_igpio_driver_api = {
.pin_gaps = (const struct gpio_pin_gaps *)mcux_igpio_pin_gaps_##n, \
.mux_count = DT_PROP_LEN(DT_DRV_INST(n), pinmux), \
.gap_count = (ARRAY_SIZE(mcux_igpio_pin_gaps_##n) / 2)
#else
#define MCUX_IGPIO_PIN_DECLARE(n)
#define MCUX_IGPIO_PIN_INIT(n)
#endif /* CONFIG_PINCTRL */
#define MCUX_IGPIO_IRQ_INIT(n, i) \
do { \