Commit graph

23353 commits

Author SHA1 Message Date
Ioannis Karachalios
02e739873e drivers: memc: smartbond: Add support for the memory driver class.
Add support for the memory controller by utilizing QSPIC2. The latter is
capable to drive both NOR and PSRAM memory devices. For this to work,
the RAM driving mode is enabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-23 07:51:41 -04:00
Aurelien Jarno
858e8c51f1 drivers: spi: stm32: add runtime PM support
Add runtime power management suppor to the STM32 SPI driver. This allows
the driver to be suspended when not in use, and as a stop effect removes
the need to suspend/resume around each transition to stop mode.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-23 07:50:06 -04:00
Ioannis Karachalios
63eccd3b78 drivers: crypto: smartbond: Add support for PM
This commit should add all the functionality needed for the crypto
driver to work when PM is enabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-23 07:49:37 -04:00
Emilio Benavente
1cc1f248a0 boards: nxp: frdm_ke15z: Add board support for ke15z
Added initial board support for the
frdm_ke15z board.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Signed-off-by: Pavel Krenek <pavel.krenek@nxp.com>
2024-05-22 15:42:48 -04:00
Emilio Benavente
24c1d3ed70 drivers: gpio_mcux: Support shared interrupts
Updating the driver to support multiple
ports sharing a single interrupt.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-05-22 15:42:48 -04:00
Marcin Niestroj
7aa8e2f521 drivers: nsos: fix ENOMEM return from ZFD_IOCTL_POLL_PREPARE
ioctl() API expects error codes to be returned as negative value directly,
instead of using 'errno'. Fix ZFD_IOCTL_POLL_PREPARE handling to respect
that.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-05-22 13:47:32 -05:00
Marcin Niestroj
ea13a70274 drivers: nsos: set errno on failed z_reserve_fd()
Just propagate proper error code, which is the negated return value from
z_reserve_fd().

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-05-22 13:47:32 -05:00
Marcin Niestroj
7cf49cc6f7 drivers: nsos: fix nsos_sendmsg() error code
There is a goto statement with conversion using errno_from_nsos_mid(). Use
NSOS_MID_ERRNO instead of ERRNO to return proper error code.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-05-22 13:47:32 -05:00
Marcin Niestroj
3666b46b2e drivers: nsos: propagate POLLHUP from host's epoll()
This flag is set in case socket was closed, so propagate it as well.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-05-22 13:47:32 -05:00
Alberto Escolar Piedras
0ec5c9c27b drivers/flash/ nrf RRAM: Support simulated targets
In simulated targets the RRAM is not allocated
starting at address 0x0, but on an area allocated
at runtime.
Let's support this, to enable running the
real RRAM driver for simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-22 13:44:54 -05:00
Yong Cong Sin
c211cb347e drivers: sensor: rtio: use catch-remaining for decoding
As new channels are added to the `enum sensor_channel`, some
of the newer channel aren't updated in the whitelist of rtio
decoder.

Instead of specifying every channel in the list, do:
1. Verify that the `channel` is valid
2. cherry-pick the channels that require special handling, i.e.
   1. `three_axis_data`
   2. `byte_data`
   3. `uint64_data`
3. handle the remaining `channel` in the default case as
   `q31_data`

to make sure that all channels are handled.

Updated the pytest to get channel 32, previously nothing would
happen for this channel as there isn't a decoder for it, now
it would return:

```
channel type=32((null))
```

the channel name is NULL because it wasn't added to the channel
name look up table in the sensor_shell.c, that is being fixed
in #72815.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-21 20:55:47 -04:00
Hao Luo
c8ae26549d drivers: i2c: Add support for Apollo3 SoCs I2C
This commit adds support for the I2C which
can be found in Apollo3 SoCs, it can work in
both DMA and non-DMA modes

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-21 20:55:34 -04:00
Aurelien Jarno
2194331431 drivers: sensor: stm32_temp/vbat/vref: ensure the ADC is not suspended
The STM32 temperature, battery and voltage reference sensors needs to
write the ADC common registers to enable the corresponding ADC features.
For that we need to ensure that the ADC is not suspended by using the
pm_device_runtime_get/put methods.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-21 20:53:32 -04:00
Phi Bang Nguyen
f1846eca02 drivers: video: Add NXP MIPI CSI-2 Rx driver
Add driver to support NXP MIPI CSI-2 Rx which is a MIPI CSI-2 receiver
connecting a camera sensor to the NXP CSI. This IP is present in the
i.MX RT11XX series.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-05-21 15:19:52 -07:00
Javad Rahimipetroudi
9d15f6623a driver: led: add support for TI TLC59731 RGB STRIP controller
TLC59731 is a 3-Channel, 8-Bit, PWM LED Driver with
TI Single-Wire interface (EasySet) protocol.

Signed-off-by: Javad Rahimipetroudi <javad.rahimipetroudi@mind.be>
2024-05-21 16:50:24 -04:00
Daniel DeGrasse
13ae32e1c2 drivers: display: st7735r: convert to MIPI DBI API
Convert the ST7735R display to use the MIPI DBI API. Boards and overlays
using this display are also updated.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-21 16:50:08 -04:00
Daniel DeGrasse
b8049b41ae drivers: mipi_dbi: mipi_dbi_spi: require 3 wire mode use 9 bit SPI
Require that SPI config within the MIPI DBI API use 9 bit SPI mode, as 3
wire spi requires the command/data bit be packed into the start of the
SPI packet.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-21 16:50:08 -04:00
Declan Snyder
eeb3e808f5 drivers: nxp: Add reset code to driver inits
Add peripheral reset handling code to driver init for:

- mcan
- i2c flexcomm
- spi flexcomm
- lpc mailbox
- mrt timer

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-21 16:49:42 -04:00
Declan Snyder
399193f54e drivers: reset: Add NXP RSTCTL driver
Add driver for NXP RSTCTL reset controller peripheral.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-21 16:49:42 -04:00
Declan Snyder
1a7d95e26c drivers: reset: Add NXP LPC SYSCON reset driver
Add driver for the peripheral reset control function
of the NXP LPC SYSCON SOC control module.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-21 16:49:42 -04:00
Luis Ubieda
788b985509 i2c: nrfx_twi: Refactor nrfx_twi to utilize common code
Code is refactored to take advantage of common codebase shared with
i2c_nrfx_twi_rtio driver.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-05-21 16:48:00 -04:00
Luis Ubieda
7d5265f610 i2c: Add nRFX TWI RTIO-compatible driver
First version of RTIO-compatible nrfx_twi driver.

Test Setup:
- Board: nrf52840dk
- Test: `tests/drivers/i2c/i2c_ram`
- Additional Kconfig: `CONFIG_I2C_RTIO=y`

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-05-21 16:48:00 -04:00
Henrik Brix Andersen
59402fd82e drivers: sensor: nxp: kinetis: temp: fix memset() length
Use the correct buffer size when calling memset().

Fixes: #73093

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:41:58 -04:00
Henrik Brix Andersen
0a49b788a4 drivers: sensors: nxp: kinetis: temp: select CONFIG_ADC
The NXP Kinetis temperature sensor depends on CONFIG_ADC. Make the driver
Kconfig select CONFIG_ADC to get better CI coverage (enabling the driver
when CONFIG_SENSOR is enabled without depending on CONFIG_ADC=y).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:41:58 -04:00
Ioannis Damigos
b21b50b02b drivers/clock_control: Add build assertion for RC32K
Add build assertion for RC32K to prevent user from
disabling RC32K in DT

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-05-21 18:43:43 +02:00
Ioannis Damigos
ffa5b30c33 dts/bindings/renesas,smartbond-lp-osc: Substitute calibration-interval
Substitute calibration-interval property with kconfig option
SMARTBOND_LP_OSC_CALIBRATION_INTERVAL

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-05-21 18:43:43 +02:00
Ioannis Damigos
4e58ec3202 drivers/clock_control/smartbond: Always calibrate RC32K
RC32K clocks HW FSM. We should always calibrate it.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-05-21 18:43:43 +02:00
Charlie Gilliland
30f72eb0a3 drivers: eth: stm32: fix typo in Kconfig
For the choice ETH_STM32_HAL_API_VERSION, both options
ETH_STM32_HAL_API_V2 and ETH_STM32_HAL_API_V1 had the same
prompt "Use new HAL driver". This commit fixes the prompt for the
legacy driver.

Signed-off-by: Charlie Gilliland <charliegilly1@gmail.com>
2024-05-21 18:43:29 +02:00
Nazar Palamar
879c10d818 soc: infineon: port Infineon SOC to HWMv2
Port Infineon SOC to HWMv2.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-05-21 11:29:49 +01:00
Jun Lin
c864024c32 driver: watchdog: npcx: support longer watchdog timeout
In the current driver, the longest time of the watchdog timeout is ~8
seconds because the pre-scalar is fixed at 32 (WDCP=5). This commit
removes this limitation by dynamically calculating the pre-scalar
according to the watchdog timeout setting from the API.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-05-21 11:15:04 +01:00
Tom Chang
3f8fe6b4b5 drivers: espi: npcx: select RING_BUFFER for p80
This CL adds automatic select CONFIG_RING_BUFFER for port 80 multi-byte.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-05-20 20:52:35 -04:00
Tom Chang
fe138fc246 drivers: espi: npcx: update espi taf driver
This CL updates the read, write, erase, and get_channel_status
implementations of NPCX chip.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-05-20 20:52:35 -04:00
Hao Luo
35aae8b5c1 drivers: watchdog: Add support for Apollo3 SoCs watchdog
This commit adds support for the watchdog which
can be found in Apollo3 SoCs

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-20 20:50:26 -04:00
Aurelien Jarno
52935edc5c drivers: sensor: stm32_temp: use sensor_value_from_float()
The temperature being computed using a float variable, use
sensor_value_from_float() instead of sensor_value_from_double(). This
saves some flash.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-20 20:39:01 -04:00
Yong Cong Sin
1e196f0f75 sensor: sensor_shell: print something when trig command succeeds
Print something to the shell when the `trig` command
completed successfully.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-20 22:56:11 +03:00
Juliane Schulze
72b20315ea drivers: set LIS2DH default trigger mode to "EDGE_BOTH"
Previous value just activated the ability to trigger for both edges,
without (de)-activating the gpio. This caused an assrtion error in GPIO.h.

Fixes #71227

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-05-20 18:05:01 +02:00
Kevin Wang
52284f57ce drivers: counter: fix the bug for atcpit100
Let the callback execute after the interrupt status has cleared.
Because if the callback is executed before the interrupt status
is cleared, it might cause subsequent counter interrupts to fail to
trigger due to the callback function taking too long to execute.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-05-20 15:17:15 +01:00
Jeppe Odgaard
0b94ab7704 drivers: sensors: add veaa_x_3 proportional pressure regulator sensor
Add driver for Festo VEAA-X-3 series proportional pressure regulator.

The driver assumes that the maximum ADC value matches the maximum
output from the device, and that the maximum DAC value matches the
maximum input value for the device. External hardware is probably
required between the ADC/DAC and the device.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-05-18 15:56:09 +03:00
Björn Stenberg
63c8b950e5 voltage_divider: Add support for single-ended 16-bit ADC
Unless configured as differential, the raw ADC data is unsigned.

Includes workaround for #71119.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2024-05-18 15:55:02 +03:00
Declan Snyder
938050c7ce drivers: lpuart: Fix async configure
Fix async configure function not being called
when the irq driven api is not used, which
both causes a build warning and would not
work at runtime.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-18 15:50:11 +03:00
Tomasz Moń
f4e95ccd48 drivers: udc_dwc2: Properly revive STALLed endpoints
DWC2 documentation unfortunately assigns somewhat confusing semantics to
endpoint "enable"/"disable" and "activate"/"deactivate". The Zephyr USB
device stack endpoint enable/disable refers to DWC2 activate/deactivate.
The DWC2 endpoint enable/disable actions can be loosely referred to
Zephyr USB stack enqueue/dequeue.

Rename the functions and rework internal working to match DWC2
Programming Guide. This makes endpoint halt work as expected by the
stack and therefore fixes all classes that rely on correct STALL
handling. Most notable STALL user is the Mass Storage class.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-18 13:24:26 +02:00
Tomasz Moń
00e2b86708 drivers: udc_dwc2: Process SETUP stage when allowed
DWC2 programming guide mentions that SETUP can only be processed by
application after DOEPINTn.SETUP interrupt. Not respecting this
requirement makes setting Global OUT NAK hang while waiting for
GOUTNAKEFF interrupt until the host starts next control transfer.
Global OUT NAK is necessary if the application ever wants to properly
cancel any ongoing transfer.

Change the processing to comply with the programming guide.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-18 13:24:26 +02:00
Tomasz Moń
fa912f4389 drivers: udc_dwc2: Add missing register bit defines
Add missing GINTSTS, GRXSTSR and DEPCTL bit defines based on nRF54H20
register map.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-18 13:24:26 +02:00
Phi Bang Nguyen
95657e3312 drivers: video: Add ov5640 camera driver
Add driver to support ov5640 camera sensor

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-05-17 14:50:56 -05:00
Abderrahmane Jarmouni
4d038fb523 drivers: rtc: stm32: fix error handling
re-enable Write Protection when Init Mode errors.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-05-17 14:47:05 -05:00
Ioannis Karachalios
6f0476eb77 drivers: rtc: smartbond: Update RTC driver
This commit should fix the followings:
1.  When an alarm event is initialized, the driver should only
    consume the valid alarm fields, based on the given mask.
    Otherwise, the driver should use default valid subfield
    values.
2.  Setting an alarm event should not return with error code
    if the timer and/or calendar counters have yet to be
    initialized, explicitly. Instead, a log warning should be
    issued.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-17 14:46:11 -05:00
Ioannis Karachalios
b8836ab94a drivers: display: smartbond: Acquire power rail when using PM
The power rail of a peripheral block should always be
acquired/released before/after its employment even if
it's known that it should already be up and running.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-17 14:42:24 -05:00
Johann Fischer
715e4ce6f3 drivers: udc_dwc2: prevent access to registers if USBHS is not ready
On USBHS, we cannot access the DWC2 register until VBUS is detected and
valid. Kernel event API is used to block if a valid VBUS signal is not
present when the user tries to force usbd_enable().

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 14:05:08 +01:00
Johann Fischer
acd2fa7972 drivers: udc_dwc2: fix interpretation of NUMDEVEPS and INEPS fields
The NUMDEVEPS field provides the number of endpoints in addition to the
control endpoint. It is used to iterate over GHWCFG1 register value to
get correct number of configured IN/OUT endpoints. To get it correctly,
we need to use it internally as number including control endpoint.

Interpretation of INEPS misses +1 because value 0 means 1 IN endpoint
and so on.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 14:05:08 +01:00
Johann Fischer
b117155320 drivers: udc_dwc2: add vendor quirks to support Nordic USBHS controller
Add vendor quirks to support Nordic USBHS controller.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 14:05:08 +01:00