Commit graph

1,812 commits

Author SHA1 Message Date
Stan Verschuuren
efc66a9cd9 drivers: gpio: max14906: Apply new value in toggle_bits
MAX14906 implementation of GPIO function `port_toggle_bits` writes
back old register value instead of inverted new value.

This commit XOR's current output state with requested pins (as expected)
and writes new value to register.

Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
2026-02-17 10:32:50 +01:00
Stan Verschuuren
0cbfd7b445 drivers: gpio: max149x6: Add missing port_set_masked_raw GPIO API
The MAX149x6 drivers do not implement the generic GPIO function
port_set_masked_raw. The current implementation therefore hard faults due
to dereferencing NULL ptr on calls to gpio_port_set_masked_raw.

This commit adds port_set_masked_raw for both MAX14906 and MAX14916.

Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
2026-02-17 10:32:50 +01:00
Stan Verschuuren
e78120f768 drivers: gpio: max14906: Fix clear_bits_raw to erase correct output bits
The MAX14906 SetOUT register packs direction bits in [7:4] and output
state in [3:0]. The existing implementation clears all output bits
regardless of pin mask, as the mask is ANDed with 0xf0 before inversion.

This commit fixes that by masking before inverting.

Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
2026-02-17 10:32:50 +01:00
Stan Verschuuren
be3ce18908 drivers: gpio: max14906: Make non-essential ports optional
The MAX14906 can be operated compliantly without directly controlling
EN/FAULT/SYNCH/READY ports. The MAX14906 DTS files already reflect this
optional nature.

This commit makes the driver treat these ports as optional without changing
the business logic of the driver. If these ports are not defined,
certain diagnostic logging calls are simply skipped over.

Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
2026-02-17 10:32:50 +01:00
Stan Verschuuren
2d4c96901e drivers: gpio: max149x6: Handle check_byte in CRC function
The MAX14906 (p36), MAX14915 (p26), and MAX14916 (p28) datasheets state
that the device includes A0,A1,ThrErr bits in CRC calculation. The existing
solution doesnt handle these bits.

This commit passes the 3 top bits of the SDO check byte to the CRC
function, making the CRC calculation datasheet compliant

Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
2026-02-17 10:32:50 +01:00
Muhammed Asif
a51311010c drivers: microchip: interrupt_controller: Add g1 driver for eic
- Adds the g1 driver for eic for microchip devices
- Uses the APIs of the eic driver from gpio driver

Signed-off-by: Muhammed Asif <muhammed.asif@microchip.com>
2026-02-16 00:12:43 +00:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Sylvio Alves
39de685f64 drivers: gpio: esp32_lp: add pull-up/down and wakeup support
Add GPIO_PULL_UP and GPIO_PULL_DOWN handling in pin_configure
and enable LP_IO wakeup source in pin_interrupt_configure via
rtcio_ll_wakeup_enable(). Both rtcio_ll_intr_enable() and
rtcio_ll_wakeup_enable() are required for LP_IO wakeup to
function, as clk_en must be set for the interrupt status
register to update.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-02-12 20:04:04 +01:00
Aksel Skauge Mellbye
bf4591b4bc drivers: gpio: silabs: Set port_pin_mask from Devicetree
Set `port_pin_mask` in the GPIO driver for Silicon Labs Series 2
based on Devicetree `ngpios` and `gpio-reserved-ranges`. This
mask is used to validate that the pin numbers passed to the GPIO
API are valid on a given device.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-02-09 13:32:07 +01:00
Matthias Alleman
821d372c47 drivers: gpio: gpio_pca_series: fix unresponsive gpio_pca_series
The gpio_pca_series driver may stop responding if the gpio_int is
asserted between reading the interrupt status and clearing it.
If the interrupt gpio_int is not deasserted by the time the handler
finishes, the interrupt work should be rescheduled.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2026-02-04 12:51:00 -06:00
Zacck Osiemo
690660f8f6 drivers: gpio: Introduce SC18IS606 GPIO Controller
Added a driver implementation for the GPIO Controller
on the sc18is606

Signed-off-by: Zacck Osiemo <coderv63@gmail.com>
2026-02-03 14:22:34 -06:00
Pisit Sawangvonganan
5f2d9f5e7b drivers: gpio: place API into iterable section
Add the `DEVICE_API` wrapper to the remaining `gpio_driver_api` instances,
ensuring that each driver API is placed in its respective linker section.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-01-26 12:09:59 +01:00
Pieter De Gendt
8402a4f8e5 drivers: gpio: mcux: Fix updating ICR registers without IRQ lock
During configuration the base->ICR1 or base->ICR2 register is written
without an IRQ lock. This can result in unwanted side-effects if the status
bit isn't cleared, or the edge select still needs to be updated.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-23 13:54:42 +01:00
Braeden Lane
fe9ecee97e drivers: gpio: Add Infineon PSOC 4 GPIO driver support
Add GPIO driver for Infineon PSOC 4 series MCUs using the
Infineon PDL.

Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
2026-01-22 13:01:21 -05:00
Nhut Nguyen
e200e82909 drivers: gpio: renesas: Refactor gpio for RZ family
- Decouple interrupt settings from gpio drivers, making them configured
  and handled independently by tint and ext_irq drivers.
- Remove device-specific hardware definitions in gpio_renesas_rz.h and
  take advantage of pinctrl data type and dtsi for certain series.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-01-20 13:25:13 +00:00
Bjarki Arge Andreasen
7f685ca60a drivers: gpio: nrfx_gpio: Use NRF_DT_INST_IRQ macros
Use NRF_DT_INST_IRQ_ macros which support building with and without
SW ISR table for all nordic socs.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-01-16 18:06:06 +01:00
Tom Hughes
6d7b8b6b2d drivers: gpio: max14906: Fix initialization
Found when building with clang with -Winitializer-overrides:

drivers/gpio/gpio_max14906.c:495:29: error: initializer overrides prior
initialization of this subobject [-Werror,-Winitializer-overrides]
  495 | DT_INST_FOREACH_STATUS_OKAY(GPIO_MAX14906_DEVICE)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2026-01-16 11:38:13 +00:00
Fin Maaß
075f2e7361 drivers: gpio: litex: rework litex gpio driver
rework litex gpio driver.
It is now also supported to change direction.
now uses the reg names to detect if what modes the gpio
controller supports.
use the reg names directly from litex.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-13 17:26:08 +01:00
Woobin Song
028abf54ba drivers: gpio: tca6424a: fix race condition in port_get_raw()
Avoid overwriting cached input state while ISR-deferred work is pending.
Previously, port_get_raw() updated pins_state.input via
update_input_regs(), which could corrupt previous_state used for
transition detection.
Fix by reading input registers directly without updating the global cache.

Signed-off-by: Woobin Song <woobin.song@assaabloy.com>
2026-01-09 10:37:29 +01:00
Manojkumar Konisetty
547f1bbb11 drivers: gpio: Add Infineon PSoC4 GPIO driver
Introduces a GPIO driver that provides generic interfaces
for both interrupt-driven inputs and controllable outputs.

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-01-08 09:27:24 +01:00
Jayvik Desai
8c207308a4 drivers: gpio: emul: validate pins in single-pin APIs and mask in port APIs
Add input validation to single-pin GPIO APIs (e.g., gpio_pin_configure)
and emulator-specific helpers to return -EINVAL for invalid pins. This
ensures tests correctly fail when targeting non-existent pins.

For standard port-wide APIs (e.g., gpio_port_set_bits_raw), align behavior
with hardware drivers by masking out invalid pins instead of returning an
error. This mimics hardware behavior where writing to unimplemented bits
is ignored, and ensures compatibility with generic tests that use full
32-bit masks (e.g., 0xFFFFFFFF).

Signed-off-by: Jayvik Desai <jayvik@google.com>
2026-01-07 14:50:43 -06:00
Fin Maaß
3d6000e070 drivers: gpio: i2c: replace use of i2c_burst_write
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-07 17:30:32 +01:00
Gaetan Perrot
aaa321569f drivers: gpio: infineon: remove redundant NULL check in ISR
Remove a redundant NULL check on the device pointer in the GPIO
interrupt handler.

The device pointer is dereferenced unconditionally before the check
and cannot be NULL in this context.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-02 09:57:43 +00:00
zjian zhang
97d266e777 drivers: gpio: fixed compile warning
fixed gpio driver compile warning

Signed-off-by: zjian zhang <zjian_zhang@realsil.com.cn>
2025-12-22 14:45:39 +01:00
Sreeram Tatapudi
0a06f5b91a dts: bindings: Drop cat1 from the infineon binding files
Drop cat1 from the binding files to enable reuse by other
category devices as well.

Fixes #99174

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-17 13:58:09 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
zjian zhang
e788c98af6 drivers: gpio: add amebadplus gpio driver
GPIO driver for amebadplus

Signed-off-by: zjian zhang <zjian_zhang@realsil.com.cn>
2025-12-15 17:06:38 +00:00
Josia Strack
287ca5b9eb drivers: gpio: pcf857x: ensure input pins default high for open-drain
Ensure that pins configured as inputs are driven high in the port
output register, consistent with open-drain operation. This prevents
inputs from being driven low unintentionally and aligns behavior
with hardware expectations.

Signed-off-by: Josia Strack <j.strack98@gmail.com>
2025-12-15 07:30:23 -05:00
Andrej Butok
75a2b1e35c drivers: gpio: nxp: mcux_igpio: fix mcux_igpio_port_get_raw()
- Reads the Pad Status Register (PSR) to get
  the current GPIO input value, instead of the Data Register (DR).
  Following IMXRT1170RM.pdf "13.5.2 GPIO Write Mode".
- Enables input buffer via Software Input On (SION)
  to get correct pin value in PSR for both input/output pins.
- Issue has been discovered during Safety DIO self-tests.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-12-11 09:18:54 +02:00
Peter van der Perk
24b3ff233b gpio: mcux_rgpio: Support IRQ output select and access checks for i.MX95 M7
Support for selecting the IRQ output via the `irq-output-select` property
in devicetree. Updates interrupt configuration and ISR logic to use the
selected IRQ index. For i.MX95 M7, ensures pins and IRQs are configured
only when secure access is allowed by checking PCNS and ICNS registers.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-12-10 17:36:57 +00:00
Mathieu Choplain
65f710f6f4 drivers: gpio: stm32: return error on invalid WKUP configuration for WBA
When an invalid GPIO configuration is provided for a wake-up pin on
STM32WBA series, display a series-specific message and return an error.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-09 09:52:22 -05:00
Mathieu Choplain
19666bb12e drivers: gpio: stm32: bubble-up wake-up pin configuration error
When an error occurs while attempting to configure a GPIO pin as wake-up
pin, return the error to the caller instead of merely printing a log
message which may not even be displayed.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-09 09:52:22 -05:00
Sreeram Tatapudi
5ecf248ba3 drivers: infineon: Drop cat1 from the files names
Drop cat1 from the file names to enable reuse by other
category devices as well

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-07 21:19:38 -05:00
Scott Worley
cd6d7c9515 drivers: gpio: microchip: mec: One common driver for all MEC parts
Microchip MEC parts have a similar GPIO peripheral block. We
create a unified driver for all parts. NOTE: MEC GPIO interrupt
detection sets active status when changed from interrupt detect
disabled to any enabled mode. Driver ISR and interrupt configuration
implementation includes work-arounds for this issue.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2025-12-06 11:38:34 -05:00
Sai Santhosh Malae
76b1a07c54 drivers: gpio: siwx91x: Implement device runtime PM for GPIO ports
The existing device runtime PM model requires applications to call
pm_device_runtime_get()/put() on the GPIO controller device directly,
which is not ideal when GPIO ports are exposed as child nodes.

This update enables runtime PM at the GPIO port (child node) level,
allowing applications to manage power through the port devices instead
of the top-level controller.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-12-05 14:53:49 -05:00
Fin Maaß
5c152e19fa drivers: gpio: use I2C_INIT_PRIORITY as default for gpio chips on i2c bus
use I2C_INIT_PRIORITY as default for gpio chips,
that are on a i2c bus.

If childs have the same priority as their parents,
the init order is decided by the devicetree ordinals.
This ensures, that these childs are init after their parent.
Because of that gpio chips on a i2c bus can have the
same priority as the i2c controller.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-02 15:19:24 -05:00
Fin Maaß
66f572e24b drivers: gpio: Kconfig: use if for pca95xx and pca_series
use if instead of multiple depends on for pca95xx and pca_series GPIO
Kconfig files to improve readability.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-02 15:19:24 -05:00
Aksel Skauge Mellbye
a83b19b3f9 soc: silabs: Fix clock control dependency declarations
Most drivers for Series 2 depend on clock control, but didn't
declare it. Enable clock control by default for Series 2 SoCs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-12-01 11:11:14 +01:00
Nikodem Kastelik
ad1e5ac253 nordic: update and align to nrfx 4.0.1
New nrfx release contains major rework of nrfx drivers
instantiation making it easier to integrate with dts nodes.
Now, nrfx driver instances can no longer be `const`
because they contain driver runtime state.
Additionally, all nrfx drivers return `errno` error codes
instead of deprecated `nrfx_err_t`.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-11-27 14:45:17 +01:00
S Swetha
e891ca601e drivers: gpio: intel: Fix Pad IO Termination values
Swap PAD_CFG1_IOSTERM_PU and PAD_CFG1_IOSTERM_PD values.

Signed-off-by: S Swetha <s.swetha@intel.com>
2025-11-24 21:15:21 +01:00
Ayush Singh
64eefc709e drivers: gpio: cc13xx_cc26xx: Remove multi functions
- It seems that the mask variants of GPIO functions are not present in
  the latest sdk, so replace those with direct register access.
- This was already done in [0], but was reverted due to some hal
  problems.
- I am working on a hal update, but since this change does not require a
  hal update to work, it would be best to merge this first.

[0]: https://github.com/zephyrproject-rtos/zephyr/pull/83402

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-11-24 14:57:16 -05:00
Mathieu Choplain
a7b396f9ab drivers: gpio: stm32: use FOR_EACH to instantiate devices
Use a list of ports and FOR_EACH to instantiate GPIO devices instead of
having one line to instantiate each port. This is much shorter and also
makes it easier to add support for new ports, if necessary in the future.

While at it, cover all ports from A to Z since it is now trivial to do so.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-21 11:59:40 +01:00
Elmo Lan
95aa209226 driver: gpio: Add sleep delay in gpio isr
When EC wakes by GPIO, it may fall back to SUSPEND_TO_IDLE
before the host or peripherals have a chance to take further action.

Add a lightweight delay-sleep mechanism to keep system awake
for as short period after a GPIO wake event.

Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
2025-11-19 06:52:59 -05:00
Andrej Butok
9e0012b313 drivers: gpio: nxp: fix gpio_mcux_lpc_configure()
- Enables Digital mode for both input and output GPIO
  pins, in gpio_mcux_lpc_configure().
- Fixes #99255

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-11-18 17:38:58 -05:00
Pisit Sawangvonganan
489b8a386c drivers: gpio_stm32: consolidate *pincfg writes
Use a local accumulator (`cfg`) to build the pin configuration and commit
it to `*pincfg` only once. This keeps intermediate values in registers,
reduces RAM write traffic.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-11-18 17:36:49 -05:00
Ayush Singh
9f4a0153b8 dts: arm64: ti: ti_am62x_a53: Use GPIO Proxy
After trying out a few different approaches, I think having separate
nodes for each bank in devicetree and having a GPIO proxy node for the
controller is the best solution right now.

To be more specific, GPIO proxy solution still allows for bank level
GPIO toggling. The linux kernel GPIO davinci driver is currently limited
to single pin operations. This might not be a problem in Linux, but I
feel like embedded systems would prefer having support for bank level
operations.

This also does not pose a problem for the future implementation of
interrupts due to that fact that the interrupt router is separate device
and will require a separate driver. In fact, the GPIO interrupt router
is shared between main_gpio0 and main_gpio1.

This patch also reverts the previous bank offset related work on GPIO
davinci driver.

The patch has been tested on PocketBeagle 2.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-11-18 10:47:20 -05:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Etienne Carriere
b6784734be drivers: gpio: stm32: clean instance init macro indentation
Cleanup indentation in STM32 GPIO controllers device definition
macros. Replace some uses of COND_CODE_1() with IF_ENABLED() that
is bit more explicit.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Etienne Carriere
b0ccb2295f drivers: stm32: use STM32_CLOCK_INFO_BY_NAME() and friends
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.

Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Arnaud Pouliquen
d8e7887ba9 drivers: gpio: invert I2C config dependency for MCP23xxx
The GPIO_MCP230XX config currently depends on the I2C config. This means
that the board/SoC must enable the I2C config to support MCP23xxx devices.
Inverting this dependency allows declaring GPIO_MCP230XX directly in the
board/SoC defconfig without explicitly enabling I2C.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Suggested-by Fin Maaß <f.maass@vogl-electronic.com>
2025-11-13 20:35:09 -05:00