Commit graph

1572 commits

Author SHA1 Message Date
Wilfried Chauveau
c0139fad06 drivers: gpio: mmio32: update gpio_mmio32 to behave like other divers
The current implementation requires SoCs/Boards to manualy instantiate
the preripherals and initilize them.

The change lets Zephyr rely on the device tree setup to instantiate &
initialize the relevant gpio peripheral.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2025-02-14 10:42:02 +01:00
Andrew Featherstone
06be6ebf3a drivers: gpio_rpi_pico: Add gpio_get_config API
Implement the `gpio_get_config`

N.b. adding this API results in a new test failure in
`test_gpio_config_trigger`. This suggests that there is some kind of
dependency between this and the now-enabled `pin_get_config` test cases.
Note that this adds a read-only API, it is unlikely to be the cause of
the failure.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-02-14 03:19:59 +01:00
Andrew Featherstone
c1b69710a1 drivers: gpio_rpi_pico: Add gpio_port_get_direction API
THe driver didn't implement this API, so add it.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-02-14 03:19:59 +01:00
Andrew Featherstone
91c4c4363e drivers: gpio_rpi_pico: Add gpio_get_pending_int API
Implement `gpio_get_pending_int`.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-02-14 03:19:59 +01:00
Andrew Featherstone
608e6a30b1 drivers: gpio_rpi_pico: Disable inputs when not in use
Reorder gpio_rpi_configure to disable input buffers when not in use.
gpio_rpi_get_config can then determine whether a pin is configured as an
input without requiring additional state variables, as well as reducing
input leakage current.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-02-14 03:19:59 +01:00
Andrew Featherstone
27c41b42c1 drivers: gpio_rpi_pico: Support GPIO_DISCONNECTED flag
Out of reset the pads are input enabled, output disabled. Disconnect the
pad's input and output buffers, as well as any pullups. This can reduce
input leakage current.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-02-14 03:19:59 +01:00
Steven Chang
7b3596faaa driver: gpio: ene_kb1200 gpio initial level
Change initial level from POST_KERNEL to PRE_LERNEL_1,
Config suport voltage and driving flags

Signed-off-by: Steven Chang <steven@ene.com.tw>
2025-02-14 00:44:57 +01:00
Tom Hughes
65b4e594d7 drivers: gpio: pca95xx: Remove unused functions
Building with clang warns:

drivers/gpio/gpio_pca95xx.c:256:19: error: unused function
'update_input_reg' [-Werror,-Wunused-function]
static inline int update_input_reg(const struct device *dev, uint8_t pin,
                  ^

drivers/gpio/gpio_pca95xx.c:120:12: error: unused function
'read_port_reg' [-Werror,-Wunused-function]
static int read_port_reg(const struct device *dev, uint8_t reg,
           ^             uint8_t pin,

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-13 16:42:35 +01:00
TOKITA Hiroshi
1db7d3c35a drivers: gpio: renesas_ra: Do not clear pin config in int-configure
In the current implementation, when `gpio_ra_pin_interrupt_configure`
is executed, the existing settings made by `gpio_ra_pin_configure`
are erased.
A read-modify-write method will be used to preserve the settings.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-02-13 06:39:08 +01:00
TOKITA Hiroshi
79130a73be drivers: gpio: renesas_ra: Add support for GPIO_GET_CONFIG option
Enable retrieval of pin configuration information.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-02-13 06:39:08 +01:00
Pieter De Gendt
61bfb4dba4 drivers: gpio: Wrap driver instances in device API macro
Use the device API macro to place the driver API instance into an iterable
section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-02-12 16:06:25 +01:00
Jaro Van Landschoot
0085b34e02 drivers: gpio: gpio_stm32: add gpio speed
The driver already read the speed flags (cfr. ospeed) and called
LL_GPIO_SetPinSpeed, but these flags could not be set yet.

Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
2025-02-12 12:31:40 +01:00
Jérôme Pouiller
4291a6633f drivers: gpio: Introduce support for SiWx91x
Implement GPIO driver for Siliconlab SiWx917 family.

This driver support high Performance (HP), Ultra Low Power (ULP) and
Ultra Ultra Low Power (UULP) GPIOs.

Co-authored-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Lucien Zhao
3636182a0a drivers: gpio: gpio_mcux: remove including fsl_gpio.h file
There is no need to include sdk gpio driver.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-02-10 22:27:34 +01:00
Tim Lin
608d94b869 drivers/gpio: ite: Validate num_pins to prevent untrusted loop bound
Added a build assert to limit num_pins to a maximum allowable value to
prevent potential out-of-bounds access or infinite loops.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-02-08 10:09:20 +01:00
Tim Lin
db0f20c6fb drivers/gpio: ite: Modify the format to comply with check_compliance.py
Modify the format to comply with check_compliance.py.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-02-08 10:09:20 +01:00
Jiafei Pan
7a100c9b28 drivers: gpio: add driver for PCA6416 IO expander
The PCA6416A is a 16-bit general purpose I/O expander that provides
remote I/O expansion for most microcontroller families via the I2C-bus
interface.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-02-08 00:31:28 +01:00
Vebjorn Myklebust
4b63ef0e5a drivers: gpio: Add support for cc23x0 GPIO
Add support for GPIO to cc23x0 SoC.

Signed-off-by: Lars Thalian Morstad <l-morstad@ti.com>
Signed-off-by: Vebjorn Myklebust <v.myklebust@ti.com>
Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Signed-off-by: Julien Panis <jpanis@baylibre.com>
2025-02-04 11:56:05 +01:00
Fabio Baltieri
3a66b3853e drivers,test: use the new DT_FOREACH_PROP_ELEM_SEP
Use the new DT_FOREACH_PROP_ELEM_SEP macro instead of
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(...)).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-02-04 09:18:55 +01:00
TOKITA Hiroshi
460d9fad89 drivers: gpio: rpi_pico: Not support GPIO_DISCONNECTED config
If GPIO_DISCONNECTED is requested with gpio_pin_configure,
it will return -ENOTSUP since rpi_pico does not support it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-02-03 19:50:43 +01:00
Jamie McCrae
560db8509a drivers: kconfig: Fix bleeding options
Fixes a multitude of Kconfigs that wrongly appear on devices
where support is literally impossible

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-31 11:50:12 +01:00
Terry Geng
cbcb2d8f12 drivers: adc: ads1x4s0x: Rename files, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
43079c8086 drivers: adc: ads114s0x: Rename variables, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Benjamin Cabé
ab9a2f52ba drivers: gpio: npm2100: properly handle I2C write return value
properly check return code from i2c_reg_write_byte_dt effectively
making it possible for gpio_npm2100_port_set_masked_raw to error out since:

if (ret != 0U) {
	return ret;
}

was dead code before this fix.

Fixes CID-444376

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-30 16:20:45 +01:00
James Roy
e9a5b48b6c drivers: gpio: Fix uninitialized variable in gpio_pca_series
Fix uninitialized val variables scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-01-28 23:41:19 +01:00
Guillaume Gautier
6602896520 drivers: gpio: stm32: add support for stm32n6
Add GPIO support for STM32N6

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-01-28 18:14:45 +01:00
Khoa Nguyen
b6b5b6031f drivers: gpio: Fix bug for gpio driver Renesas RA
Get build error when using a gpio port that has port_irq_names
property isn't defined. This commit aim to fix this bug.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-01-28 07:57:03 +01:00
Alain Volmat
5d6101ec4b driver: gpio: mfxstm32l152: add driver for STM32L152 based MFX
Initial commit for a STM32L152 based GPIO expansion chip.
The mfxstm32l152 driver offers GPIO controller fonctions.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-01-24 19:15:46 +01:00
Pieter De Gendt
f1c4760304 drivers: Update APIs to use DEVICE_API macro
Some drivers APIs were not wrapped using the DEVICE_API macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-24 01:15:19 +01:00
Sven Ginka
4dcaa82537 drivers: gpio: add gpio support for sy1xx
Add gpio support for sensry soc sy1xx.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-01-21 09:12:55 +01:00
Guillaume Ranquet
b52f5cbef9 drivers: gpio: add MAX22017 gpio support
MAX22017 is a DAC with support for 6 GPIOs

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
2025-01-21 07:07:33 +01:00
Aksel Skauge Mellbye
5645adb251 drivers: gpio: gecko: Simplify device support
Simplify the distinction between Series 0/1 and Series 2.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-20 16:34:50 +01:00
Samuel Chee
8d6d4de79d boards: arm: mps2: Add support for mps2/an383
Added new mps2 board an383 to enable testing with ARM FVP.
Qualifier to build/run is mps2/an383

Signed-off-by: Samuel Chee <samche01@arm.com>
2025-01-20 11:15:32 +01:00
Igor Knippenberg
a35fee8592 driver: gpio: mcp23xxx: increase reset pin pulse duration
The reset pulse is currently fixed at 1 µs, the minimum required for
the chip. However, a long reset pin trace can increases rise time, making
1 µs potentially insufficient for reliable detection of a reset signal.
Increase the pulse duration to 2 µs

Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
2025-01-17 20:07:02 +01:00
Henrik Brix Andersen
7fec3d7f12 soc: atmel: samx7x: refactor SoC support for the Atmel SAM E70/V71
Refactor and merge the SoC support files for the Atmel SAM E70 and SAM V71
product series. These SoCs are part of a larger product family (SAM
E70/S70/V70/V71) and share a common set of peripherals.

Support for the two remaining product series (SAM S70/V70) is not part of
this refactoring as these will require further additions to the Atmel HAL.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-01-16 22:39:25 +01:00
Lucien Zhao
87e4db9b86 drivers: gpio: update gpio_mcux.c driver
update gpio driver to adapt rt7xx gpio model:
1. There is no PORT_Type on RT7xx,so set PORT_Type as void
2. Add port_no parameter in gpio_mcux_config to adapt IOPCTL driver
3. Add gpio-port-offest parameter in blinding, it will help map the
   relation between index n and gpio port when some soc have domain
   access attribution.
3. Splite gpio_mcux_configure function into two functions(
   gpio_mcux_iopctl_configure and gpio_mcux_port_configure)
   according to CONFIG_PINCTRL_NXP_IOCON macro
4. Add code to adapt RT700 GPIO attribute configuration

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-14 17:56:53 +01:00
Lucien Zhao
7f64d8f214 drivers: gpio: format gpio_mcux.c
use clang-format to format gpio_mcux file

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-14 17:56:53 +01:00
Lin Yu-Cheng
2656029c3a driver: gpio: Add gpio driver initial version of RTS5912.
Add gpio driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Stoyan Bogdanov
9b194e1d33 drivers: gpio: Remove logically dead code for MAX149x6
Remove logically dead code detected from Coverity.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-01-09 08:20:55 +01:00
Scott Worley
f51729aada drivers: gpio: mec5: Microchip MEC5 HAL based GPIO driver
Add a GPIO driver for the Microchip MEC5 HAL based chips.
Current devices are: MEC174x, MEC175x, and HAL version of
MEC172x named MECH172x.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2024-12-23 17:11:22 +01:00
Immo Birnbaum
fef27d8231 drivers: gpio: xlnx_ps: switch driver over to DEVICE_MMIO mapping
Set up a named device MMIO memory mapping in the GPIO controller's
parent device, map the virtual memory in the init function of the
parent device.

Once the controller's register space has been successfully mapped,
propagate the mapped virtual address to all child (= GPIO bank)
devices. While it is possible to add a named mapping to every
single GPIO bank device and initialize it in the respective bank
device's init function, this would result in multiple virtual
address mappings all pointing to the same 4k of physical memory.
I assume that, although all those mappings having the same attri-
butes, such a setup is at least discouraged.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2024-12-19 19:56:23 +01:00
The Nguyen
69735397bd drivers: gpio: add support for gpio interrupt on Renesas RA family
First commit to add support for gpio interrupt on Renesas RA
- Add support for external interrupt driver
- Add support for gpio interrupt config

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2024-12-19 08:39:10 +01:00
Jun Lin
3727d2ed72 driver: gpio: npcx: use CONFIG_GPIO_LOG_LEVEL
This commit replaces the hard-coded log level with
CONFIG_GPIO_LOG_LEVEL.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-12-19 04:18:34 +01:00
Yishai Jaffe
5694b24a6e soc: silabs: Add support for SiLabs EFR32ZG23 SoC
Add support for Silicon Labs EFR32ZG23 SoC.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-18 20:32:46 +01:00
James Roy
3cf4347c15 drivers: gpio: Fix unchecked return value in gpio_pca_series
Fix unchecked return value scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-12-18 15:31:33 +01:00
Mikhail Siomin
36bbd67653 drivers: gpio_pca95xx: add pins initialization to default state
After a non-power reset (wdt) pins may remain in non-default state.
To ensure that a system initialization is the same after any reset,
it is necessary to initialize pins to the default state.

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
2024-12-18 08:32:15 +01:00
Jiafei Pan
55f0b87143 drivers: gpio: mcux_igpio: add MMIO mapping support
Map MMIO memory by using DEVICE_MMIO_NAMED_x() APIs.

And some platforms has no soc.h, so use __has_include to check it
firstly.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-12-18 08:31:52 +01:00
Stoyan Bogdanov
92aeb787c7 drivers: gpio: max22190: Add MAX22190 octal input with diagnostics
Add max22190 gpio driver with input functionality, since device
support only input without output.

Implemented diagnostic functionality for all 8 channels
which include various check to over/under voltage and wire break.
Filtering configuration is done from devicetree on per channel
bases and is configured on chip start.

In case some fault condition occure FAULT pin drive LOW which
prop to FAULT registers to be read. Data is stored in data structure
for furter analizes and ERR message is printed in console.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2024-12-18 03:04:46 +01:00
Pieter De Gendt
a0eb112774 drivers: Move device driver APIs into iterable sections
These device driver APIs were merged after the DEVICE_API macro was
introduced.
Cleanup these leftover drivers.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-17 02:02:54 +01:00
TOKITA Hiroshi
29fe58f7a4 drivers: gpio: mcp23xxx: Fix to allow the use of multiple models
Compilation will fail if multiple models are used at the same time.
Changing to define different unique names for the symbols
to avoid conflicts.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-16 13:09:38 +01:00