Commit graph zephyr/drivers/pinctrl
Author SHA1 Message Date
Lucas van der Ploeg
b60d2b0cb9 drivers: pinctrl: nrf: add VPR VIO pin function
Add a generic NRF_FUN_VPR_VIO pinctrl function so that a pin can be
assigned to a VPR core and driven directly through its VIO interface.

Where the local core can select pin routing (NRF_GPIO_HAS_SEL) the pin is
routed to the VPR here; otherwise routing is controlled by the secure
domain via UICR and no action is needed at configure time.

Signed-off-by: Lucas van der Ploeg <lucas.vanderploeg@nordicsemi.no>
2026-10-28 22:31:48 -04:00
Alan Yang
7e8c59e774 drivers: pinctrl: npcm: add pin controller driver
Add the NPCM pin controller driver. It selects a pin's function by
writing the SCFG bits listed in devicetree, and sets the pull and
voltage level when requested.

Also add the NPCM4 pin function and pin group tables.

Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2026-10-28 20:16:12 -04:00
Pisit Sawangvonganan
5031f957cd soc: nuvoton: fix typo in npcx pinctrl offset field
Rename the misspelled `offest` bit-field in `pinctrl_soc.h` together with
its user in the NPCX pinctrl driver, and fix the other spelling errors in
the same files. Both files change in one commit so the tree builds at
every commit.

Assisted-by: Claude:claude-sonnet-5-5 codespell
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-10-13 09:37:15 +02:00
Jonathan Elliot Peace
9d4d87dd88 drivers: pinctrl: bcm2711: map registers once
device_map() hands out a new virtual mapping on every call and nothing
unmaps it, so reconfiguring pins at runtime leaks virtual address space
until k_mem_map() fails and the kernel panics.

Signed-off-by: Jonathan Elliot Peace <jep@alphabetiq.com>
2026-10-02 17:25:16 -05:00
Benjamin Cabé
3777ab9126 drivers: pinctrl: emsdp: Fix UART_B mux selection for PMOD B
The PMOD_B UARTB case OR-ed PM_A_CFG0_UART1b, which shifts into the
PMOD A mux field, so PMOD B was left unprogrammed and PMOD A's
setting was corrupted. Use PM_B_CFG0_UART2b, the otherwise unused
constant defined for this case.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-10-02 07:56:43 -05:00
Quy Tran
4d4bf6fbff drivers: pinctrl: Add pinctrl driver for RX74x series
Add support for pinctrl driver on RX74x MCUs

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2026-09-28 19:40:02 -04:00
Lucien Zhao
89989182c7 drivers: pinctrl: imx: support the RT266x combined PIO register
RT266x uses a single combined IOMUXC PIO register per pad, with the
mux-mode and pad configuration in the same register. Add an
SOC_SERIES_IMXRT266X path that combines both into one write so the pad
config does not clobber the mux-mode, and translates the driver-private
input-enable flag to the hardware IBENA bit.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-09-26 00:51:55 +02:00
Aary Patil
f370f61e67 drivers: pinctrl: mediatek: add MT8188 pin controller
Add the pin controller for the MT8188, with the full pin table and the
devicetree macros that turn a pinmux property into a pin and function pair.

The register window is mapped with device_map() at PRE_KERNEL_1 priority 0
rather than reached through its physical address.  There is no struct
device to hang DEVICE_MMIO off, because pinctrl_configure_pins() is called
from other drivers' init before any pin controller device would exist, but
the window still has to be mapped rather than assumed; a static
mmu_regions.c entry would do the same job less portably and only on arm64.

The cluster directory goes on the include path here because the pinctrl
framework includes pinctrl_soc.h, which this commit adds.

Co-authored-by: Felix Freimann <felix.freimann@mediatek.com>
Signed-off-by: Aary Patil <aary.patil@mediatek.com>
2026-09-26 00:51:04 +02:00
Mathieu Choplain
67ba68db25 drivers: {gpio,pinctrl}: stm32: enable GPIO port manager explicitly
Create a dedicated Kconfig option which controls compilation of the
STM32 GPIO port manager module, and select this option explicitly in
the Kconfig for the STM32 GPIO and PINCTRL drivers which require this
module.

This replaces the previous approach where the SoC common CMakeLists
would add the GPIO port manage module to the build automatically if
either of the STM32 GPIO or PINCTRL module was enabled; an explicit
select at Kconfig level makes the dependency more visible.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +02:00
Zhaoxiang Jin
09f4ffce74 drivers: pinctrl: nxp_port: keep the pin-mux clock across a power loss
The PORT pin-mux registers only answer while the block is clocked, and a
power domain that goes down takes the clock gate with it: it comes back
closed. Every driver that re-applies its pinctrl state on the way back up
writes through those registers, so it faults on an unclocked block, and a
board whose pads are not restored has no console to report it with.

Give the driver a PM handler that re-opens the gate from TURN_ON. The pad
configuration itself is state and not activity -- it has to hold for as
long as the block is powered, whatever the rest of the SoC is doing -- so
SUSPEND, RESUME and TURN_OFF have nothing to do.

Init keeps enabling the clock itself rather than leaving it to TURN_ON.
Drivers apply their pin state from their own initialisation and none of
them claims this device first, so the gate has to be open before any of
them runs, while a device sitting in a power domain is only handed TURN_ON
once something resumes the domain -- which for a domain that only tracks
SoC power states may be much later, or never.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-09-24 09:56:04 +02:00
Zhaoxiang Jin
8b6e33249c drivers: pinctrl: nxp_port: lift the clock enable out of init
The block's clock gate is opened from one place, initialisation, and is
about to be opened from a second. Lift it into a function of its own so
both callers share the error handling instead of repeating it.

No functional change.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-09-24 09:56:04 +02:00
Jianping Wu
497035c7bd soc: add soc support for gd32c2x1
Add soc support for gd32c2x1.

Signed-off-by: Jianping Wu <jianping.wu@gigadevice.com>
2026-09-23 10:30:12 +01:00
Hariharan Arumugam
612afeafbe drivers: pinctrl: microchip: update pinctrl driver for PIC32CK SG family
Updated pinctrl driver to support the PIC32CK SG family devices

Signed-off-by: Hariharan Arumugam <hariharan.arumugam@microchip.com>
2026-09-18 11:13:24 +01:00
Aman Lachhiramka
b633194cc8 drivers: pinctrl: mspm0: support AM13 IOMUX PINCM base offset
AM13 IOMUX has PINCM[0] at base+0 (no RESERVED0 word), unlike MSPM0/
MSPM33 where PINCM[0] is at base+4. Select the correct offset at
compile time using CONFIG_SOC_SERIES_AM13E.

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
2026-09-17 12:12:47 +01:00
Alexpandi Muniyandi
ee6a67fdd3 drivers: pinctrl: infineon: Extend GPIO port support
Extend the gpio_ports[] table from prt21 up to prt30 for the wider
port range on newer CAT1C SoCs, and generate it with LISTIFY()
instead of a copy-pasted GPIO_PORT_OR_NULL() list. Absent ports
still resolve to NULL, so behaviour is unchanged.

Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
2026-09-11 17:19:46 +02:00
Aman Lachhiramka
eb025d2e19 drivers: pinctrl: mspm0: convert to native register writes
The MSPM0 pinctrl driver called DL_GPIO_initPeripheralFunction() and
DL_GPIO_initPeripheralAnalogFunction() from TI DriverLib to configure
IOMUX PINCM registers. These are single-register writes that can be
expressed directly using sys_write32(), removing the dependency on the
vendor HAL.

The IOMUX base address is obtained from the pinctrl node reg property
via DT_INST_REG_ADDR(0), which now returns the correct hardware address
after the DTS reorganization.

The pinctrl_soc_pin_t iomux field already encodes configuration bits at
positions that match the PINCM hardware register layout, so values can
be written directly without translation.

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
2026-09-11 05:22:53 -04:00
Benjamin Cabé
752876658c drivers: pinctrl: rp1: move register defs into the driver source
The RP1 register field macros were only used by the pinctrl driver, so
move them into pinctrl_rp1.c and drop the public header (the RP1 GPIO
driver already defines the few fields it needs itself).

Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-07 21:08:18 -04:00
Sylvio Alves
ecc6410f1f soc: espressif: add shared gpio pad to port helper
The gpio and pinctrl drivers each open-coded the split of an
absolute pad number into a Zephyr gpio port and pin index. Move
it into one header in the common soc folder and use it from
both, so the next pad user cannot get the split wrong. The
pinctrl copy was a no-op because its pad numbers are already
absolute, so it is dropped.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-04 13:42:43 -04:00
Elie Carrot
9709a1ae7d drivers: comparator: add WCH CH5xx comparator driver support
Add support for the comparator peripheral found in WCH CH5xx SoCs.
This commit also extends the comparator API with a child API to allow
dynamic configuration of the negative reference voltage. This feature
is intended to enable software-based ADC implementations using the
comparator peripheral.

Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
2026-09-04 06:19:22 -04:00
Daniel Schultz
5fb733ea63 drivers: pinctrl: aesc: Read maximum pin count
The pinmux controller provides the total number of muxable pins.
Read this number during initialization and check against it
during each pin configuration.

Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
2026-09-02 15:28:54 +02:00
Sylvio Alves
dde217c098 drivers: espressif: enable esp32c61 in shared drivers
Add the C61 conditionals to the shared espressif drivers:
gpio, uart, usb-serial, spi, counter, entropy, hwinfo,
pinctrl, watchdog and the timer and clock Kconfig, mostly
mirroring the single-core C5 behavior.

Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-08-27 21:23:34 +01:00
TOKITA Hiroshi
989e6e35b7 drivers: pinctrl: Add a bcm2712 pinctrl stub driver
Enabling the rp1 pinctrl also requires the bcm2712 pinctrl,
so add a minimal stub.
This does not perform any processing, but preserves the register
settings at reset.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-08-25 14:23:09 -07:00
TOKITA Hiroshi
ced15b10b8 drivers: pinctrl: Add RaspberryPi RP1 pinctrl driver
Add a pinctrl driver for RaspberryPi RP1.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-08-25 14:23:09 -07:00
Sri Surya
c42710e51d drivers: pinctrl: Add pinctrl driver for TI Tiva C Series Soc
Add pinctrl driver for TI Tiva C Series Soc.

Signed-off-by: Sri Surya <srisurya@linumiz.com>
2026-08-24 14:03:15 -07:00
Darcy Lu
0f94e08f5e drivers: pinctrl: rts5817: Move pinctrl regs to soc directory
This commit moves pinctrl registers definition file to RTS5817
soc directory, because gpio driver will also include this file

Signed-off-by: Darcy Lu <darcy_lu@realsil.com.cn>
2026-08-21 13:35:06 -07:00
Benjamin Cabé
79bd5189d1 drivers: pinctrl: mci_io_mux: Fix GPIO group boundary
GPIO index 32 belongs to GPIO_GRP1 bit 0, but the split used '> 32',
sending index 32 into a 32-bit shift on GPIO_GRP0 instead. Use '>=',
consistent with the gpio_idx - 32 addressing used for the high group.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-21 17:52:43 +02:00
Aksel Skauge Mellbye
885d5e2339 drivers: pinctrl: silabs: Use sl_hal_gpio instead of emlib
Update driver to use new HAL library that supports both
Series 2 and Series 3 SoCs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-08-19 11:26:47 +02:00
Laurie Fay
890c2e7e6b drivers: pinctrl: migrate musca-b1 pinctrl driver
This commit migrates the existing pinmux driver for the musca-b1
board to the newer pinctrl API. The new implementation also fixes
a bug in the original pinmux driver which would have selected
alternative function 2 instead of ALTF1 as desired.

The musca-s1 pinmux driver has been left as this board is
deprecated.

Signed-off-by: Laurie Fay <Laurie.Fay@arm.com>
2026-08-11 17:01:15 -04:00
Nam Nguyen
b4c5ed20b3 soc: renesas: rcar: Support Cortex A720 for R-Car X5H SoC
Support Zephyr RTOS on Cortex A720 for R-Car X5H.

For more information and documentation, please visit the product page:
https://www.renesas.com/secure/gen5-r-car-x5h

Signed-off-by: Nam Nguyen <nam.nguyen.xn@renesas.com>
2026-08-10 16:31:01 -04:00
Benjamin Cabé
c2f4cac5b1 drivers: pinctrl: mchp_port_g1: Clear OUT latch for pull-down
With PULLEN set, the PORT_OUT bit selects the pull direction. The
pull-down path never cleared a previously set OUT bit, so a requested
pull-down could configure a pull-up instead. Clear the latch in the
pull-down case, as the gpio_mchp_port_g1 driver does.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-10 07:08:58 -07:00
TOKITA Hiroshi
185c8c735b soc: renesas: Add R8A779G0 A76 support
Add SoC and devicetree support for the R-Car Gen4 R8A779G0 A76.

Co-authored-by: Yuya Hamamachi <yuya.hamamachi.sx@renesas.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-08-07 06:48:15 -04:00
Mathieu Choplain
89c2dd7ef4 drivers: pinctrl: stm32: depend on a GPIO port being enabled
Don't allow enabling the STM32 pinctrl driver if no GPIO port is enabled
as this would cause a build error in the GPIOport manager module.
If no GPIO port is enabled, the pinctrl driver is useless anyways.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-07 06:46:44 -04:00
Benjamin Cabé
75926ea323 drivers: pinctrl: numicro: Fix DINOFF read-modify-write
The DINOFF update read back SMTEN instead of DINOFF, so the write
seeded the input-disable register from Schmitt-trigger state and
destroyed the other pins' DINOFF bits. Read DINOFF, matching every
other read-modify-write in the function.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-05 09:23:21 +02:00
Elie Carrot
baecfddded drivers: pinctrl: add WCH CH570 pin controller driver
Add a pin controller driver for the WCH CH570 SoC.
Implements `pinctrl_configure_pins` to enable GPIO initialization and
alternate function configuration.

Update hal_wch revision in west.yml and hal_ch32fun.h to sync with
changes merged in zephyrproject-rtos/hal_wch#6

Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
2026-08-03 15:00:06 -04:00
Johnny Chuang
facf2869b6 drivers: pinctrl: Add PINCTRL driver for ELAN EM32 series
Add the initial pinctrl driver support for the ELAN EM32 SoC family.
This driver provides basic pin multiplexing and electrical configuration
support. Device tree bindings are included for pin function definitions.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
2026-07-28 12:28:40 -07:00
Nikodem Kastelik
881cafe472 drivers: pinctrl: nrf: align to MSPI rename
nRF7120 uses MSPI naming now instead of QSPI.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2026-07-28 11:32:36 +01:00
Liu Changjie
4c9de24835 drivers: pinctrl: wch: add H41X AFIO driver
Add a pinctrl driver for the CH32H41x AFIO block. Unlike the CH32V20x/30x
remap (PCFR) model, the CH32H41x selects pin alternate functions through
a per-pin 4-bit field in the AFIO GPIOx_AFLR/AFHR registers (STM32-style
mux), in addition to the usual GPIO CFGLR/CFGHR direction and bias
configuration.

The driver is gated by CONFIG_PINCTRL_WCH_H41X_AFIO (default y when the
wch,h41x-afio node is enabled) and is wired into the pinctrl CMakeLists
and Kconfig alongside the existing WCH AFIO drivers.

Signed-off-by: Liu Changjie <liucj1228@outlook.com>
2026-07-27 11:36:23 -07:00
Benjamin Cabé
1cfdd9dce2 drivers: pinctrl: aesc: Fix pin index bounds check
AESC_PINCTRL_MAX_PINS is the pin count, so valid indices are
0 to MAX_PINS - 1, but the guard used '>', letting pin 128 write one
register past the pin mux range. Use '>='.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-25 17:09:29 +02:00
Benjamin Cabé
652d3ca81b drivers: pinctrl: rza2m: Fix POC0/POCSEL0 clear mask
The PIN_POSEL case AND-ed the two disjoint bit masks, producing 0, so
the old POC0/POCSEL0 values were never cleared and could not be set
back to zero. OR the masks, matching the POC2/POC3 cases.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-22 11:11:08 +01:00
Muhammad Waleed Badar
005ca62f3c drivers: pinctrl: bcm2711: add ngpios devicetree property
Add a required ngpios property to the BCM2711 pinctrl binding
and set it in the SoC dtsi. Update the driver to read the number
of GPIOs from devicetree via DT_INST_PROP.

This makes the GPIO count explicit in devicetree and avoids
hardcoded assumptions in the driver.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-11 07:30:36 -04:00
Fabin V Martin
670163be2a drivers: pinctrl: mchp g1: clear PMUX nibble before setting mux value
The PMUX register was not being properly cleared before setting
the new mux value. This causes incorrect pin configuration when
the register contains non-zero initial values.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2026-07-09 10:12:01 +01:00
Camille BAUD
a0473c3a2f drivers: bflb: extend shared drivers with BL616CL support
Add support for BL616CL in shared drivers

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-07-08 10:01:48 +02:00
Daniel Schultz
c327b6ed5a drivers: pinctrl: pinctrl_aesc: Convert to sys_{write,read}32
Register structs rely on the compiler emitting 32-bit volatile accesses
and on the struct layout staying in sync with the hardware. sys_read32
and sys_write32 make the access width explicit, work with DEVICE_MMIO
address mapping, and match the convention used by in-tree drivers.

Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
2026-07-02 12:58:32 -04:00
Etienne Carriere
b0b25c35c9 drivers: use <> to include Zephyr headers instead of ""
Use <> operator to include a Zephyr header file instead of "" that
is intended to local header files, not header files relative to
specifically defined search paths.

This change was made running the sed shell command below:
$ sed -i -E 's/#include "zephyr\/([^"]+)\.h"/#include <zephyr\/\1.h>/g' \
    `grep -rsl "#include \"zephyr/" drivers/`

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-30 06:49:18 -04:00
Surya Prakash T
2b889c644a drivers: pinctrl: Pin control driver for LPC84x
-Added pinctrl driver for the NXP LPC84x series.
-The driver manages pin configuration via the IOCON
peripheral and dynamic pin function assignment via
the Switch Matrix (SWM).

Signed-off-by: Surya Prakash T <suryat@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Co-authored-by: Dilip Raman <dilipr@aerlync.com>
2026-06-26 14:23:10 +01:00
Camille BAUD
fc4fe0f14d drivers: pinctrl: Update BFLB pinctrl to handle SF controller
The organization has changed to have larger signal bitfield,
and handle sf pads swaps.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-06-23 17:36:21 -04:00
Ričards Poriņš
2c88357cfd drivers: pinctrl: sam: handle extra-function pins
Pins configured with SAM_PINMUX_FUNC_extra (e.g. ADC analog inputs)
fall through the pinctrl configuration with the function field
defaulting to 0, which maps to SOC_GPIO_FUNC_A (Peripheral A).

If Peripheral A for that pin is an active output (e.g. SSC_TD on
PA17/SAM4S), it drives the pin LOW and the ADC reads 0V despite a
valid analog signal on the input.

Configure extra-function pins as PIO input (high-impedance) so no
peripheral output driver interferes with the analog signal path.
The ADC reads via its own internal analog connection regardless of
PIO mode.

Tested on SAM4S where PA17 (ADC ch0) Peripheral A is SSC_TD — ADC
now reads correctly instead of returning 0.

Signed-off-by: Ričards Poriņš <ricards.porins@gmail.com>
2026-06-22 15:48:47 +02:00
Silesh C V
ab349daa15 drivers: pinctrl: alif: use device_map() for register regions
The Alif pinctrl driver needs to be usable by MMU-enabled Cortex-A32
based board variants (in addition to the Cortex-M55 based boards), which
require MMIO regions to be mapped into the virtual address space at
runtime. Map the pinctrl and lpgpio pinctrl regions using device_map()
during boot.

The driver does not use the device model, and the two regions are named
reg entries on a single pinctrl node. As the DEVICE_MMIO_TOPLEVEL_*
macros do not support named reg entries, device_map() is called directly
to map each region.

No behavioral change for the existing non-MMU (Cortex-M55) targets, as
device_map() collapses to a simple address assignment in them, now done
once at boot instead of compile time.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
2026-06-18 14:38:57 -04:00
Zayne Stites
96270c6d7d drivers: pinctrl: Add cfgout3 to infineon driver
Add CY_GPIO_DM_CFGOUT3_STRONG_PULLUP_HIGHZ support to pinctrl
driver for Infineon

Assisted-by: Claude:claude-opus-4.7

Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
2026-06-16 08:37:05 +02:00
Sylvio Alves
7c7773be30 drivers: pinctrl: esp32: allow input and output enable on one pin
A pin requesting both input-enable and output-enable matched neither
switch case and left both disabled. Test the two bits independently
so a bidirectional pin keeps both directions enabled.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-11 15:04:09 -04:00