Commit graph

20333 commits

Author SHA1 Message Date
Andy Ross
fe5c11db05 boards/mediatek: Add mt8196_adsp
Add Zephyr support for the Audio DSP on the MT8196 SOC.  This is a
very similar device to previous designs.  Most of this patch is just
DTS.

The biggest delta is the more complicated second level interrupt
controller, though it is still able to be represented using some
vaguely clever DTS config over the older intc_mtk_adsp driver.

Also the memory layout is slightly different, requiring a little
indirection to set the initial boot stack address and log output
buffer.  And the timer "irq_ack" register bits moved.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Jan Kuliga
8ba134cea6 drivers: auxdisplay: hd44780: implement busy-flag polling mechanism
HD44780 controller can indicate via busy flag whether it's finished
processing current command. This allows for faster completion of HD44780
commands as seen from MCU perspective, as the MCU doesn't have to wait
for fixed long period of time. Implement this functionality.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
1b784f9892 drivers: auxdisplay: hd44780: rework the initialization procedure
If proper power supply is used to power the hd44780, it initializes
correctly on a reset condition all by itself. However,
if the power supply is below its expectations (e.g. some 3.3V Nucleo
board), it won't initialize properly on its own, and the MCU
has to carry out the initialization as listed in the reference manual.
Since we cannot determine it properly in the runtime,
always carry out the initialization procedure.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
91a14dcc50 drivers: auxdisplay: hd44780: add rs-line-delay dt parameter
In order for the driver to be compliant with the timing sequence
diagrams presented in the reference manual, the MCU has to wait
for some additional period of time while setting both the rs and rw
lines.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
55de1c9719 drivers: auxdisplay: hd44780: get rid of excessive delays
Express delay values in nanoseconds. Set the default delay time values
as specified in the HD44780 reference manual.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
537182a96a drivers: auxdisplay: hd44780: rework auxdisplay_hd44780_command()
Make this function more concise in order to introduce busy-flag polling
mechanism later on.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
e8dc0c6f42 drivers: auxdisplay: hd44780: set rw_gpio line value only once
There's no need to set this line every single time a command is sent
to the HD44780. Set it only once, so that one can save some cpu cycles.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Benedikt Schmidt
760210f39d drivers: fpga: separate drivers of iCE40 for SPI and GPIO bitbang
Separate the current driver for the FPGA iCE40 into two different ones.
One implements only the SPI load mode, the other one only the GPIO
bitbang mode.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-28 15:39:33 +00:00
Sylvio Alves
a7a978a946 drivers: bluetooth: esp32: enable entropy generator by default
As BT now uses PSA crypto API instead of TinyCrypt, entropy generator
is now needed for a proper bluetooth operation.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-28 15:39:08 +00:00
Ian Morris
8e51ebf499 drivers: bluetooth: hci: add hardware reset for da1453x
Add ability to perform a hardware reset of the DA1453x during setup of
the HCI transport.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-28 12:52:01 +01:00
Declan Snyder
7271000fe5 drivers: spi_mcux_lpspi: Clean up DMA path
Clean up DMA path of code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
2c884a9274 drivers: spi_mcux_lpspi: Optimize dma callback
Optimize DMA callback by cleaning up the code and storing less debug
logging strings.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5dbe322c9b drivers: spi_mcux_lpspi: Clean up configure func
Do all input validation etc BEFORE setting up configuration,
instead of mixing these things everywhere. Also condense the formatting
of the code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
b7c35fb569 drivers: spi_mcux_lpspi: Remove rtio prepare_start
Remove unneeded prepare_start function since all uses of it are paired
with the start function. Also, probably should not mess with chip select
before deciding to do the transfer. And just return on some error like
the rest of the driver does instead of assert.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
d6a6b11aac drivers: spi_mcux_lpspi: ErrLog dev in iodev_start
Log the device name and status if the transfer could not start,
same way as in non-RTIO path.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
47115e3afe drivers: spi_mcux_lpspi: Macro for master cfg flag
All the master transfer seemed to use the same config flags,
reuse with a macro.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
561b4347d7 drivers: spi_mcux_lpspi: Clean up next_packet func
Next packet function is way more complicated than it needs to be. Clean
it up by simplifying the code and making readable helper functions.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
af3c25a1f8 drivers: spi_mcux_lpspi: Remove commented code
Remove lines of code that are commented out.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
fa82ec0602 drivers: spi_mcux_lpspi: Remove duplicate bufsetup
This line doesn't need to be in multiple places.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
830c0a9e3c drivers: spi_mcux_lpspi: clean up transceive calls
Move transceive funtions next to each other and clean up the wrapping of
functions to eliminate the ifdefs.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
810b563ea7 drivers: spi_mcux_lpspi: Group API functions
Group the actual API functions to be next to each other.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
595e16caf6 drivers: spi_mcux_lpspi: Consolidate IRQ handle
Small change to consolidate the amount of lines of code in
the spi_mcux_isr by making a macro for the argument and removing
a line of code that was commented out.

Also move the ISR to be the first function in the file which is
common in many other drivers, instead of randomly in the middle of the
file. And move the isr callback to be next to the isr.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
e21bf37f13 drivers: spi_mcux_lpspi: Minor RTIO cleanup
Add closing comment for #ifdef and remove unnecessary
indentation of an else block. Also move the transcieve_rtio
function to be near the other rtio functions. And move function
prototypes to top of file.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5d081c98fb drivers: spi_mcux_lpspi: Create DMA dev helpers
Create helper functions for duplicated code related to
checking for DMA devices, with readable names.

Also remove unneeded function prototype.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
d76ccdbdea drivers: spi_mcux_lpspi: Clean up init function
Do initializations in a more logical order,
remove unnecessarily duplicated code,
reorder stack variables to be in reverse christmas tree order.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5a0d9831b1 drivers: spi_mcux_lpspi: Move init to end of file
Move init function to bottom of file by custom.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
0727566c4a drivers: spi_mcux_lpspi: Remove parent_dev field
Remove parent_dev from config struct, and simplify code for the
definition and use of the irq config function.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
6607976a55 drivers: spi_mcux_lpspi: Organize top of file
Organize #includes and #defines for less redundancy
and more readability.

Shorten some macros to avoid multi line statements.

Add some comments.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Aksel Skauge Mellbye
6d38b24d32 drivers: pinctrl: gecko: Remove cases now handled by DBUS driver
Remove implementation of pin configuration for Series 2 devices.
The silabs,dbus-pinctrl driver should be used instead.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Aksel Skauge Mellbye
f3246cda17 drivers: pinctrl: silabs: Add pinctrl driver for digital bus
Silicon Labs Series 2 and newer devices do alternate function
configuration fundamentally differently from Series 0 and 1. Pin routing
is done in a centralized fashion in the GPIO peripheral, as opposed to
having ROUTE registers in every peripheral. The concept of alternate
function location numbers also does not exist, functions are directly
assigned to GPIOs by their port and pin number.

This commit adds a new pinctrl driver for devices that use DBUS. It fully
makes use of pinctrl design principles as outlined in the Zephyr
documentation. The previous driver hard-codes pin properties such as filter
and pull-up/down in the driver itself, while the new driver leaves this up
to the user as configurable DeviceTree properties. The previous driver has
hard-coded support for UART, SPI and I2C, while the new driver has generic
support for all DBUS signals.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Fabio Baltieri
48cb3a2272 input: ili2132a: check i2c_read_dt return value
Check i2c_read_dt return value in ili2132a_process, fixes a coverity
warning.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/81965
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-27 22:51:16 -05:00
Valerio Setti
1e560e0a45 drivers: entropy: ease runtime requirements on BT HCI
On platforms like nrf5340 there are 2 CPUs:
- one is the cpu_net which takes care of the radio stuff and
  owns the HW random generator
- one is the cpu_app which holds application data and polls
  cpu_net through HCI commands when it needs some random data.

The PSA core implemented in Mbed TLS needs random data at initialization
time, which happens early in the boot process. If we wait for BT to
be ready before issuing the HCI command, then PSA core intialization
will fail. In facts there is no need for the BT to be completely
initialized just to ask for some random data from the cpu_app to
the cpu_net since the HW random generator will likely be already
functional in the cpu_net.
So let's just try the HCI command and, if something is not right,
it will fail anyway. There's no need to anticipate the failure.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Marcio Ribeiro
63ed84240f driver: wdt: esp32: remove incorrect status check inside isr
Reverts incorrect changes introduced by #79821

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-11-27 21:08:07 +00:00
Armando Visconti
a867dbdc47 sensors: lsm6dsv16x: add RTIO async and fifo stream
Add RTIO async and RTIO stream functionalities that enables,
among all the other things, the sensor data streaming from FIFO.

RTIO stream is using both SENSOR_TRIG_FIFO_WATERMARK and
SENSOR_TRIG_FIFO_FULL triggers. The decoder currently only supports
following FIFO tags:

  - LSM6DSV16X_XL_NC_TAG
  - LSM6DSV16X_GY_NC_TAG
  - LSM6DSV16X_TEMP_NC_TAG

Following FIFO parameters has to be defined in device tree to
correctly stream sensor data:

  - fifo-watermark (defaults to 32)
  - accel-fifo-batch-rate (defaults to LSM6DSV16X_DT_XL_NOT_BATCHED)
  - gyro-fifo-batch-rate (defaults to LSM6DSV16X_DT_GY_NOT_BATCHED)
  - temp-fifo-batch-rate (defaults to LSM6DSV16X_DT_TEMP_NOT_BATCHED)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Armando Visconti
01c1e1173f sensors: lsm6dsv16x: add attr_get driver API
Add attr_get() driver API

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Armando Visconti
5bdde779c1 sensors: lsm6dsv16x: save gyro_fs in data
Save gyroscope range set from DT or SENSOR_ATTR in data
structure.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Adam Kondraciuk
2e4cf197c1 drivers: timer: grtc: Add LFPRC as the source of GRTC
This commit allows to switch the GRTC clock source to an RC oscillator.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-27 21:06:20 +00:00
Abe Kohandel
5d5407ee7a drivers: timer: Disable prescalar for TI DM Timer
The timer count calculations are done with the assumption that the
prescalar is disabled. When using u-boot's SPL as an early boot stage,
the omap timer driver enables the prescalar leaving this driver to
calculate incorrect counts. So explicitly disable the prescalar to match
the driver expectation.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2024-11-27 10:39:21 -05:00
Adam Kondraciuk
db290a62f9 drivers: spi: nrfx_spim: set/clear pins retention
Add pins retention control when GPD is enabled for SPIM.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-27 10:39:00 -05:00
Jamel Arbi
70add85f9f drivers: openthread: nxp: Add a HDLC RCP communication
Add a HDLC RCP communication with its hdlc_api interface APIs
and a NXP driver.

Signed-off-by: Jamel Arbi <jamel.arbi@nxp.com>
2024-11-27 10:37:21 -05:00
Fin Maaß
a45e5f0424 drivers: spi: remove unused register
core_mmap_dummy_bits is not used by the
driver and also optional in litex.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-27 06:58:11 -05:00
Josuah Demangeon
217f053ccd drivers: video: controls: rename controls to Linux-like names
This uses Linux V4L2 controls as a reference to give names to the
CIDs. Apply the renaming down to the drivers that use them.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-11-27 10:31:54 +01:00
Jilay Pandya
719cd2639c drivers: stepper: refactor set_actual_position to set_reference_position
This commit refactos set_actual_position to set_reference_position.
stepper_set_reference_position is more apt in regards to what this func
actually does

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-27 10:29:47 +01:00
Gerard Marull-Paretas
f812de2026 drivers: input: gpio_keys: select GPIO
Instead of depending on GPIO. This allows to just enable
CONFIG_INPUT=y + DT node in the application layer. The same
pattern is nowadays followed by most drivers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-27 10:29:04 +01:00
Tomáš Juřena
b4dcdaaeab drivers: sensor: ti: ina230: Fix dts warning if INA230_TRIGGER enabled
Updates the Kconfig condition to support trigger functionality for INA236.
This will get rid of `warning: INA230_TRIGGER (defined at
drivers/sensor/ti/ina23x/Kconfig:43) was assigned the value 'y' but got
the value 'n'.` if INA230_TRIGGER is enabled.

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2024-11-27 08:18:57 +01:00
Vladislav Pejic
04c70d681e driver: sensor: adxl367: Fix for extra 0
Fix for extra 0 in conversion of acceleration values in
adxl367_accel_convert.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-11-26 15:44:31 -05:00
Vladislav Pejic
19fe816f28 driver: sensor: adxl367: Temp conversion
Fix for conversion of temperature values in adxl367_temp_convert
and missing break statement.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-11-26 15:44:31 -05:00
Vladislav Pejic
eb15f306b6 driver: sensor: adxl367: Fix for SPI
Fix for SPI communication when RTIO is used in SPI driver. When in
adxl367_bus_access, const struct spi_buf buf[3] is used,
spi_rtio_copy function won't set correct buffers and length
for buf[2] and that will cause exception when that buffer is
processed.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-11-26 15:44:31 -05:00
Elias Speinle
bc43826703 drivers: fpga: renesas slg471x5: evaluate return value
Eveluate return value of i2c read during verification of
loaded bitstream.

Signed-off-by: Elias Speinle <e.speinle@vogl-electronic.com>
2024-11-26 15:42:57 -05:00
Elias Speinle
676d0c1554 drivers: fpga: renesas slg471x5: correct Kconfig
Correct Kconfig of Renesas SLG471X5.

Signed-off-by: Elias Speinle <e.speinle@vogl-electronic.com>
2024-11-26 15:42:57 -05:00