Commit graph zephyr/drivers/gpio
Author SHA1 Message Date
Jens Korinth
f3ddc57cc0 drivers: gpio: pca_series: add polarity inversion register support
The PCA/PCAL series I2C GPIO expanders have a polarity inversion
register on every supported part, but the driver has it fully
commented out ("unused, omitted") in the register tables, cache maps
and reg_type enum, so it was never wired up.

Add a polarity-inversion devicetree property (32b, default 0, covering
up to 4 ports / p3.7..p0.0) and write it to the polarity inversion
register during reset, alongside the existing output_port/configuration
reset writes. The value is converted with sys_cpu_to_le32() before the
write, matching how every other multi-byte register write in this
driver already handles byteorder (e.g. the 2b_interrupt_edge write),
since the register spans up to 4 bytes depending on part_cfg->port_no.

Enabling the register also makes it cacheable like output_port and
configuration, so the cache-map arrays for all three register table
families (pca953x, pcal953x, pcal65xx) have every subsequent cache
slot index shifted by one, and the base cache-size count used by
GPIO_PCA_GET_CACHE_SIZE_BY_PART_NO_NO_INT goes from 2 to 3. The
per-part register address tables only needed the already-documented
address uncommented, since those are fixed hardware addresses.

Verified by hand that the cache-size formula still matches the
highest cache-map index for both the smallest (pca953x, no latch/pull)
and largest (pcal65xx, latch+pull+int_extend, up to 4 ports) part
families after the shift.

Signed-off-by: Jens Korinth <jnsk@tuta.io>
2026-10-30 10:12:51 -04:00
Arkadiusz Grzelka
4dff778da1 drivers: gpio: efinix: accept up to 32 GPIOs
The init function rejected any ngpios above 4 with -EINVAL, so a wider
GPIO block failed to initialise. The Sapphire IP offers widths of 1, 2,
4, 8, 16 or 32.

Restrict ngpios to those values in the binding, drop BIT_MASK() from
the latch read-modify-write as BIT_MASK(32) shifts by 32, and remove the
empty init function.

Not tested on silicon.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
2026-10-29 15:45:10 -04:00
Arkadiusz Grzelka
596f2ec736 drivers: gpio: efinix_sapphire: read pin levels from the input register
port_get_raw read the OUTPUT register at offset 0x04. That register is
the output latch and returns what was last written, so an external
signal on an input pin was never seen.

Read the INPUT register at offset 0x00 instead, masked to the port pin
mask.

Not tested on hardware.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
2026-10-29 15:45:10 -04:00
Tim Lin
4a84e7a11e drivers/gpio: it82xx2: Support port get direction function
Implement port_get_direction for the it82xx2 GPIO drivers.
Report input and output pins from the GPIO control registers while
excluding disconnected pins.

test:
west build -p -b it82xx2_evb tests/drivers/gpio/gpio_get_direction/

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2026-10-29 08:46:09 +02:00
Johann Fischer
1ad8b61982 drivers: gpio: mcux: select PINCTRL
The Kinetis PORT clock gate is opened by the pinctrl driver. The gpio
nodes have no clocks property, so gpio_mcux never enables the gate but
writes PORTx->PCR when it configures a pin. Once the UART driver is
disabled nothing else selects PINCTRL and the gate stays closed. On
frdm_k64f an application that only uses a button and an LED does not
work then.

Select PINCTRL like the other mcux GPIO drivers do.

Assisted-by: Claude:claude-sonnet-5.5
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-10-28 22:50:55 -04:00
Camille BAUD
190e91dbd8 drivers: gpio: Fix BL61x/CL/808 cache not taking init value into account
Cache the 'configure' initialization value.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-10-28 22:42:49 -04:00
Tim Lin
a4ac920f36 drivers: gpio: it8300: add emulator
Add an I2C emulator for the ITE IT8300 GPIO expander. Model register reads
and writes, output data mirroring, write-one-to-clear interrupt status,
global interrupt status, and the active-low ALERT signal.

Expose helpers to reset the emulated device, inject GPIO input changes,
and access registers so tests can validate driver behavior.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2026-10-28 22:39:11 -04:00
Tim Lin
b6efda13ef drivers/gpio: it8300: Implement the GPIO expander driver
Add GPIO driver and devicetree bindings for the ITE IT8300 GPIO
expander.

The IT8300 provides 34 GPIO pins divided into five GPIO groups. Each
group is represented by an ite,it8300-gpio child node, while the parent
ite,it8300 node manages the shared I2C connection and optional active-low
ALERT# interrupt.

The device only reports that a pin has changed and does not provide
per-pin edge polarity information. Cache the previous input state and
filter the latched changes in the alert work handler to provide rising,
falling, and both-edge interrupt support.

The driver was tested with the IT8300 connected to it51xxx_evb and
passed the following Zephyr GPIO test suites:

- drivers/gpio/basic_api
- drivers/gpio/get_direction
- drivers/gpio/gpio_hogs

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2026-10-28 22:39:11 -04:00
Rob Barnes
5944b590d0 drivers/gpio: ite_it8xxx2_v2: Only submit worker for level interrupts
gpio_ite_isr() and gpio_ite_pin_interrupt_configure() previously
submitted data->interrupt_worker to k_sys_work_q unconditionally on
every GPIO interrupt and configuration call, even when only
edge-triggered interrupts were enabled on the port. Under high-rate
edge interrupts, this floods k_sys_work_q with hundreds of no-op work
submissions per second.

Only submit data->interrupt_worker when the pin is configured for
level-triggered interrupts, clear level_isr_low and level_isr_high
when disabling a pin's interrupt with GPIO_INT_MODE_DISABLED, and skip
pins with disabled IRQs in gpio_ite_interrupt_worker().

TEST=./twister -s drivers.gpio.ite_it8xxx2_v2
TEST=Boot hylia and verify k_sys_work_q is not flooded by edge IRQs

Signed-off-by: Rob Barnes <robbarnes@google.com>
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2026-10-22 09:44:35 +02:00
Richard Wheatley
34a7a27f48 drivers: gpio: ambiq: fix interrupt filtering and output masking
Filter GPIO callbacks against the programmed edge direction so spurious
level samples do not fire handlers. On Apollo3, track output-enabled
pins and mask port writes / combine read status accordingly. Enable the
IRQ only after interrupt setup succeeds.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2026-10-20 17:26:12 +02:00
Shawn Yang
6f28951bfd drivers: gpio: sf32lb: correct open-drain output polarity
The open-drain implementation keeps the output latch low and controls
the output enable bit. A logical high must disable the output and a
logical low must enable it.

Correct initial output state and masked, set and clear writes to match
those semantics. Push-pull output behavior is unchanged.

The OpenSiFli downstream driver already implements this polarity;
apply the equivalent fix to the mainline register-access implementation.

Link: 679c245711
Assisted-by: Codex:GPT-6
Signed-off-by: Shawn Yang <y810004@gmail.com>
2026-10-19 10:14:28 +02:00
Shawn Yang
850bdb8735 drivers: gpio: sf32lb: acknowledge IRQs before callbacks
Clearing pending bits after invoking callbacks loses an edge that
arrives during a callback on the same pin. Acknowledge the captured
pending bits first, then dispatch callbacks for enabled pins.

Limit the acknowledged snapshot to this port so that another port
sharing the bank keeps its pending events.

Assisted-by: Codex:GPT-6
Signed-off-by: Shawn Yang <y810004@gmail.com>
2026-10-19 10:14:08 +02:00
Hsiu-Chi Tsai
88c54b2864 drivers: gpio: emul: apply the mask in the masked output getter
gpio_emul_output_get_masked() validates its mask and then never applies
it: the value it stores is every output pin on the port, while the
doxygen says it holds the value of the pins asked for.

Nothing in tree reads a wrong value today, because the only caller is
gpio_emul_output_get(), which applies BIT(pin) to the result itself. A
test reading several lines back through the masked getter does see the
other outputs, which is how this turned up.

The regression test drives one pin high and asks for a different one.
It fails on the unfixed driver, reporting 0x1 outside the mask, and
passes with the fix. gpio_basic_api and the gpio_kbd_matrix input test,
which uses the single-pin wrapper, both still pass.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-10-08 10:53:27 +02:00
Chingbin Li
a3fe18219d drivers: gpio: remove unused gpio_sifive_plic_to_pin function
Remove the static inline function gpio_sifive_plic_to_pin() from the
SiFive GPIO driver, as it is no longer called anywhere in the codebase.
The pin calculation is now handled directly within the interrupt
handler, making this legacy function dead code.

Signed-off-by: Chingbin Li <liqb365@163.com>
2026-10-07 09:36:14 +02:00
Pisit Sawangvonganan
27c0e8d035 drivers: {flash, gpio, i2c, mfd, misc, modem, mspi, pwm, reset}: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/flash`
- `drivers/gpio`
- `drivers/i2c`
- `drivers/mfd`
- `drivers/misc`
- `drivers/modem`
- `drivers/mspi`
- `drivers/pwm`
- `drivers/reset`

Assisted-by: Claude:claude-sonnet-5-5 codespell
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-10-06 22:39:29 +02:00
Mathieu Choplain
67d2d2f83b soc: st: stm32: pwr_wkupctrl: separate IRQ dispatch from WKUP enablement
The implementation of WKUP event dispatch as GPIO interrupts had a small
flaw: any pin that gets configured as wake-up pin would implcitly have
interrupt dispatch enabled for it, even if the pin was never explicitly
configured as interrupt source. This would most likely have no nefarious
effect since it wouldn't make sense to register GPIO callbacks for a pin
which is known to not be used for interrupts, but it was a possibility
nevertheless. A more realistic case where this causes issues is that if
interrupts were really enabled for the pin, but disabled later on, we
would still dispatch a WKUP event for that pin even though interrupts
were explicitly disabled.

Separate enablement of a pin as wake-up line source from enablement of
interrupt dispatching, and modify the GPIO driver such that it enables
the dispatch from gpio_pin_interrupt_configure() at the same time that
the regular interrupt is also enabled (ditto for disable).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-29 15:53:43 +02:00
Quy Tran
6a56f931dd drivers: gpio: Add GPIO support for RX74x
Add gpio driver support for Renesas RX74x series

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2026-09-28 19:40:02 -04:00
Alain Volmat
44952d6a3b gpio: mfxstm32l152: set I2C_INIT_PRIORITY for init priority
The MFXSTM32L152 dependency is the availability of the i2c so
set its init priority to I2C_INIT_PRIORITY instead of having
an hardcoded value as before.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-09-26 00:57:28 +02:00
Vignesh Pandian
807c496f8c drivers: gpio: infineon: use standard init priority
Update the Infineon GPIO driver to use the standard
CONFIG_GPIO_INIT_PRIORITY instead of the generic
CONFIG_KERNEL_INIT_PRIORITY_DEVICE. This ensures the GPIO driver
initializes before peripherals that depend on it.

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2026-09-26 00:56:11 +02:00
Lucien Zhao
d89c0fc6e3 drivers: gpio: add nxp,imx-gpio-v2 driver for RT266x
Add a GPIO driver for the NXP i.MX GPIO controller used on RT266x, with
the new compatible nxp,imx-gpio-v2.

The driver (gpio_mcux_gpio.c) handles:

  - Combined IOMUXC PIO pad register, where mux selector and pad
    attributes (pull enable/select, input buffer, open-drain) share one
    read-modify-write register.  The driver sets the attribute bits and
    delegates the mux write to pinctrl_configure_pins().
  - Optional LPCG clock gate at init.  Instances without a gate (always-
    on power domains) simply omit the clocks property.
  - Per-pin TrustZone access control via PCNS, granting non-secure access
    before configuring each pin.
  - Dual-channel interrupt routing: GICLR/GICHR direct each pin's
    interrupt to one of the two NVIC lines, selected by irq-output-select.

The binding nxp,imx-gpio-v2 follows the same property set as other NXP
IOMUXC-based GPIO bindings: pinmux phandle list, optional clocks, and
irq-output-select.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-09-26 00:51:55 +02:00
Mathieu Choplain
856c909e7f drivers: gpio: stm32: don't require POWEROFF for wake-up pins
Now that wake-up pins can be used for something other than poweroff,
drop the wake-up configuration path's dependency on CONFIG_POWEROFF.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +02:00
Mathieu Choplain
4fddde620f soc: st: stm32: pwr_wkupctrl: rename and move the exported function
The function exported by this module was branded as `gpioport` and its
signature was in `stm32_gpio_shared.h`, even though the function can
work with all GPIO port controllers disabled since it only operates
on PWRC registers.

Rebrand the function as `pwrc` instead of `gpioport` and move it to the
`stm32_common.h` header instead, for lack of a better location...

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +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
James Bennion-Pedley
6cd99765f5 drivers: gpio: remove aw9523b reset gpio implementation
This property is now defined on the parent MFD device. Having
it in the GPIO driver means that other MFD children may inadvertently
be reset.

Signed-off-by: James Bennion-Pedley <James.Bennion-Pedley@thinksmartbox.com>
2026-09-24 03:45:10 +02:00
Thomas Chiantia
1a0e0ab809 drivers: gpio: sam0: add drive strength flag
Add SAM0_GPIO_DRIVE_STRONG, a SAM0 specific GPIO devicetree flag that
sets PORT PINCFG.DRVSTR on pins configured as outputs.

gpio_sam0_config() rebuilds PINCFG from zero on every call, so a drive
strength selected through pinctrl is cleared as soon as the pin is
configured through the GPIO API. Carrying it on the gpios specifier
selects the stronger driver where the pin is declared, alongside the
existing SAM0_GPIO_DEBOUNCE.

On SAM D5x/E5x this raises the rated output current from 2 mA to 8 mA
at VDD >= 3.0 V (DS60001507, Table 54-13).

Assisted-by: Claude:claude-opus-5
Signed-off-by: Thomas Chiantia <thomas.chiantia@proton.me>
2026-09-23 10:43:07 +01:00
Camille BAUD
95995e52c6 drivers: gpios: bflb: Gate RC32K mux changes correctly
The specific combination only applies for the BL61x

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-09-23 10:42:16 +01:00
Camille BAUD
ddb2efa68f drivers: gpios: bflb: Allow both input and output at the same time
Allow both input and output modes at the same time.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-09-23 10:42:16 +01:00
Mathieu Choplain
419a8c15d6 drivers: gpio: stm32: enable level-triggered interrupts on STM32WL3
The STM32WL3 series uses the same implementation as STM32WB0 series and
thus supports level-triggered interrupts. Enable the capability at
driver level by loosening the allowlist.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-22 10:31:38 +02:00
Anuj Deshpande
b2ae094c5a drivers: gpio: add C-DAC THEJAS32 GPIO driver
Add a GPIO driver for the two 16-pin GPIO controllers on the C-DAC
THEJAS32 SoC. Pin data is accessed through address masking, where bits
[17:2] of the address select the pins a data access operates on, so
individual pins are set and cleared without read-modify-write. The
direction register sits above the data window at offset 0x40000.

The controllers have no pull resistors and pin interrupts are not yet
wired to the SoC interrupt controller, so both are reported as
unsupported.

Signed-off-by: Anuj Deshpande <anuj@makerville.io>
2026-09-18 13:51:15 +01:00
Martin Hoff
1b928aeca6 soc: silabs: enable new clock managers
This commit enables the new clock managers by switching the device
tree to use the new bindings. It also moves some initialization code
from the old clock manager to soc_early_init_hook() since some clocks
configuration needs to be done before the clock drivers are initialized.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-09-18 11:14:08 +01:00
Vivian Pais
ee19103833 drivers: gpio: mspm0: fix syntax error by encasing case in block
Enclose the GPIO_INT_MODE_EDGE case logic within a block to fix a
compilation failure caused by case label being directly followed
by a variable declaration.

Signed-off-by: Vivian Pais <v-pais@ti.com>
2026-09-16 05:51:41 +02:00
John Moore
25e8db729c drivers: gpio: mcux_rgpio: fix unprotected register writes
mcux_rgpio_port_set_masked_raw() and the pin direction update in
mcux_rgpio_configure() both perform a read-modify-write of a
port-wide register (PDOR, PDDR) without any protection. If a second
thread or an ISR touches the same port concurrently, the write can
land between the read and the write-back, and its effect is silently
lost: bits outside the caller's own mask/pin can be reverted to a
stale value.

Fix mcux_rgpio_port_set_masked_raw() by using the RGPIO peripheral's
dedicated set/clear registers (PSOR/PCOR) instead of a
read-modify-write on PDOR. These registers only ever affect bits
explicitly set in their argument, so the operation is atomic without
needing to disable interrupts.

PDDR has no equivalent set/clear alias, so protect the pin direction
update in mcux_rgpio_configure() with a per-device k_spinlock.
Convert the irq_lock()/irq_unlock() pair already guarding interrupt
configuration in mcux_rgpio_pin_interrupt_configure() to the same
spinlock, since irq_lock() only masks interrupts on the local core
and does not prevent a second core from touching the same register
concurrently on SMP platforms.

Signed-off-by: John Moore <john.moore@amulethotkey.com>
2026-09-15 14:32:22 +02:00
Furkan Akkiz
d439c42d77 drivers: gpio: Add GPIO disable functionality to MAX32 driver
This commit adds the ability to disable GPIO pins in the MAX32 driver.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2026-09-14 08:42:52 -04:00
Marvin Gnad
03fa5a117e drivers: gpio: mcux_igpio: do not read-modify-write the W1C ISR
pin_interrupt_configure() cleared the configured pin's stale edge with
WRITE_BIT(base->ISR, pin, 1), which expands to base->ISR |= BIT(pin).

ISR is write-1-to-clear, so that read returns every latched flag on the
port and writing the value back clears them all, discarding the pending
interrupts of every other pin on the same port.

Clear the single flag with a plain write.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marvin Gnad <marvin.gnad@gmail.com>
2026-09-11 05:23:35 -04:00
Yuzhuo Liu
b557c1bb47 drivers: gpio: bee: allow configuring pins as open-drain
GPIO_OPEN_DRAIN and GPIO_OPEN_SOURCE share the GPIO_SINGLE_ENDED bit and
differ only in GPIO_LINE_OPEN_DRAIN. The open-source rejection test
masked with GPIO_OPEN_SOURCE, which also matches open-drain, so any
attempt to configure a pin as open-drain wrongly returned -ENOTSUP.

Detect open-source on the GPIO_LINE_OPEN_DRAIN bit instead so open-drain
is accepted, and reject open-drain only on RTL8752H: open-drain is
supported on all current and future Bee ICs, and RTL8752H is the sole
older part without a hardware open-drain output mode, so a blacklist is
intentional here.

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-09-10 19:14:33 +02:00
Yishai Jaffe
042104ba7e drivers: gpio: silabs: fix: undefined macro
Now using the correct macro DT_INST_NODE_HAS_PROP instead of the
undefined DT_INST_HAS_PROP.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2026-09-09 07:44:35 +02:00
Fabio Baltieri
e17d4c6c86 device: Add DEVICE_DT_INST_GET_COMMA macro
Add DEVICE_DT_INST_GET_COMMA helper macro to include/zephyr/device.h to
easily get a device pointer followed by a comma when expanding
devicetree foreach iterators like DT_INST_FOREACH_STATUS_OKAY.

Update drivers, soc, subsys, and tests to use the common definition.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
2026-09-07 17:07:48 +01: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
Christoph Baechler
4ecf2a9f83 drivers: gpio: pca_series: fix interrupt mask register polarity
The interrupt mask register uses active-low polarity: a bit value of 0
enables the interrupt on the corresponding pin, while 1 masks it
(per PCAL9539A datasheet section 6.2.10).

The standard interrupt configure function was computing:

    int_mask = int_fall | int_rise;

This set bits to 1 for every interrupt-enabled pin, which masked all
interrupts rather than enabling them. Fixed by computing the input latch
first, then deriving the mask by inversion:

    input_latch = int_fall | int_rise;
    int_mask = ~input_latch;

Signed-off-by: Christoph Baechler <cbaechler@gmail.com>
2026-09-04 06:16:56 -04:00
Anas Nashif
461c9d8673 drivers: gpio: ambiq: use portable IRQ pending API
Replace direct NVIC pending-state calls with k_irq_set_pending()/
k_irq_is_pending()/k_irq_clear_pending(), dropping the dependency on
cmsis_core.h where nothing else needed it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-01 21:05:01 -04:00
Benjamin Cabé
5b4278c695 drivers: use inclusive SPI terminology in remaining drivers
Use controller/peripheral and SDO/SDI terminology in the remaining
SPI-using drivers (audio, auxdisplay, bluetooth HCI, dac, eeprom,
ethernet, flash, fpga, gpio, haptics, hdlc_rcp_if, ieee802154,
input, led, led_strip, lora, mfd, misc, mux, rtc, sdhc, stepper,
video, watchdog, wifi) and the ec_host_cmd SPI STM32 backend,
following coding guideline rule A.2: switch to
SPI_OP_MODE_CONTROLLER/PERIPHERAL and SPI_SDO_OVERRUN_DT, rename
Zephyr-owned identifiers (the HCI SPI header buffers, the winc1500
bus wrapper transfer parameters), and update comments, log messages
and Kconfig help prose.

Vendor and out-of-scope identifiers keep their names: STM32
LL_SPI_MODE_SLAVE in the ec_host_cmd backend, the ATWINC1500 SDK I2C
SLAVE_ADDRESS definition, and the I2S codec clock-role variable in
tlv320aic26.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-01 21:04:50 -04:00
Parthiban Nallathambi
870e496811 license: fix malformed SPDX-FileCopyrightText headers
Two-line copyright notices were wrapped in the SPDX "<text>...</text>"
construct, which is only valid in an SPDX document, not a file header.
The REUSE tool then folds the literal "<text>" into the holder name
and drops the second line from the SBOM.

Remove the markers and tag the continuation line. Holder, year and
e-mail are left unchanged; only the syntax is fixed.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2026-09-01 16:25:23 -04:00
Flavio Ceolin
d28a05d5de drivers: gpio: emul: validate pins
Use gpio_port_pin_is_supported(), which range checks the pin before it
is used as a shift count.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-08-28 06:48:14 -04:00
Flavio Ceolin
c9641fa5bf drivers: gpio: validate pin in the syscall handlers
Validate pin against the controller's port_pin_mask before entering the
API, and return -EINVAL for anything the controller does not support.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-08-28 06:48:14 -04:00
Anas Nashif
bdaf153ade drivers: gpio: si32: use portable IRQ pending API
Replace the direct NVIC_ClearPendingIRQ() call with
k_irq_clear_pending() and drop the cmsis_core.h include.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-08-27 22:12:17 -04:00
Sergei Ovchinnikov
90fd710d1f drivers: gpio: npm10xx: use mfd configuration function
Centralise the GPIO arbitration and remove duplication. Add initial value
setting based on provided flags.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2026-08-27 22:11:37 -04: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
Bill Waters
7e255fecc4 drivers: gpio: infineon: implement pin_get_config callback
Implement the optional gpio_pin_get_config callback for the CAT1
(gpio_infineon) and PSoC 6 (gpio_psoc6) drivers. The PDL drive mode read
back with Cy_GPIO_GetDrivemode(), together with the HSIOM selection and
the output data register, is translated into the corresponding
gpio_flags_t so a configured pin round-trips through pin_get_config().

Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
2026-08-26 18:09:24 -07:00
Bill Waters
4bca4776c9 drivers: gpio: psoc6: honor GPIO_OUTPUT_INIT_* for single-ended outputs
A single-ended output ignored GPIO_OUTPUT_INIT_HIGH/LOW and always came
up at the released level. Select the initial level from the requested
init flag and fall back to the released level only when neither is set.

Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
2026-08-26 18:09:24 -07:00
Bill Waters
4ce2179187 drivers: gpio: psoc6: bound pin index before forming BIT(pin)
gpio_psoc6_config() formed BIT(pin) without validating pin, so an
out-of-range or absent pin could shift past the port-pin mask. Reject
pin >= the mask width and pins not present in port_pin_mask with
-EINVAL before the mask is used.

Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
2026-08-26 18:09:24 -07:00