i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Move the assignment of the callback function and user data within the mutex
lock when adding CAN RX filters to prevent race conditions.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Remove useless asserts. These indexes are determined via a for loop which
already uses the asserted value as its maximum.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add support for configuring the SysTick clock source via devicetree
using a new `clock-source` property. This allows selecting between
the external reference clock (0) and the processor clock (1).
Previously, the driver always set the CLKSOURCE bit, forcing the use
of the processor clock. This change introduces a helper function
`systick_ctrl_clksource_flag_from_dt()` that reads the devicetree
property and returns the appropriate CTRL register flag.
The CTRL register is now programmed deterministically using direct
assignment instead of `|=` to ensure the CLKSOURCE bit is properly
cleared when switching to external clock, preventing potential
interrupt storms when CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC reflects
the external clock rate.
If the property is absent, the driver defaults to legacy behavior
(processor clock).
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Add support for handling a gpio connectd to the device enable pin, this
has to be driven high to enable the device, and can be pulsed low to
reset the registers to the default configuration.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The LCD_CAM peripheral is a parallel I/O controller integrated in the ESP32
series. It consists of an LCD output module and a DVP camera input module.
The camera side is already supported in Zephyr as a video driver.
This commit adds support for the LCD module by implementing it as a
MIPI-DBI backend. The LCD_CAM supports multiple output formats, and the
initial implementation provides I8080 mode.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Move the shared pinctrl and clock initialization for the LCD_CAM peripheral
from the ESP32 DVP driver into a new SoC-level implementation.
Update the ESP32-S3 DTS to reflect the new structure by introducing an
`lcd_cam_dvp` child node under the common `lcd_cam` parent node.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Rename the ESP32 LCD_CAM DVP driver and its DT binding from
`espressif,esp32-lcd-cam` to `espressif,esp32-lcd-cam-dvp` to clearly
identify it as the DVP (camera) input block of the LCD_CAM peripheral.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
GPIO hardware in Microchip MEC parts is the same except for the MUX
field (number of alternate functions). We modify the old XEC PINCTRL
driver to work on all MEC parts and also be independent of HAL and
CMSIS register structures. During development we found a DT issue
with DT_ENUM_IDX_OR always inserting the default value. Worked around
by converting slew rate and drive strength to YAML integer type and
created defines for the values in the dt-bindings header.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Enabled async read function for NXP SAR ADC driver by implementing
nxp_sar_adc_read_async() and modifying nxp_sar_adc_read() to call it
with a NULL signal for synchronous operation.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Allow alarm_cfg->ticks to be 0 for immediate callback execution.
When ticks equals 0, set the interrupt pending instead of returning
-EINVAL, causing the ISR to fire immediately.
Implementation:
- Add irq_set_pending()/irq_is_pending() helpers for NVIC and GIC
- Store IRQ number in device config for pending operations
- Refactor timer state handling to eliminate duplication
- Update get_pending_int() to check both HW flags and NVIC/GIC state
This supports idle timer use cases where sleep duration may be zero
and eliminates the need for special-case handling in application code.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Add device tree property to configure LPTMR free-running mode instead
of hardcoding it to disabled.
The freerunning property controls counter reset behavior:
- If false (default): Counter resets after compare match
- If true: Counter resets only on overflow, continues after compare
This allows per-instance configuration of the LPTMR timer mode based
on application requirements without code changes.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
set_sequencer() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
gpio_pin_set_dt() return value was not assigned when pulling the
reset GPIO high, making the subsequent error check always false.
Store the return value to properly detect and report failures.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This commit introduces support for the mspi and ospi drivers on STM32,
enabling functionality APIs for MSPI/OSPI/QSPI host controllers..
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
set_iir_config() dereferences the device pointer before checking it
against NULL, making the defensive check ineffective.
Remove the redundant check.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This driver uses math functions that require the math.h header. If not
included a lot of implicit declaration warnings are generated during
build.
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Since the STM32MP2 I3C controller uses a combined interrupt line for I3C
events and errors, add the support for handling this type of interrupt
in the I3C driver.
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Implement eeprom_target_program() using eeprom_target_write_data() and
eeprom_target_read() using eeprom_target_read_data() to limit redundant
code.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The current functions to access the EEPROM data are not ideal, E.G.:
- eeprom_target_program() is hard coded to write to the beginning of the
EEPROM data
- eeprom_target_read() reads a single byte, so large overhead to read all
data
So as an alternative, add an interface similar to what is provided by
zephyr/drivers/eeprom.h, E.G. functions taking an offset and and length.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
For some use cases it can be interesting to know when the eeprom has been
written to by the I2C host (E.G. once a stop has been received after a
write transaction), so add a "changed" callback.
Multiple EEPROM instances are supported, so pass the device and user data
as arguments to the callback.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
When transceive is called on a chip without CONFIG_SPI_STM32_INTERRUPT,
spi_stm32_shift_frames was called even if there was no transfer ongoing.
This lead to an unwanted SPI transfer shifting the whole connection,
causing drivers to malfunction.
Fix it by replacing the do-while loop with a while loop.
Signed-off-by: Robyn Milas <robyn.milas@valotec.com>
Until now transmission FIFO was not used.
With this chamge the FIFO will be filled up, until it is full.
Signed-off-by: Daniel Fladerer <d.fladerer@gmx.de>
Commit e7f222a fixed the bug where a data size mismatch produces unexpected
behavior with the DMA on V1 devices. However, this limitation is only valid
for the STM32 series with V1 DMA, V2 doesn't have this. The STM32CubeMX
configuration tool correctly implements this limitation in the UI,
it is a good way to cross-check.
Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>
Add property to enable eMIOS instances to reference a global timebase
provider, either from itself or another eMIOS instance, enabling
synchronized timing operations across multiple instances.
Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
- Flash configuration was previously done in the driver selected by
Kconfig. Instead move flash configuration to the board removing
the need for ifdefs in the driver. This will allow boards to
configure specifics related to the on board (not part of the SoC)
flash.
Signed-off-by: Merin George <merin.george@infineon.com>
The current "drop" command stops i2s asynchronously as the peripheral
produces/consumes up to MAXCNT. When complete, the IRQ STOPPED event
will free memory and disable the peripheral. However, when triggering
a "start" command before this completes, the internal state variables
are cleared and we leak application memory.
Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
The nRF TDM Driver has a bitfield containing the TDM events it has
already processed. This variable is unused, delete it.
Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>