[PATCH v4 4/9] pinctrl: airoha: add pin controller and gpio driver for AN7581 SoC
David Lechner
dlechner at baylibre.com
Wed May 6 23:44:28 CEST 2026
On 5/4/26 8:03 AM, Mikhail Kshevetskiy wrote:
> This patch adds U-Boot pin controller and gpio driver for Airoha AN7581 SoC.
>
> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
> ---
> drivers/pinctrl/airoha/Kconfig | 5 +
> drivers/pinctrl/airoha/Makefile | 2 +
> drivers/pinctrl/airoha/pinctrl-an7581.c | 1074 +++++++++++++++++++++++
> 3 files changed, 1081 insertions(+)
> create mode 100644 drivers/pinctrl/airoha/pinctrl-an7581.c
>
> diff --git a/drivers/pinctrl/airoha/Kconfig b/drivers/pinctrl/airoha/Kconfig
> index eb87afbb374..986d23c2e3d 100644
> --- a/drivers/pinctrl/airoha/Kconfig
> +++ b/drivers/pinctrl/airoha/Kconfig
> @@ -9,3 +9,8 @@ config PINCTRL_AIROHA
> select REGMAP
> select SYSCON
> bool
> +
> +config PINCTRL_AIROHA_AN7581
> + tristate "AN7581 pin controller and gpio driver"
> + depends on TARGET_AN7581
> + select PINCTRL_AIROHA
> diff --git a/drivers/pinctrl/airoha/Makefile b/drivers/pinctrl/airoha/Makefile
> index a25b744dd7a..909bd9a04d9 100644
> --- a/drivers/pinctrl/airoha/Makefile
> +++ b/drivers/pinctrl/airoha/Makefile
> @@ -1,3 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0
>
> obj-$(CONFIG_PINCTRL_AIROHA) += pinctrl-airoha.o
> +
> +obj-$(CONFIG_PINCTRL_AIROHA_AN7581) += pinctrl-an7581.o
> diff --git a/drivers/pinctrl/airoha/pinctrl-an7581.c b/drivers/pinctrl/airoha/pinctrl-an7581.c
> new file mode 100644
> index 00000000000..2505818251c
> --- /dev/null
> +++ b/drivers/pinctrl/airoha/pinctrl-an7581.c
> @@ -0,0 +1,1074 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Author: Lorenzo Bianconi <lorenzo at kernel.org>
> + * Author: Benjamin Larsson <benjamin.larsson at genexis.eu>
> + * Author: Markus Gothe <markus.gothe at genexis.eu>
> + */
> +#include "airoha-common.h"
> +
The en7581_ prefix doesn't match the file name or Kconfig. Did you
mean to use an7581_ everywhere?
> +static const int en7581_pon_pins[] = { 49, 50, 51, 52, 53, 54 };
> +static const int en7581_pon_tod_1pps_pins[] = { 46 };
> +static const int en7581_gsw_tod_1pps_pins[] = { 46 };
> +static const int en7581_sipo_pins[] = { 16, 17 };
> +static const int en7581_sipo_rclk_pins[] = { 16, 17, 43 };
> +static const int en7581_mdio_pins[] = { 14, 15 };
> +static const int en7581_uart2_pins[] = { 48, 55 };
> +static const int en7581_uart2_cts_rts_pins[] = { 46, 47 };
> +static const int en7581_hsuart_pins[] = { 28, 29 };
> +static const int en7581_hsuart_cts_rts_pins[] = { 26, 27 };
> +static const int en7581_uart4_pins[] = { 38, 39 };
> +static const int en7581_uart5_pins[] = { 18, 19 };
> +static const int en7581_i2c0_pins[] = { 2, 3 };
> +static const int en7581_i2c1_pins[] = { 14, 15 };
> +static const int en7581_jtag_udi_pins[] = { 16, 17, 18, 19, 20 };
> +static const int en7581_jtag_dfd_pins[] = { 16, 17, 18, 19, 20 };
> +static const int en7581_i2s_pins[] = { 26, 27, 28, 29 };
> +static const int en7581_pcm1_pins[] = { 22, 23, 24, 25 };
> +static const int en7581_pcm2_pins[] = { 18, 19, 20, 21 };
> +static const int en7581_spi_quad_pins[] = { 32, 33 };
> +static const int en7581_spi_pins[] = { 4, 5, 6, 7 };
> +static const int en7581_spi_cs1_pins[] = { 34 };
> +static const int en7581_pcm_spi_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25 };
> +static const int en7581_pcm_spi_int_pins[] = { 14 };
> +static const int en7581_pcm_spi_rst_pins[] = { 15 };
> +static const int en7581_pcm_spi_cs1_pins[] = { 43 };
> +static const int en7581_pcm_spi_cs2_pins[] = { 40 };
> +static const int en7581_pcm_spi_cs2_p128_pins[] = { 40 };
> +static const int en7581_pcm_spi_cs2_p156_pins[] = { 40 };
> +static const int en7581_pcm_spi_cs3_pins[] = { 41 };
> +static const int en7581_pcm_spi_cs4_pins[] = { 42 };
> +static const int en7581_emmc_pins[] = {
> + 4, 5, 6, 30, 31, 32, 33, 34, 35, 36, 37
> +};
> +static const int en7581_pnand_pins[] = {
> + 4, 5, 6, 7, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42
> +};
> +static const int en7581_gpio0_pins[] = { 13 };
> +static const int en7581_gpio1_pins[] = { 14 };
> +static const int en7581_gpio2_pins[] = { 15 };
> +static const int en7581_gpio3_pins[] = { 16 };
> +static const int en7581_gpio4_pins[] = { 17 };
> +static const int en7581_gpio5_pins[] = { 18 };
> +static const int en7581_gpio6_pins[] = { 19 };
> +static const int en7581_gpio7_pins[] = { 20 };
> +static const int en7581_gpio8_pins[] = { 21 };
> +static const int en7581_gpio9_pins[] = { 22 };
> +static const int en7581_gpio10_pins[] = { 23 };
> +static const int en7581_gpio11_pins[] = { 24 };
> +static const int en7581_gpio12_pins[] = { 25 };
> +static const int en7581_gpio13_pins[] = { 26 };
> +static const int en7581_gpio14_pins[] = { 27 };
> +static const int en7581_gpio15_pins[] = { 28 };
> +static const int en7581_gpio16_pins[] = { 29 };
> +static const int en7581_gpio17_pins[] = { 30 };
> +static const int en7581_gpio18_pins[] = { 31 };
> +static const int en7581_gpio19_pins[] = { 32 };
> +static const int en7581_gpio20_pins[] = { 33 };
> +static const int en7581_gpio21_pins[] = { 34 };
> +static const int en7581_gpio22_pins[] = { 35 };
> +static const int en7581_gpio23_pins[] = { 36 };
> +static const int en7581_gpio24_pins[] = { 37 };
> +static const int en7581_gpio25_pins[] = { 38 };
> +static const int en7581_gpio26_pins[] = { 39 };
> +static const int en7581_gpio27_pins[] = { 40 };
> +static const int en7581_gpio28_pins[] = { 41 };
> +static const int en7581_gpio29_pins[] = { 42 };
> +static const int en7581_gpio30_pins[] = { 43 };
> +static const int en7581_gpio31_pins[] = { 44 };
No gpio32?
> +static const int en7581_gpio33_pins[] = { 46 };
> +static const int en7581_gpio34_pins[] = { 47 };
> +static const int en7581_gpio35_pins[] = { 48 };
> +static const int en7581_gpio36_pins[] = { 49 };
> +static const int en7581_gpio37_pins[] = { 50 };
> +static const int en7581_gpio38_pins[] = { 51 };
> +static const int en7581_gpio39_pins[] = { 52 };
> +static const int en7581_gpio40_pins[] = { 53 };
> +static const int en7581_gpio41_pins[] = { 54 };
> +static const int en7581_gpio42_pins[] = { 55 };
> +static const int en7581_gpio43_pins[] = { 56 };
> +static const int en7581_gpio44_pins[] = { 57 };
> +static const int en7581_gpio45_pins[] = { 58 };
> +static const int en7581_gpio46_pins[] = { 59 };
> +static const int en7581_pcie_reset0_pins[] = { 61 };
> +static const int en7581_pcie_reset1_pins[] = { 62 };
> +static const int en7581_pcie_reset2_pins[] = { 63 };
> +
More information about the U-Boot
mailing list