Commit Graph

1407 Commits

Author SHA1 Message Date
Gerard Marull-Paretas 56c5b1e2da drivers: gpio: nrfx: add support for ports with pad on FAST_ACTIVE1
This patch allows to _safely_ configure GPIO ports that have their pad
on FAST_ACTIVE1 domain.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-01 12:10:12 -05:00
Hao Luo 022c8ee1af drivers: gpio: ambiq: fix port status get error
It's not possible to get pinconfig of specific pin
in ambiq_gpio_port_get_raw function, change to use
OR value of RD and WT registers for one group of gpio.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-10-29 09:34:30 -07:00
Nils Bosbach 94baef654c drivers: gpio: gpio_iproc: fix reg write
The sys_write32 function expects a value as the first parameter and the
memory location where the value should be written as the second parameter.

Signed-off-by: Nils Bosbach <bosbach@ice.rwth-aachen.de>
2024-10-25 14:04:35 +02:00
Hao Luo 8b107ab5f1 drivers: i2c: add bus recovery
Added bus recovery support for ambiq i2c

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-10-22 20:40:29 +02:00
Benedikt Schmidt acbc14e767 drivers: gpio: implement parallel mode in TLE9104
Implement the parallel mode in the powertrain switch TLE9104.
This allows that OUT1 and OUT2 are controlled together, as well
as OUT3 and OUT4.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-10-17 15:38:45 -04:00
Emilio Benavente 82a192c8a9 boards: nxp: Removing CONFIG_PINCTRL from the boards defconfig
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-10-15 19:09:45 -04:00
Stoyan Bogdanov 3ca5cf50fe drivers: gpio: Add MAX14916 industrial output
Industrial 8 channel output with advanced diagnostics.
Allowing giagnostic configuration both on per channel or global bases
In SPI communication diagnostic status transmitted on every
READ/WRITE which includes generic status of chip.
Diagnostics includes :
 * Oveload
 * Open Wire
 * Over current
 * Short to VDD
 * Thermal Shutdown
 * VDD Warn
 * Watch Dog Error
 * Communication Error
 * VDD under voltage

Add app.overlay for MAX14916 driver.

Tested with adopted basic/blinky example.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2024-10-08 17:01:44 +02:00
Stoyan Bogdanov 71149fd47a drivers: gpio: Add MAX14906 industrial input/output
MAX14906 in 4 channel I/O with advanced diagnostic.
In SPI communication diagnostic status transmitted on every
READ/WRITE which includes generic status of chip.
Configuration both on global level and on per channel bases.
Diagnostics includes :
 * Thermal overload
 * current limit
 * open wire detection
 * short to VDD
 * Above VDD
 * Safe DEmagnitization fault
 * VDD warning
 * VDD low
 * SPI/CRC Error
 * WDog Error
 * Loss GND

Add app.overlay for MAX14906 driver.

Tested with adopted basic/button and basic/blinky sample.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2024-10-08 17:01:44 +02:00
TOKITA Hiroshi 1400ee713a drivers: gpio: rpi_pico: Fitting for the changes made in pico-sdk 2.0.0
Following the GPIO interface changes in pico-sdk 2.0.0.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-08 06:01:23 -04:00
Yong Cong Sin 52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
TOKITA Hiroshi 5fe5126913 driver: gpio: rt1718s: Create a log module with LOG_MODULE_REGISTER
Since the log module entity is not defined anywhere,
LOG_MODULE_REGISTER should be used here instead of LOG_MODULE_DECLARE.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-30 09:04:58 +02:00
TOKITA Hiroshi 01d3312d07 drivers: gpio: emul: Fixed return type of get_pending_int
`get_pending_int` should return a uint32_t value as defined in
`struct gpio_driver_api`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-30 09:04:58 +02:00
Sreeram Tatapudi 5c0275df27 drivers: gpio: ifx: Update GPIO driver to use PDL instead of HAL
Update the GPIO driver to use PDL API instead of HAL API to fix the
issue with configuring interrupts on both edges

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-09-26 03:32:13 -04:00
Jeroen Broersen cf837dd371 drivers: gpio: stm32: keep track of clock enabling per pin
The driver enables the clock of a gpio-port if any of the
pins use the port. This is done by calling pm_device_runtime_get
when a pin is used and pm_device_runtime_put when the pin is not
used anymore.
These calls needs to be balanced. But if a single pin was configured
as GPIO_DISCONNECTED multiple times, every time pm_device_runtime_put
was called.
This caused the clock of the port to be stopped and therefore also
other pins on the same port stopped working.

This commit fixes this by keeping track of which pin on a port
has requested the clock and only call pm_device_runtime_get or
pm_device_runtime_put when the clock-request for the specific pin
changes.

Fixes #77698

Signed-off-by: Jeroen Broersen <jbroersen@interact.nl>
2024-09-23 13:20:23 -05:00
Chew Zeh Yang 62c0fc3e14 drivers: gpio_ambiq: Fixed uninitialized return variable
Fixed uninitialized return value variable issue, which would cause
functions to wrongly return non-zero value despite a successful
execution.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-09-23 10:01:40 +02:00
Chekhov Ma c93a5de3ae drivers: mcux_igpio: improve pin-gaps handling
Improve handling of "pin-gaps" using "GPIO_DT_RESERVED_RANGES_NGPIOS"
series macro.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-20 15:18:49 -05:00
Chekhov Ma a296705d37 drivers: mcux_rgpio: improve pin-gaps handling
Improve handling of "pin-gaps" using "GPIO_DT_RESERVED_RANGES_NGPIOS"
series macro.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-20 15:18:49 -05:00
Keith Short 9d999149e3 drivers: gpio: stm32: Fix compiler warning
The local function ll_gpio_get_pin_pull() is not always referenced.  Add
the __maybe_unused attribute to avoid compiler warnings (which may be
promoted to errors by downstream users).

Signed-off-by: Keith Short <keithshort@google.com>
2024-09-17 14:58:57 -04:00
Mathieu Choplain 263b03feeb drivers: gpio: stm32: add support for STM32WB0
Adds support for the STM32WB0 series in the existing STM32 GPIO driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-12 10:03:37 +02:00
Pisit Sawangvonganan 847a4eaad2 style: drivers: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-11 07:40:35 -04:00
Chekhov Ma e79507b5e3 drivers: gpio: pca_series: handle byteorder
Add byteorder handling to support big-endian machine.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma d45497e4c8 drivers: gpio: pca_series: add api to get per-port register size
This commit add get per-port reg size api to make it more clear to
understand the design.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma 5253eb1692 drivers: gpio: extend pca_series driver to pca953x and pca955x
This commit extends pca_series gpio driver to devices pca9538, pca9539,
pca9554 and pca9555.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma ac2d8993cc drivers: gpio: add pca_series gpio expander driver
There are numbers of drivers for different PCA(L) series chip. They
share similiar register layout and control logic. This driver intends
to unify these drivers for PCA(L)xxxx series i2c gpio expanders.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Benedikt Schmidt 4b657f7a2c drivers: gpio: implement possible manual reset of PCAL64XXA
Implement an option manual reset of the PCAL64XXA to allow the external
implementation of a retention of the port expander state.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-11 09:35:37 +02:00
Benedikt Schmidt 74476c45b0 drivers: gpio: extract method to apply initial state of PCAL64XXA
Extract method which applies the initial state in the driver
for the port expander PCAL64XXA.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-11 09:35:37 +02:00
Neil Chen 4af2180731 drivers: gpio_mcux: update gpio_mcux driver for MCXA156
Fix compiler warning issue(unused variable 'config',
uninitialized variable 'int_status')

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -04:00
Sylvio Alves 8233b70ece espressif: clean up unused code
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-09 13:55:39 -04:00
Hao Luo b532a3ea7f boards: ambiq: apollo3: add connector dtsi for apollo3 boards
Added connector dtsi files for apollo3_evb and apollo3p_evb,
and ran gpio_basic_api to test, all cases pass

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-08-29 18:06:07 +02:00
Mathieu Choplain e4a7c0f9ce drivers: intc: stm32: rebrand EXTI API to be hardware-agnostic
This commit rebrands the STM32 EXTI API to a more hardware-agnostic
"GPIO interrupt controller" API, in anticipation of the introduction of
new series lacking the EXTI peripheral. The GPIO and EXTI drivers are
updated to match the rebranded API.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain 5cd274ce48 drivers: intc: stm32: make stm32_exti_line_t opaque
This commit makes the contents of the stm32_exti_line_t data type opaque to
the EXTI GPIO interrupt controller API users. The GPIO driver is updated
to comply with this API change.

N.B.: while some assertions are removed as part of this commit, they were
broken since forever anyways, so nothing of value is lost.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain 0551825ca3 drivers: gpio: stm32: move EXTI line port configuration to proper driver
Move the functions that interact with EXTI configuration registers to
select or get the GPIO port that triggers events on a given EXTI line
to the EXTI driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain d34f5f27bf drivers: gpio: stm32: move EXTI clock initialization to proper driver
Move the EXTI clock initialization from GPIO to EXTI driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain d0f528e933 drivers: gpio: stm32: modify EXTI configuration functions
Modify all functions in the GPIO driver that interact with the EXTI
so that names, signatures and comments match what they do better.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain ea09463b7f drivers: gpio: stm32: use types with correct semantics
Use the `gpio_pin_t` type for all variables that hold a pin number (0..15).

Change all `int` to `uint32_t` instead, as signedness is unwanted.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain 988ccae7a5 drivers: intc: stm32: use unsigned types for API
This commit changes the EXTI driver API to use unsigned types
for all parameters previously typed as `int`, as the signedness
is unneeded and unwanted.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Pisit Sawangvonganan 2f4ca35105 drivers: gpio: renesas_ra_ioport: simplify pin configuration logic
- Removed zero initialization of `pincfg` structure as all members
  are guaranteed to be set.
- Introduced `pfs_cfg` as an intermediate variable to store data in
  the CPU register instead of stack.
- Simplified pin setting logic by relying on `pfs_cfg` being
  zero-initialized, eliminating the need for explicit bit clearing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-26 17:23:31 -04:00
Michael Zimmermann 2ab246d17e drivers: gpio: Add initial SiM3U1xx support
This is just the driver for banks 0 to 3. Bank 4 will come via a
separate commit since it needs a different driver.

Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
2024-08-26 18:51:36 +02:00
Raffael Rostagno 90c6106926 drivers: esp32: Interrupts flags configuration
Allows configuring interrupts flags in the device tree for
ESP32 devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Raffael Rostagno bb746cdcc5 drivers: esp32: esp_intr_alloc return condition
Add checks to return value of esp_intr_alloc to avoid drivers init
returning 0 when interrupt allocation fails.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Raffael Rostagno 0b3a34cdca drivers: esp32: Interrupts priority configuration
Allows configuring interrupts priority in the device tree for
ESP32 devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Pisit Sawangvonganan 6718ba6841 drivers: gpio: renesas_ra_ioport: improve device instantiation macro
Introduced `GPIO_DEVICE_INIT_RA_IF_OKAY` which utilizes `COND_CODE_1`
to reduce the chain of #if DT_NODE_HAS_STATUS(...) #endif

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-22 09:12:52 +02:00
Pisit Sawangvonganan 1bcae0ea9f style: drivers: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-20 10:33:51 +02:00
Benedikt Schmidt d7fa28bf72 drivers: gpio: improve logging of PCAL64XXA
Improve logging of the driver for the port expander PCAL64XXA.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-08-20 10:31:27 +02:00
Ioannis Damigos 782967a1e3 gpio_smartbond: Fix port_set_masked_raw
Writing directly to Px_DATA_REG modifies pins which are not
indicated by mask, causing gpio_basic_api test to fail.

Use Px_SET_DATA_REG and Px_RESET_DATA_REG to modify only
pins indicated by mask.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-08-19 17:23:18 -04:00
Ioannis Damigos 82d17f1f2c gpio_smartbond: Remove pdc entry only if it exists
Remove pdc entry only if index exists when CONFIG_PM
is set.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-08-19 17:23:18 -04:00
Ioannis Damigos df86860319 gpio_smartbond: Set pin to input when it is configured as GPIO_DISCONNECTED
Set pin to input with no resistors selected when it is configured as
GPIO_DISCONNECTED.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-08-19 17:23:18 -04:00
Duy Phuong Hoang. Nguyen 922ee61b8d drivers: gpio: Update gpio driver for Renesas RA series
Background of this modification is to make gpio driver code
provided by Renesas vendor to be an official support for Renesas
MCU on Zephyr

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-08-19 09:59:27 -04:00
Raffael Rostagno cc2e0f2131 drivers: gpio: esp32c2: Add support
Add gpio support to ESP32C2 and ESP8684

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-16 14:08:22 -04:00
Lucien Zhao ad0a066f4f drivers: gpio: update rgpio driver code
RGPIO model on RT1180 is same with igpio, however,
current driver can't support.

Update gpio driver to support gpio pad control

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-08-15 14:51:02 -04:00