Commit graph

18367 commits

Author SHA1 Message Date
Yong Cong Sin
4e7168028b sensors: shell: use SENSOR_CHANNEL_3_AXIS whenever possible
Instead of specifying 3 axis channels manually, use
`SENSOR_CHANNEL_3_AXIS` instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-24 07:49:27 -04:00
Yong Cong Sin
eb37b8620b sensor_shell: fix hang when device is not a sensor
If `CONFIG_SENSOR_INFO` is enabled, use the `sensor_info`
section to validate that the argument is a sensor before using,
otherwise the shell command will hang the application.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-24 07:49:27 -04:00
Yong Cong Sin
e879cd0502 sensor_shell: fix assertion due to NULL pointer deref
The `SENSOR_CHAN_VSHUNT` was added in #60717 but was never
added to the `sensor_channel_name[SENSOR_CHAN_COMMON_COUNT]`
table. Since the length of `sensor_channel_name` is fixed to
`SENSOR_CHAN_COMMON_COUNT`, this means that the index at
`SENSOR_CHAN_VSHUNT` points to `NULL`. When we use the
`sensor get` command for anything bigger than
`SENSOR_CHAN_VSHUNT`, we will deref that `NULL` pointer
when we do `strcmp` in the for-loop of `parse_named_int`.

Fix this by defining `SENSOR_CHAN_VSHUNT` in the table.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-24 07:49:27 -04:00
Ioannis Karachalios
62f8f160ad drivers: entropy: smartbond: Optimize driver PM
This commit should optimize the way the device is allowed
to enter the suspended state. Instead of returning a PM
error code to abort the PM process, the standby power state
is constrained as long as the device is not allowed to enter
suspension. With that approach, acquiring PD_SYS is not needed
when in PM device runtime mode.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-24 07:48:41 -04:00
Ioannis Karachalios
71a5f1b9fd drivers: display: smartbond: Optimize driver PM
This commit should optimize the way the device is allowed
to enter the suspended state. Instead of returning a PM
error code to abort the PM process, the standby power state
is constrained as long as the device is not allowed to enter
suspension. With that approach, acquiring PD_SYS is not needed
when in PM device runtime mode.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-24 07:48:41 -04:00
Ioannis Karachalios
2958f691bb drivers: mipi_dbi: smartbond: Optimize driver PM
This commit should optimize the way the device is allowed
to enter the suspended state. Instead of returning a PM
error code to abort the PM process, the standby power state
is constrained as long as the device is not allowed to enter
suspension. With that approach, acquiring PD_SYS is not needed
when in PM device runtime mode.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-24 07:48:41 -04:00
Krzysztof Chruściński
af3c8b973e drivers: timer: nrf_grtc_timer: Fix for random system hangs
d599e2b670 removed early return from sys_clock_timeout_handler if
current counter value is less than cc_val. It seems that this return is
needed as after the removal some stress tests which were using system
timers heavily started to hang.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-24 07:47:29 -04:00
Luis Ubieda
4ae093eaf0 drivers: i2c: nrfx_twi_rtio: Minor indentation fixes
Not necessarily related to the namespacing changes, but just
establishing proper indentation formatting throughout the whole file.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-05-24 07:46:27 -04:00
Luis Ubieda
98c121d262 i2c: nrfx_twi_rtio: Establish proper namespacing in driver
To clearly distinguish between common code and RTIO-only code
on nrfx_twi and nrfx_twi_rtio.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-05-24 07:46:27 -04:00
Mike J. Chen
3656c1b14c spi_nor: remove unneeded enter_dpd() at end of spi_nor_configure()
This block of code was in the original commit that added
CONFIG_SPI_NOR_IDLE_IN_DPD but later modifications
added acquire_device() and release_device() calls
earlier in spi_nor_configure() and the release_device()
function will have already done the enter_dpd().

Signed-off-by: Mike J. Chen <mjchen@google.com>
2024-05-23 11:53:45 -04:00
Hao Luo
d7afd88e71 drivers: counter: Add support for Apollo3 SoCs counter
This commit adds support for the counter which
can be found in Apollo3 SoCs

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-23 11:52:37 -04:00
Jérémy LOCHE - MAKEEN Energy
0af906a533 gpio: imx: Added IRQ lock for RMW operations
The GPIO API performs unprotected RMW operations that
can cause glitching and race conditions when GPIOs are used by
different threads or ISRs.

Signed-off-by: Jérémy LOCHE - MAKEEN Energy <jlh@makeenenergy.com>
2024-05-23 11:51:51 -04:00
Phi Bang Nguyen
ea02b93eea drivers: video: csi: Add support for i.MX RT11XX
On i.MX RT11XX which has MIPI CSI-2 Rx, image data from the camera sensor
after passing through the camera pipeline (MIPI CSI-2 Rx --> Video Mux -->
CSI) will be implicitly converted to a 32-bits pixel formats. For example,
an input in RGB565 / YUYV (2-bytes format) will become an XRGB32 / XYUV32
(4-bytes format), respectively. Make changes to support this.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-05-23 07:52:09 -04:00
Ioannis Karachalios
e1772409ce drivers: clock_control: smartbond: Add support for the memc driver.
1. Update the clock control driver so it can update timing settings for
   QSPIC2 following system clock transitions (translated based on
   AHB AMBA bus clock).
2. Remove the QSPIC related subroutines and use the respective HAL API
   which is now available.
3. Add support for PM (CONFIG_PM_DEVICE). This is required as QSPIC2
   register file is powered by PD_SYS which is turned off during device
   sleep and so registers contents are lost (in contrast to QSPIC which
   is used to drive the flash memory).

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-23 07:51:41 -04:00
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