Commit graph zephyr/drivers
Author SHA1 Message Date
Fiona Behrens
416120f85c driver: serial: Use clock control driver in uart numicro
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>
2026-06-05 22:35:10 +02:00
Johan Hedberg
cd27e70f93 drivers: bluetooth: stm32wb0: Fix mistakenly re-introduced code
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>
2026-06-05 18:12:58 +02:00
Povilas Selevicius
4b2d25085c drivers: modem: cellular: change default init priority to 91
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>
2026-06-05 18:12:43 +02:00
John Batch
669645bbd8 drivers: mfd: Add Infineon HPPASS CSG MFD driver
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>
2026-06-05 18:11:50 +02:00
Fabrice DJIATSA
af6c05c4f0 drivers: disk: stm32: add a GPIO dependency for all STM32 series
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>
2026-06-05 16:57:03 +02:00
Etienne Carriere
688425144d drivers: i2c: stm32: Fix error case in configure handler
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>
2026-06-05 13:23:31 +02:00
Tomas Barak
7491f2c62d drivers: audio: add dummy codec stub driver
- 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>
2026-06-05 13:20:04 +02:00
Albort Xue
7bdc1b35c1 drivers: wuc: add NXP WUU (Wakeup Unit) driver
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>
2026-06-05 13:19:50 +02:00
Madhab Sharma
5ce49e5c3c drivers: wifi : Use net_eth_set_if_type_wifi() API
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>
2026-06-05 09:37:33 +02:00
Sofian Elmotiem
a5160865d0 drivers: i2s: ambiq: fix DRAIN trigger not waiting for DMA completion
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>
2026-06-05 09:35:54 +02:00
Sofian Elmotiem
38350749a1 drivers: i2s: ambiq: fix inst_idx and shared config structs
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>
2026-06-05 09:35:54 +02:00
Holt Sun
1af0beaee1 drivers: counter: mcux_lptmr: add guard period support
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>
2026-06-05 09:34:52 +02:00
Benjamin Cabé
518ab9b152 drivers: display: sdl: support color dithering
Wire the new color dithering helper into the SDL display driver.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-05 09:34:34 +02:00
Benjamin Cabé
1a230d3dc0 drivers: display: ed2208_gca: support color dithering
Wire the new color dithering helper into the ED2208 driver.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-05 09:34:34 +02:00
Benjamin Cabé
743ba8d987 drivers: display: ac057tc1: support color dithering
Wire the new color dithering helper into the AC057TC1 driver.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-05 09:34:34 +02:00
Benjamin Cabé
1de537ab34 drivers: display: add color dithering support for palette-backed displays
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>
2026-06-05 09:34:34 +02:00
Svitlana Drozd
5cacb801b0 drivers: reset: scmi: add reset protocol support
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>
2026-06-05 09:33:53 +02:00
Michael Clausen
6b5447965f drivers: input: nunchuk: Added support for acceleration readings
plus added manual polling support.

Signed-off-by: Michael Clausen <michael@clsn.ch>
2026-06-05 09:32:05 +02:00
Fabio Baltieri
61fa460c51 uart_bridge: replace BUILD_ASSERT with min-len/max-len
Replace the BUILD_ASSERT for device count with min-len/max-len.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-06-04 23:50:48 +02:00
Fabio Baltieri
a0fcce9cb2 input: replace few BUILD_ASSERT with min-len and max-len
Replace few BUILD_ASSERT(DT_INST_PROP_LEN(..)) with min-len and max-len
properties.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-06-04 23:50:20 +02:00
Mathieu Choplain
9719cc9cbe drivers: usb_c: tcpc: stm32: drop usage of LL_UCPD_Init()
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>
2026-06-04 23:49:50 +02:00
Mathieu Choplain
0fe9326a7c drivers: usb_c: tcpc: stm32: enable peripheral clock using CLOCK_CONTROL
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>
2026-06-04 23:49:50 +02:00
Mathieu Choplain
76aa38890f drivers: usb_c: tcpc: stm32: don't check for an enabled instance
The Kconfig guard already ensures this can't be build if there's no
enabled instance.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-06-04 23:49:50 +02:00
Alain Volmat
a65b87f2c6 drivers: video: sw_generator: add GREY format support
Allow possibility to output a GREY format (8bpp) buffer
from the video-sw-generator.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-06-04 18:22:53 +02:00
Bjarki Arge Andreasen
ebff2368a3 drivers: clock_control: nrf: refactor lfclk_spinwait to poll wait
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>
2026-06-04 18:21:26 +02:00
Muzaffar Ahmed
654121a7a4 drivers: wifi: siwx91x: Restrict TX out of TWT Service Period by default
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>
2026-06-04 18:19:31 +02:00
Ivan Shautsou
81a15e7e99 boards: others: add support for esp32h2_supermini board
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>
2026-06-04 18:19:09 +02:00
Svitlana Drozd
301879424e drivers: ramdisk: add MMU support for ramdisk mapping
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>
2026-06-04 18:18:49 +02:00
Svitlana Drozd
46a6059500 drivers: ramdisk: add support for device-specific data
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>
2026-06-04 18:18:49 +02:00
Tejus Subramanya
b27420e844 drivers: wifi: siwx91x: honor Kconfig dwell times for BG scan
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>
2026-06-04 14:05:55 +02:00
Martin Hoff
ee852fa416 drivers: adc: siwx91x: add PM device support to ADC driver
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>
2026-06-04 14:05:14 +02:00
Adrien Ricciardi
c316f3119e drivers: i2c: Add generic clock support to the R-Car I2C driver
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>
2026-06-04 14:04:34 +02:00
Adrien Ricciardi
c21aec56b5 drivers: i2c: Add MMIO support to the R-Car I2C driver
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>
2026-06-04 14:04:34 +02:00
Adrien Ricciardi
2c9c6bdbca drivers: i2c: Add pinctrl support to the R-Car I2C driver
This is required on modern Zephyr to configure appropriately the pins
for I2C operations.

Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
2026-06-04 14:04:34 +02:00
Michał Stasiak
5f2b0fdb7c drivers: audio: dmic_nrfx_pdm: assign proper base frequency
nRF92 series has 16 MHz base clock for PDM.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2026-06-04 14:04:30 +02:00
Julien Panis
0774db1816 drivers: clock_control: Do not build CPG MSSR driver for Gen5 series
Gen5 SoCs use ARM SCMI clock driver.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2026-06-04 14:04:02 +02:00
Julien Panis
6a4546785f drivers: mbox: Add support for Renesas R-Car MFIS
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>
2026-06-04 14:02:54 +02:00
Benjamin Cabé
158675412c drivers: audio: dmic_stm32_dfsdm: apply clang-format
Pass drivers/audio/dmic_stm32_dfsdm.c through clang-format.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-06-04 14:01:23 +02:00
Benjamin Cabé
f7c866025a drivers: audio: dmic_stm32_dfsdm: extract DMIC_DFSDM_FILTER_HFILTER macro
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>
2026-06-04 14:01:23 +02:00
Benjamin Cabé
688a626e40 drivers: audio: dmic_stm32_dfsdm: validate channel map in configure
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
7dd0a59e56 drivers: audio: dmic_stm32_dfsdm: deinit HW before reconfigure
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
22847968bd drivers: audio: dmic_stm32_dfsdm: reject START before configure
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
2a4a8478c9 drivers: audio: dmic_stm32_dfsdm: free RX buffers on stop
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
cdfd2965ed drivers: audio: dmic_stm32_dfsdm: fix RegularParam.Trigger
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
84af42f4ae drivers: audio: dmic_stm32_dfsdm: fix invalid Awd.Oversampling=0 default
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
ce01c7549d drivers: audio: dmic_stm32_dfsdm: use DT for DFSDM channel
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
2026-06-04 14:01:23 +02:00
Benjamin Cabé
78d782e365 drivers: audio: dmic_stm32_dfsdm: scale filter output to pcm_width
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
2026-06-04 14:01:23 +02:00
Axel Le Bourhis
5be96e1125 soc: mcxw70: soc bringup
- 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>
2026-06-04 14:01:15 +02:00
Tejus Subramanya
1e044f6ff6 drivers: wifi: siwx91x: route Wi-Fi PS through nwp_apply_power_profile
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>
2026-06-04 11:07:57 +02:00
Holt Sun
619b06e4f5 drivers: crc: nxp: accept reflected CRC-16 polynomial
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>
2026-06-04 11:07:54 +02:00