Use the new scc driver in the uart for the m48x numicro soc.
This removes quite a lot of calls into the nuvoton BSP and replaces
them with functions using the clock driver.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
This code snippet was originally removed by #109163 but then incorrectly
re-introduced by #107850 (most likely due to a rebasing error).
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The default initialization priority of 79 causes the cellular modem
driver to initialize before the network stack (priority 90). Set the
default to 91 to ensure the modem initializes after the network stack
is ready.
Signed-off-by: Povilas Selevicius <povilas.selevicius@quadigi.com>
Adds the CSG MFD driver for the Infineon HPPASS block. The CSG contains
five slices containing a DAC and comparator. This MFD owns the combined
comparator interrupt and manages dispatches to each child comparator
device.
Assisted-by: Github Copilot:claude-opus-4.7
Signed-off-by: John Batch <john.batch@infineon.com>
Most STM32 platforms do not have CONFIG_GPIO enabled by default.
Some tests, such as tests/drivers/disk/disk_access, require this
configuration to be enabled; otherwise, an error like "device API
is not gpio" occurs when testing SDMMC.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Correct stm32 I2C driver that did not report failure and left a semaphore
taken on some bus runtime configuration failures.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
- Create a dummy codec stub driver for testing and development purposes.
- Implemented dummy functions to satisfy the audio codec sample
- Add an audio_codec node and alias to the native_sim.dts
- Add Kconfig option
- Create a dts binding for the dummy stub
Assisted-by: GitHub Copilot:GPT-5.4
Signed-off-by: Tomas Barak <tomas.barak@nxp.com>
The WUU driver supports:
- External pin wakeup sources with configurable edge detection
(rising, falling, or any edge) and event types (interrupt, DMA, trigger)
- Internal module wakeup sources with interrupt and DMA event types
- Up to 32 external pins and 9 internal modules
- Recording and checking of triggered wakeup sources
- Integration with the WUC (Wakeup Controller) subsystem
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Replace direct ethernet context manipulation with new
net_eth_set_if_type_wifi() API across all Wi-Fi drivers.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
I2S_TRIGGER_DRAIN was setting state to I2S_STATE_STOPPING but never
actually stopping the hardware, so LRCK and BCLK continued toggling
indefinitely after the trigger.
Wait for the current DMA buffer to finish (tx_ready_sem) before
calling am_hal_i2s_dma_transfer_complete and am_hal_i2s_disable.
Signed-off-by: Sofian Elmotiem <sofianelmotiem@gmail.com>
inst_idx was set to the DT probe index n instead of the hardware
module index. On Apollo510, if only i2s1 is enabled, n=0 but the
HAL needs 1. am_hal_i2s_initialize ends up on the wrong hardware
block while the ISR and DMA stay wired to i2s1, so the ISR never
fires and the clocks on the wire are wrong.
Fix: derive the hardware module index from the interrupt number
relative to i2s0, matching the pattern in other Ambiq IOM drivers.
i2s_data_format and i2s_io_config were module-level globals mutated
by configure() on every call. Multiple instances stomp each other,
and a single instance carries stale fields across re-configure calls.
Fix: move both structs into i2s_ambiq_data and copy from const
defaults at the top of configure().
Signed-off-by: Sofian Elmotiem <sofianelmotiem@gmail.com>
Implement the counter guard-period callbacks for the MCUX LPTMR alarm
configuration so late absolute alarms can be detected instead of being
silently skipped by users of the generic counter API.
Absolute alarms now compare the requested tick against the current
counter value and return -ETIME when the target is inside the late
window. The late check is disabled when the guard period is zero,
preserving the counter API contract that zero means no protection.
Convert accepted absolute alarms to relative compare values using the
LPTMR counter top value, so targets around wrap are treated consistently
with the counter API absolute-alarm semantics.
If COUNTER_ALARM_CFG_EXPIRE_WHEN_LATE is set, the driver keeps the
alarm active and pends the interrupt so wrappers such as rtc_counter
can treat the late alarm as an immediate expiry.
Keep the non-alarm configuration returning -ENOSYS for guard-period
setup, since that mode still reserves the compare register for
top-value operation.
Tested on frdm_mcxa153 with tests/drivers/counter/counter_basic_api
using CONFIG_COUNTER_MCUX_LPTMR_ALARM=y, the same test with the LPTMR
alarm option disabled, and tests/drivers/rtc/rtc_api using a temporary
zephyr,rtc-counter node backed by lptmr0.
Also validated the review case with a temporary app that sets an
absolute tick-0 alarm while stopped. With guard period 0 the alarm API
returns 0 and fires the callback; with a nonzero guard period it returns
-ETIME and fires the callback when EXPIRE_WHEN_LATE is set.
The LPTMR late-alarm counter tests now run instead of being skipped,
and the RTC API suite passed 5/5 with PROJECT EXECUTION SUCCESSFUL.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Add helper code meant to be easily integrated into palette-backed display
drivers so that they can "automagically" expand their accepted input
formats to include RGB565 and RGB888, and automatically dither them down
to I_4 palette format.
Assisted-by: Copilot:gpt-5.4
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add helpers for the SCMI Reset Domain Management protocol and a Zephyr
Reset Controller driver that utilizes these helpers.
The update introduces protocol helper functions, a new driver,
relevant Kconfig and CMake entries, and device tree bindings.
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
Replace LL_UCPD_Init() usage, which requires building the LL UCPD `.c`
file, with plain variables and LL calls for portability. `uint8_t` is
used for lower footprint.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Use the clock control API to enable the peripheral clock instead of
relying on LL_UCPD_Init().
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The lfclk_spinwait implementation is partially based on
k_cpu_atomic_idle() to idle the CPU while waiting for LFCLK events
if in ISR or in pre kernel. This implementation is fragile and
complex given k_cpu_atomic_idle() is a nop if in ISR, reducing it to
a polling check, and that IRQs are masked globally in pre kernel which
conflicts with the expected use of k_cpu_atomic_idle(), signified by
the need for manually calling NVIC_ClearPending().
This commit refactors the code to use a polling check, sleeping if
possible between checks. This simplifies the wait, without loosing
support for no multithreading since k_msleep() is available even
without threads.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Currently, restrict_tx_outside_tsp is false by default, and with that,
the NWP may transmit data during TWT sleep time. Many APs do not support
this also should not be the default behavior.
Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
Add support for the ESP32-H2 SuperMini development board, a compact
board based on the ESP32-H2 RISC-V SoC with Thread/Zigbee and
Bluetooth 5 (LE) connectivity.
Signed-off-by: Ivan Shautsou <vano1002@gmail.com>
Ramdisk access fails with data abort when MMU is enabled, due to
using a physical address for the buffer instead of a mapped virtual
address.
Add support for MMU configurations by mapping the ramdisk
buffer to a virtual address space and storing this pointer in
the device's private data (`struct ram_disk_data`). Update all accesses
to use this virtual address when MMU is enabled.
With MMU disabled, the ramdisk continues to use
the original physical addressing as before.
Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
Refactored RAM disk device instantiation to use a ram_disk_data struct
as the device data, instead of assigning disk_info directly.
This change was made to enable adding additional device-specific data
in the future, improving flexibility for RAM disk devices.
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
In the SL_WIFI_SCAN_TYPE_ADV_SCAN path, the Kconfigs
ADV_ACTIVE_SCAN_DURATION / ADV_PASSIVE_SCAN_DURATION were used only as
a fallback when the per-call wifi_scan_params dwell fields were 0, so
any non-zero per-call value would override them and reach the radio.
BG-scan dwell is a system-tuned policy controlled by Kconfig (like
trigger_level and enable_multi_probe); per-call dwell fields belong to
the foreground scan path only. Always use the Kconfig values for
advanced_scan_config and ignore per-call params on this path.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
This patch adds PM device support to the siwx91x ADC driver. It allows
the ADC to be reconfigured after waking from deep sleep. Without this
patch, the ADC peripheral fails to return valid values after the system
resumes from deep sleep.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Convert the driver clock accesses to use the new generic API, so the
driver can be used on R-Car boards generations 3, 4 and 5 without changes.
Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
Modernize the way the peripheral registers are accessed.
This allows the driver to work on platforms that use a MMU or MPU.
Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
The multifunctional interface (MFIS) provides an interface
between the different CPU core domains (AP/RT, AP/SCP and
RT/SCP).
Signed-off-by: Julien Panis <jpanis@baylibre.com>
Extract the filter handle initialization into a macro to limit nesting/
indentation in the DMIC_DFSDM_FILTERS_DEFINE macro.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Reject invalid requested L/R pairings in the channel map with -EINVAL
before applying hardware limits.
Regular mode supports one DFSDM channel per filter, so configure only the
first requested channel and report that single channel through the act_*
fields instead of failing multi-channel requests outright.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
Call HAL_DFSDM_ChannelDeInit() and HAL_DFSDM_FilterDeInit() when
configure() is invoked on an already configured device. Without this,
a second configure() fails because the HAL channel is still registered.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
dmic_trigger(DMIC_TRIGGER_START) returned success while the device was
still in DMIC_STATE_INITIALIZED. Require DMIC_STATE_CONFIGURED and
propagate errors from dmic_stm32_dfsdm_start().
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
A capture cycle (configure -> START -> read -> STOP) without a following
RELEASE leaked memory slab blocks: dmic_stm32_dfsdm_stop() tore down the
HAL but never freed the in-flight buffer the driver still owns, and the
completed buffers sitting in the RX queue were never reclaimed. Each
stop/start cycle therefore leaked at least one block, and with a small
slab the next start's k_mem_slab_alloc() eventually failed with -ENOMEM,
surfaced to the caller as -EIO by the START trigger.
Free the in-flight buffer once conversions and their IRQs are stopped,
purge any completed-but-unread buffers from the RX queue on a fresh
start, and drop both on the deinit path so a stream can be stopped and
restarted indefinitely.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
Hard-code RegularParam.Trigger to DFSDM_FILTER_SW_TRIGGER in the static
filter initializer. The previous DT_PROP(flt, filter0_sync) value was a
misuse of that binding property: filter0-sync describes an InjectedParam
synchronisation mode and is only valid on filter instances 1-3. On
filter@0 it expanded to 0 (the same value as DFSDM_FILTER_SW_TRIGGER) only
by coincidence; on a hypothetical filter@1+ with filter0-sync set it would
silently turn regular conversions into a sync-trigger. Use the literal
that matches what the driver actually does (software-triggered regular
conversions) and leave the DT property where it belongs, on InjectedParam.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
HAL_DFSDM_ChannelInit() writes (Awd.Oversampling - 1) into the
CHAWSCDR.AWFOSR field and asserts that the ratio is in [1, 32]. The
static channel initializer in DMIC_DFSDM_CHAN_DEFINE() left
.Oversampling = 0, so:
- in debug/asserts-enabled builds the HAL assert fires immediately
from HAL_DFSDM_ChannelInit();
- in release builds CHAWSCDR is programmed with a wrap-around value
instead of a valid analog-watchdog oversampling ratio.
Default the static struct to a complete, valid configuration
(Oversampling = 1, FilterOrder = DFSDM_CHANNEL_FASTSINC_ORDER) so the
HAL contract is honoured before any runtime reconfiguration takes
place.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
The channel map PDM index is not the DFSDM DATIN number. Read the
channel from the devicetree child `reg` instead so boards like Nicla
Vision (DATIN2 on pdm0) route the filter correctly. Update the
stm32f769i_disco sample index to match (0 = pdm0 filter).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
Compute the post-filter PCM scaling shift together with the selected OSR,
where the hardware right shift is already known, then apply that shift when
samples are copied into RX buffers.
Store PCM samples with explicit little-endian helpers instead of memcpy()
so the output layout does not depend on host endianness. Clamp samples to
the requested PCM container width before writing them.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
- Adapt to new MCXW7x clock control
- disable HDI pins
- use flw on non secure range
- enable lpuart1 and use it for uart-pipe, bt-c2h-uart and shell-uart
- configure sys clock to 96MHz for core0 and 48MHz for core1
- use PTA18 for LPUART0 RX pin as workaround for board issue
- fix LPTMR clock source to 32K
- place main stack at beginning of the RAM to workaround boot issue
- move shared memory to third bank (instead of the second) - last 8K
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
WiseConnect zeros the BT half of its cached coex performance profile
on every Wi-Fi disconnect, leaving BT out of power save and preventing
the NWP from sleeping after re-association.
Delegate Wi-Fi power-save to siwx91x_nwp_apply_power_profile(), which
already owns both BT and Wi-Fi halves of the coex profile. Extend the
helper to accept an optional sl_wifi_performance_profile_v2_t override
so the Wi-Fi driver can pass its tailored profile (listen_interval,
dtim_aligned_type, monitor_interval); BT-only and init call sites pass
NULL to keep their current behaviour.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
crc16_reflect() and crc16_ansi() pass a CRC16 context with the
reflected polynomial 0xA001 and both reflect flags set. The driver
only accepted the normal-form 0x8005 and rejected 0xA001 with -EINVAL,
so those helpers returned 0 and the subsys.crc Ztest suite failed on
NXP parts such as frdm_mcxn947.
The CRC engine takes the polynomial in normal (MSBit-first) form and
reflects via reflectIn/reflectOut, so 0xA001 and 0x8005 describe the
same CRC-16. Accept 0xA001 only when both reflect flags are set and
always program 0x8005; a non-reflected 0xA001 is still rejected.
Tested with tests/subsys/crc on frdm_mcxn947: pass = 14, fail = 0.
Signed-off-by: Holt Sun <holt.sun@nxp.com>