The previous implementation incorrectly calculated the source pointer
advancement when pitch differs from width. The calculation was using
`total_bytes_sent` which accumulated across iterations, leading to
incorrect pointer arithmetic.
Replace `total_bytes_sent` with `line_each_sent` to track lines written
per iteration. Simplify the pointer advancement by:
- Calculating complete lines written from bytes_written
- Advancing by full pitch-sized lines
- Adding any remaining partial line bytes
This fixes the source pointer calculation when the buffer pitch is
greater than the display width.
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
In commit 1f9e39752a ("drivers: watchdog: wdog32: add delay before
init") a reference to k_msleep was added to
drivers/watchdog/wdt_mcux_wdog32.c without including the necessary
header. At least for the board frdm_mcxw71/mcxw716c, this causes a
compile failure in this file as soon as CONFIG_WATCHDOG is enabled.
Add the missing include to zephyr/kernel.h to fix the issue.
Signed-off-by: Matthias Blankertz <matthias.blankertz@inovex.de>
Due to the hardware limitation, the time between the CPU wake-up IRQ fire
(IRQ 23) and the next call of LL_RADIO_TIMER_SetCPUWakeupTime should not
be less than 16 MTU (Machine Time Unit), i.e. approximately 30us.
otherwise, the next CPU wake-up doesn't happen unless the timer wraps.
Lock IRQs while sys_clock_set_timeout is being executed.
Remove HAL_RADIO_TIMER_WakeUpCallback and it will be implemented
differently in the future.
Remove HAL_RADIO_TIMER_TimeoutCallback as it is not needed anymore.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Change the initialization priority. According to the documentation, kernel
services should not be used during device configuration with PRE_KERNEL_1.
In "entropy_stm32_rng_init", there is "start_pool_filling" which calls
"k_work_schedule". Moreover, "k_work_schedule" requires system timer which
is initialized within PRE_KERNEL_2. Therefore, the SoC gets stuck.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Add PM device support for the LPI2C peripheral.
Implement PM device callback to gate and ungate the device clock
during suspend and resume. No attach register save and restore as
it's preserved by hardware
Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
The condition `!spi_context_rx_buf_on(ctx) && spi_context_rx_on(ctx)`
only returns early when RX is active with a NOP buffer.
However, when `rx_len == 0`, `spi_context_rx_on(ctx)` returns false,
causing the early return to be skipped.
This leaves `ctx->rx_buf` (which can be NULL) to be dereferenced.
Since `lpspi_handle_rx_irq()` already guarantees `spi_context_rx_on(ctx)`
is true before calling this function, only check
`!spi_context_rx_buf_on(ctx)` to safely handle NOP buffers.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Refactor `lpspi_rx_buf_write_words()` to compute `words_read` upfront
using `MIN(rx_len, max_read)`, simplifying control flow and making
the read limit explicit without changing behavior.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Allows a mixture of IRQ-enabled and IRQ-disabled nodes.
Enabled nodes are identified by the presence or absence of
the interrupt-names property.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add explicit clock configuration and enable calls during driver
initialization.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Add clock_control_configure() call during initialization to properly
configure the TPM clock. The driver now attempts to configure the
clock and handles cases where configuration is not supported by the
platform (-ENOTSUP/-ENOSYS) by continuing with default settings.
Real configuration errors are logged and cause initialization to fail.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and save quite a bit of flash.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The return value of gpio_pin_set_dt() and
gpio_pin_interrupt_configure_dt() was not stored before being
checked, causing the error condition to always evaluate to false.
Store the return value and properly handle potential GPIO errors
during PHY reset.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The ls0xx driver VCOM inversion thread has a hardcoded priority of 3,
while in some applications this may be considered lower priority than
time sensitive tasks, maintaining close to an even polarity balance is
best, but this change allows developers to determine the approach.
Signed-off-by: Eden Uhde <eden@rainbowtree.house>
For devices like MCXE247, the FTM peripheral instance
has multiple interrupts. In this patch, add FTM_CONFIG_FUNC
macro to support single or multiple interrupts based on irq
number.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
This commit adds support for the Parade Tech TMA525B capacitive touch
controller. The driver supports both interrupt-driven and polling modes,
and can handle up to 4 simultaneous touch points.
Key features:
- I2C communication interface
- Multi-touch support (up to 4 touch points)
- Interrupt mode with GPIO callback support
- Polling mode with timer
- Power management support with PM notifier
- Reset and power control via GPIO
- Touch event tracking (down, contact, up)
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
- The RX Message Descriptor in CANXL on newer SoC such as
the S32K5 supports receiving both classic and FD frames,
so enable the RX FIFO only for S32ZE SoC.
- The CANXL bare-metal driver has significant changes, the
current codebase for S32ZE need to be guarded and modified
to support newer SoC
- Expand the peripheral region to 1G to include the CANXL
area.
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
Add support for named clocks in the WDOG32 driver to properly handle
different clock sources. The driver now uses clock-names property to
identify which clock source is being used, based on the clk-source
property.
This change enables proper clock configuration and control for platforms
where the clock frequency is not statically defined in the device tree.
The driver will now configure and enable the appropriate clock during
initialization.
Updated all affected device tree files to include the clock-names
property aligned with their clk-source configuration.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
When using shell the users input raw header as big-endian, so, add
support for both formats for the magic number.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Split DMA status error from busy state handling. Use LOG_DBG for
busy state and LOG_ERR for status query failures. Return -EBUSY
as required by async UART API when transfer is in progress.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
`edma_reload_loop` doesn't take into account the DMA possible channel
gap. This is an issue for S32K3 series leading to system crashes when
higher DMA channels are used.
Signed-off-by: Razvan Heghedus <razvan.heghedus@protonmail.com>
Initialize mclk_control_base,
mclk_pin_mask, mclk_pin_offset as 0
and skip mclk settings when
there is no property pinmuxes.
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Only st,stm32-dcmipp is described and only st,stm32n6-dcmipp
was used within the driver to decide if CSI / PIXEL_PIPES
are available. Instead of this, look at HAL provided macros
to know if the selected soc has the functionalities or not.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Create infrastructure for shared USB common code on STM32 family, and move
the Power Controller configuration logic to common code. This removes some
midly unrelated code from the UDC driver while enabling reuse by a future
UHC driver implementation for STM32.
While at it, clean up the migrated code.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add implementation of the Infineon PSoC4 TCPWM-based counter driver.
- Provides basic counter operations
including start, stop, read, and set alarm.
- Supports configuration and initialization through Device Tree.
- Enables alarm callback handling for
precise time-based event generation.
Signed-off-by: Deepika R <deepika@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
- Decouple interrupt settings from gpio drivers, making them configured
and handled independently by tint and ext_irq drivers.
- Remove device-specific hardware definitions in gpio_renesas_rz.h and
take advantage of pinctrl data type and dtsi for certain series.
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Added a condition to check trigger type as high-level detection is not
supported by Renesas RZ external interrupt.
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
phy_tja11xx_get_link_state() always returns 0, making callers' error
checks ineffective.
Remove the unused return variable and drop the dead conditional in
invoke_link_cb() to silence static analysis warnings and simplify
the code.
No functional change.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Handle both multicast packets and promiscuous mode in the driver. This
will allow the lan9250 to be added to a bridge as well as process
multicast packets being received.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
The bus recovery implementation did not reset the I2C block. If
a glitch on the bus looks like a start condition, the I2C block
will be stuck forever waiting for the associated stop. This adds
reset to the I2C block to address this type of error.
Signed-off-by: Tim Knodel <tbk@google.com>
On STM32F446, F469, F479 and on STM32F7x, the CK48M mux can have either
PLL Q or PLLSAI P as input. Adds the support for the PLLSAI P input in
the driver.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>