Commit graph

23353 commits

Author SHA1 Message Date
Miguel Gazquez
26be1da3e7 drivers: sensor: add driver for lsm9ds1 sensor
The LSM9DS1 is a system-in-package featuring
a 3D digital linear acceleration sensor, a 3D digital angular rate
sensor and a 3D digital magnetic sensor.

This driver implements only the linear acceleration sensor and the
angular rate sensor, on the I2C bus.

This driver is without trigger support.

The driver is based on the stmemsc HAL.

link: https://www.st.com/resource/en/datasheet/lsm9ds1.pdf

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2024-07-29 14:21:24 +02:00
Tomasz Leman
44464c4d4f drivers: dai: intel: ssp: Introduce DMA control set API
This commit adds a new API function, `dai_ssp_dma_control_set`, to the
Intel SSP DAI driver. This function is designed to set DMA control
parameters specifically for the SSP interface.

The addition of this API function allows for more granular control of
DMA settings, which can be beneficial in scenarios where DMA
configuration needs to be modified independently of other DAI settings.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-07-29 14:20:18 +02:00
Tomasz Leman
5084decbc4 drivers: dai: intel: ssp: Refactor TLV parsing into a separate function
Refactor the TLV parsing code from the dai_ssp_parse_aux_data function
into a new, separate function called dai_ssp_parse_tlv. This change
improves the modularity of the code and allows for the TLV parsing logic
to be reused in other contexts where only TLV data needs to be parsed
without the entire configuration blob.

The new dai_ssp_parse_tlv function takes a pointer to the TLV data and
its length as parameters, enabling it to process a buffer containing
multiple TLV entries. The original dai_ssp_parse_aux_data function is
now simplified to prepare the TLV data and call the new parsing
function.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-07-29 14:20:18 +02:00
Daniel Kampert
73c05e2079 drivers: rtc: Add support for Micro Crystal RV-8263-C8
Remove redundant code

Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
2024-07-29 14:19:47 +02:00
Daniel Kampert
37d6bc0827 drivers: rtc: Add support for Micro Crystal RV-8263-C8
- Add Micro Crystal RV-8263-C8 RTC driver

Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
2024-07-29 14:19:47 +02:00
Bjarki Arge Andreasen
372c7183ef modem: pipe: Add explicit timeout to sync APIs
The modem pipe APIs include synchronous calls to open/close,
which internally use a fixed timeout of 10 seconds. The timeout
should be configurable through the APIs, anywhere from K_NO_WAIT
to K_FOREVER.

This commit adds timeout parameters to the open/close APIs, and
updates in-tree usage of the open/close APIs to explicitly
provide the previously implicit timeout of 10 seconds.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-07-29 14:14:42 +02:00
Sreeram Tatapudi
eebc998a5a drivers: flash: Support for IFX QSPI Flash driver
Initial version

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-07-29 14:14:10 +02:00
Jordan Yates
5f3ff52b6b gnss: gnss_u_blox_protocol: fix typos
Fix several typos in define names.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-29 14:12:53 +02:00
Tomasz Moń
f0677e5a3b drivers: udc_dwc2: Respect maximum fifo depth
When dynamic fifo sizing is enabled the driver can assign fifo size
lower or equal to the reset value. Software must respect the maximum
sizes because fifo width registers are optimized during synthesis and
the larger values simply get discarded.

Use 16-bit values for FIFO depths because maximum FIFO depth the vendor
can configure the DWC2 otg is 32768.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-07-29 14:12:02 +02:00
Jiafei Pan
fa9a131029 drivers: clock_control: mcux_ccm_rev2: add ENET clk for imx93
Add ENET clock support in the ccm driver for imx93.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-07-28 07:31:32 +03:00
Saravanan Sekar
c143cbaa7c drivers: crypto: use reset api for crypto peripheral reset
Replace direct HAL api by zephyr reset api framework for crypto
peripheral block reset.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2024-07-28 07:31:25 +03:00
Dean Sellers
dfe7cb58cb drivers: ethernet: enc28j60: Add DT property to set random mac
Use the DT property zephyr,random-mac-address to set a boot time
random mac address.

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
2024-07-28 07:30:39 +03:00
Sadik Ozer
915ce7548a drivers: trng: Add TRNG driver for MAX32xxx MCUs
Added TRNG driver for MAX32xxx MCUs

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-07-28 07:30:20 +03:00
Kacper Dalach
52197b515a drivers: eth: native_posix: if_name from cmd line
Iface name which is used by native posix ethernet driver can only be
specified at compile-time. I wanted to run two instances of the same
program on native posix but did not want to make two separate builds only
to change the iface name. I have implemented getting the iface name from
command line.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2024-07-28 07:30:02 +03:00
Cong Nguyen Huu
f9dddbe0ac drivers: nxp_s32_canxl: improve CANXL error report
Update to enable CANXL_INT_RXSMB_OVER and
CAN_INT_ERR_FAST(ERR for CAN-FD).

Statistic CAN errors and count CAN TX and RX errors via
BCANXL that uses CANXL MRU to exchange informations with CAN host.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2024-07-28 07:29:39 +03:00
Hao Luo
6ed058887e drivers: spi: simplified spi_ambiq_xfer function
Simplified spi transfer process to make it more readable

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-07-28 07:29:28 +03:00
Hao Luo
8379f64393 drivers: bluetooth: hci_ambiq: get the spi cfg from the device
Use the SPI configuration from the SPI device for data transaction.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-07-28 07:29:28 +03:00
Hao Luo
3faaaaba59 drivers: spi: Change to use software controlled cs in default
Added support for software controlled cs in Ambiq SPI drivers

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-07-28 07:29:28 +03:00
Kacper Dalach
32eb346e05 posix: can: if name from command-line
This commit introduces the ability to set the CAN
interface from command-line. This is helpful
if we want to run multiple instances of the app
with different CAN interfaces without making
separate compilations for each instance.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2024-07-27 20:49:38 +03:00
Pieter De Gendt
ad63ca284e kconfig: replace known integer constants with variables
Make the intent of the value clear and avoid invalid ranges with typos.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-27 20:49:15 +03:00
Pisit Sawangvonganan
a2e0b1d366 drivers: serial: remove '&' when assigning init_fn
Remove address-of operator ('&') when assigning `init_fn`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/serial`, ensuring that all function pointer assignments
follow the same pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-27 20:48:34 +03:00
Stefan Petersen
840e93fd60 drivers: flash: spi_nor: Print flash size properly when < 1 MiByte
When using SPI-NOR SFDP autodeteection, the flash size printed to
the log is rounded to 1 MiByte. If flash is smaller than 1 MiByte
it is printed as 0 MiByte.

With this patch smaller flash sizes are printed in kiByte, for instance
512 kiByte is printed correctly.

Signed-off-by: Stefan Petersen <spe@ciellt.se>
2024-07-27 20:47:39 +03:00
Fabio Baltieri
32fafc7176 input: analog_axis: add output inversion
The driver right now only allows inverting the input value, which can be
useful for differential channels but is quite confusing for single ended
ones. Implement a simple output inversion flag instead to make up for
that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-27 20:47:18 +03:00
Chun-Chieh Li
f77023e649 drivers: hwinfo: add NuMaker support for device id
Add device id for Nuvoton NuMaker series

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-07-27 15:19:23 +03:00
Jordan Yates
5e2a4bca06 disk: flashdisk: init in POST_KERNEL
Initialise flashdisk devices in `POST_KERNEL` instead of `APPLICATION`.
This aligns with the other disk drivers, which are all `POST_KERNEL`,
and causes no problems as `disk_access_register` is a purely software
action and does not perform any operations on the underlying device.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:19:14 +03:00
Jordan Yates
9cb58cf53a disk: flashdisk: default enable if dts exists
Enable `DISK_DRIVER_FLASH` by default if the devicetree node exists, as
the other disk drivers do.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:19:14 +03:00
Jordan Yates
6bd77c848c disk: use standard DT kconfig dependencies
Use `depends on DT_HAS_* default y` instead of `default y if DT_HAS_*`
as the driver depends on devicetree instance.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:19:14 +03:00
Ryan McClelland
ec41afaa5d drivers: i3c: add KConfig to perform rstact during bus init
Sometimes, performing a rstact which will reset all devices during init
on the bus may not be ideal. Add a KConfig to easily turn off.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-07-27 15:18:18 +03:00
Andreas Klinger
dda519d48c drivers: gnss: remove dangerous loop
When ubx_m10_ubx_cfg_rst is returning something negative there is a loop
in the code which in turn can easily turn into an endless loop if the
function is never returning something positive or zero.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2024-07-27 15:17:52 +03:00
Andreas Klinger
a1eb11bb59 drivers: gnss: remove sleep during init
It's not allowed to sleep during initialization of driver as called by
bg_thread_main --> z_sys_init_run_level(INIT_LEVEL_POST_KERNEL)
               --> do_device_init  -->  ubx_m10_init

There is no thread_base.timeout struct setup so far.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2024-07-27 15:17:52 +03:00
Andreas Klinger
7c8033f8d8 drivers: gnss: cleanup function returning
Cleanup more returns and gotos as they are redundant.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2024-07-27 15:17:52 +03:00
Andreas Klinger
f89f2ae46c drivers: gnss: clean up labels
Clean up labels no longer needed.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2024-07-27 15:17:52 +03:00
Andreas Klinger
8d8fe9d169 drivers: gnss: fix setting of baudrate
ubx_m10_init_pipe is calling modem_backend_uart_init which in turn is
memsetting the backend data structure and thus also overwrites the work
queue function pointer in it.

Remove call to ubx_m10_init_pipe as data structures are already set up.

Tested with u-blox NEO M9N.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2024-07-27 15:17:52 +03:00
Fabio Baltieri
03f1dd413d input: paw32xx: only reschedule the handler if motion is asserted
The motion event handler is currently setup to always retrigger until
there's no more motion data from the sensor. Change that to only
retrigger if the motion pin is asserted when the handler has finished
running, this saves a bunch of unnecessary spi transactions.

Ideally this driver would use a level interrupt, but I'd rather avoid
that as that is unsupported by many gpio controllers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-27 15:17:38 +03:00
Jordan Yates
7b18cc112c flash: nrf_qspi_nor: don't auto call pm_device_runtime_enable
Device drivers should not be calling `pm_device_runtime_enable` on
themselves, it should be left up to the application. If automatic
enablement is desired, `zephyr,pm-device-runtime-auto` exists as a
devicetree property.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:16:23 +03:00
Jordan Yates
0b935295c6 flash: nrf_qspi_nor: remove PM_DEVICE_RUNTIME guards
The `pm_device_runtime_get` and `pm_device_runtime_put` functions work
correctly regardless of whether `PM_DEVICE_RUNTIME` is enabled or not.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:16:23 +03:00
Jordan Yates
db87eface2 flash: nrf_qspi_nor: remove excessive semaphore
The `count` semaphore was being used as an atomic counter, so replace
it with an atomic variable, which is a simpler solution and enables
removing the conditionals with `PM_DEVICE_RUNTIME`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:16:23 +03:00
Jun Lin
51cfbd8c5f drivers: espi: host_subs: npcx: fix LDN register definition of PMCH
The register offset definition of the I/O port Data Base Address
register (0x60, 0x61) and Command/Status Base Address register
(0x62, 0x63) are reversed. This commit fixes it to avoid confusion.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-07-27 15:15:22 +03:00
Flavio Ceolin
5822267c23 serial: uart_async_rx: Avoid possible division by zero
Ensures that config->but_cnt is not zero.

Fixes #66800
CID #338107

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-07-27 15:14:26 +03:00
Emanuele Di Santo
271ef88e05 drivers: mbox: nrf_bellboard: only clear events that raised the IRQ
The current implementation is such that if two or more events are
generated in quick succession, only one is handled. This would
have happened as follows.

At the beginning of the ISR, the contents of INTPEND are read.
Then, the ISR unconditionally clears all events that are set.

When two (or more) events are generated in rapid succession,
it may happen that by the time we enter the ISR, INTPEND is set
only for one event, but while we process the ISR, EVENTS_TRIGGERED
will be set for more than just that one event (more events are
generated).

By unconditionally clearing all events, we can potentially lose
all events that are generated during ISR processing.

This patch changes the ISR so that it only clears those events
that have a corresponding bit set in INTPEND at the time it is read.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2024-07-27 15:13:45 +03:00
Fin Maaß
da090f1cb9 drivers: ethernet: phy: phy_mii: use no-reset option
the dts binding of the ethernet-phy has the option
"no-reset" and the according driver already has the
right logic to make use of it, but unfortunately
the connection between them was missing.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:12:49 +03:00
Declan Snyder
9f56ff5d64 drivers: mdio: Clear interrupt signal in ISR
Apparently, disabling the intterupt is not enough,
because without clearing the flag, some errors are occurring.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-27 15:10:42 +03:00
Tom Burdick
5474b611cb icm42688: Fix divide by zero potential
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-07-27 15:10:27 +03:00
Fin Maaß
27aa4bc988 drivers: ethernet: add get_phy function
add get_phy function to the ethernet drivers.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 15:07:26 +03:00
Fin Maaß
ba5b4ae817 drivers: flash: spi_nor: doc: correct comment
the durations in the spi_nor_config struct
are in milliseconds not in microseconds.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-07-27 10:48:33 +03:00
Ryan McClelland
919d908d73 drivers: i3c: shell: add i2c scan command
This adds a workaround command to perform an I2C scan on
an I3C bus.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-07-27 10:46:50 +03:00
aab5730d0f drivers: mipi_dbi: reduce the RAM overhead
Constify the config and reorder the data fields for better packing.
This reduces the RAM usage of `mipi_dbi_spi` by 20 bytes.

Signed-off-by: Michael Hope <mlhx@google.com>
2024-07-27 10:45:34 +03:00
Ian Morris
a6a27aa43e drivers: sensor: tmp116: Add ability to set conversion averaging mode
Adds support for setting the number of conversion results that are
collected and averaged before updating the temperature register.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-07-27 10:45:01 +03:00
Gerard Marull-Paretas
a0da850497 drivers: i3c: common: add reference to address restrictions
This makes actions taken by the code easier to follow for newbies like
me.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 10:42:14 +03:00
Gerard Marull-Paretas
ba0ccae924 drivers: i3c: common: improve slot bit position code readability
Perform the modulo operation on `bitpos` before using it. This should
make code slightly more clear.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-27 10:42:14 +03:00