Commit graph zephyr/drivers
Author SHA1 Message Date
Liam Ogletree
4d802b11b0 drivers: haptics: Multi write fixes for CS40L26
Fixes the same issue addressed in #114981 but for CS40L26. For
CS40L26, this issue leads to malformed masks for the first
IRQ register and then IRQ storms. This is only a problem when
disabling runtime PM because otherwise the power sequencer
correctly writes IRQ masks when exiting hibernation.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-09-09 18:13:42 -04:00
Lingao Meng
35c46048d3 Bluetooth: hci: Allow userchan on native library boards
BT_USERCHAN is currently limited to BOARD_NATIVE_SIM, but the
driver is implemented for native simulator based targets that use
the native host environment rather than for that specific board.

Bluetooth host-only applications can be built separately from the
controller and communicate with an external controller over HCI.
Allow native simulator based targets to use the same userchan HCI
transport when the application devicetree selects a
zephyr,bt-hci-userchan device.

Relax the dependency from BOARD_NATIVE_SIM to NATIVE_LIBRARY so
host-only Bluetooth applications can use userchan on native simulator
based targets, including out-of-tree boards, when they run in real
time.

This enables split host/controller simulation setups where the
Bluetooth host runs as one native simulator process and connects
over userchan to an external HCI controller process.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-09-09 12:59:08 -04:00
Stephan Linz
1df2fcc3a4 drivers: led_strip: ws2812_gpio: remove undeclared variable
The expression 'drv_data->clk_dev' is invalid because the pointer
'drv_data' is not declared anywhere. Since 'nrf_clock_control_release()'
is the counterpart to 'nrf_clock_control_request()', the pointer part
'drv_data->' can be safely removed.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2026-09-09 12:58:23 -04:00
Sachin D Kulkarni
05af1a7027 drivers: wifi: nrf_wifi: Add radio test shell to driver
Move radio test and FICR programming shell commands into the nRF70
Wi-Fi driver. Register the command sets behind NRF70_RADIO_TEST_SHELL
and NRF70_RADIO_TEST_FICR_SHELL Kconfig options so radio test builds
can use the built-in shell or provide a custom integration.

Signed-off-by: Sachin D Kulkarni <Sachin.Kulkarni@nordicsemi.no>
Assisted-by: Cursor:cursor-agent
2026-09-09 12:58:02 -04:00
Mathieu Choplain
db482339e8 drivers: *: stm32: include arch/cpu.h instead of generic implementation
Instead of including the header containing the generic implementation of
certain arch services, include the top-level <zephyr/arch/cpu.h> header
which will provide the correct implementation for the target arch.
Notably important for `sys_io.h` which has memory barriers on Cortex-A.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-09 12:57:53 -04:00
Duc Viet Le
6e755fba93 drivers: usb: uhc_dwc2: guard optional quirk data
Generic snps,dwc2 instances do not have the vendor quirk data/config
objects emitted by the vendor-specific quirk headers. The driver already
allowed the quirk table pointer to be NULL, but still initialized
quirk_data and quirk_config unconditionally. This causes generic-only
instances to fail to build because the corresponding vendor symbols do
not exist.

Use the same vendor-quirk condition for the table, data, and config
pointers so generic instances get NULL quirk pointers.

Fixes: 89a75416b7 ("drivers: usb: uhc_dwc2: add initial support")

Signed-off-by: Duc Viet Le <levietduc0712@gmail.com>
2026-09-09 12:57:05 -04:00
Benjamin Perseghetti
db3f01526e drivers: ethernet: nxp_enet_qos: advertise VLAN capability
Advertise ETHERNET_HW_VLAN when CONFIG_NET_VLAN is enabled. The
capability is an acceptance gate that permits VLAN interfaces on the
iface. The L2 keeps inserting the tag in software, so the transmit
path needs no offload change.

Account for the four extra bytes a single VLAN tag adds to a frame in
the transmit size cap and the receive buffer capacity assert. The MAC
recognizes the VLAN type and extends its own receive length limit by
the same four bytes, so no length register needs adjusting.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-09 12:56:23 -04:00
Benjamin Perseghetti
160dd12740 drivers: ethernet: nxp_enet_qos: offload RX checksums to hardware
Enable the receive checksum offload engine through the MAC_CONFIGURATION
IPC bit so the MAC verifies the IPv4 header and the TCP and UDP checksums
of incoming frames, and advertise ETHERNET_HW_RX_CHKSUM_OFFLOAD so the
stack does not repeat the check in software. Because the stack then trusts
the offload, drop any frame the engine flags with an IP header or payload
checksum error in the RDES1 write-back status, which is valid only when
the receive status word is present.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-09 12:56:23 -04:00
Benjamin Perseghetti
b1f1a79ba0 drivers: ethernet: nxp_enet_qos: offload TX checksums to hardware
The stack computes the IPv4 header and the TCP and UDP checksums in
software for every transmitted frame. On the MCXN947 Cortex-M33 that
per-packet cost is the largest single consumer of CPU on the transmit
path and it saturates the core well below the link rate.

The DesignWare Ethernet QoS MAC can insert these checksums in hardware.
Set the TDES3 checksum insertion control field to full insertion on the
first descriptor of every frame and advertise ETHERNET_HW_TX_CHKSUM_OFFLOAD
so the stack leaves the checksum fields cleared for the engine to fill.
The MAC only rewrites IP frames with a known protocol and leaves other
frames untouched, so the control field can be set unconditionally.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-09 12:56:23 -04:00
Mathieu Choplain
d3686d022c drivers: usb: common: stm32: phy_u5otghs: determine CLKSEL automatically
Query the frequency of the OTG_HS PHY and compute the appropriate CLKSEL
value at runtime if the `clock-reference` property is not specified.
This removes the user burden of providing the same value twice in DTS.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-09 12:56:13 -04:00
Mathieu Choplain
00a88e7916 drivers: usb: common: stm32: phy_u5otghs: remove obsolete comment
This comment duplicates the one right above - remove it.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-09 12:56:13 -04:00
Aksel Skauge Mellbye
10c5de0d04 drivers: clock_control: silabs: Add clock output driver
Add a clock_control driver for the CLKOUT feature of the Series
2/3 Clock Management Unit. The driver configures shared properties
such as exportclk and clkout dividers, and interprets the
subsys argument to clock management functions as the clock output
to enable or disable.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-09-09 10:41:46 -04:00
Mathieu Choplain
e005310b53 drivers: usb: common: stm32: usbphyc_n6: determine FSEL automatically
Instead of using a hardcoded FSEL for 24 MHz input, query the frequency
of the USBPHYC clock and determine the correct value automatically at
runtime.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-09 10:41:37 -04:00
Mathieu Choplain
178a017c31 dts: bindings: clock: stm32n6*: add missing hsi_div2_osc_ck source
The clock signal `hsi_div2_osc_ck` should be documented as a distinct
source because it is derived from the HSE clock with a configurable
prescaler.

Document the exact effect of `hse-div2` on st,stm32n6-hse-clock in the
binding: it enables the prescaler for `hse_div2_osc_ck` whose frequency
is `hse_osc_ck / 2` when enabled, and `hse_osc_ck` otherwise. Add new
clock source `STM32_SRC_HSE_DIV2_OSC` in stm32n6_clock.h, and update the
corresponding clock control driver to handle this new source.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-09 10:41:37 -04:00
Sylvio Alves
491fa7b322 drivers: wifi: esp32: add esp32c61 support
Enable the esp32 Wi-Fi driver on the ESP32-C61: extend the FTM
and mesh Kconfig gates, add the wifi devicetree node and enable
it on the esp32c61_devkitc board.

Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-09 10:41:29 -04:00
Ahnaf Shahriar
491510db64 drivers: net: ppp: let tests observe the transmitted frames
When CONFIG_NET_TEST is enabled the PPP driver drops the packet in
ppp_send() because there is no UART to write it to. That leaves the
tests with no way of checking what the PPP stack actually sends.

Add an optional callback, registered with
ppp_driver_register_send_cb(), that is invoked with the outgoing packet
before it is dropped. The callback is only compiled in for
CONFIG_NET_TEST builds and nothing changes when it is not registered.

Assisted-by: Claude:claude-sonnet-5 Simantic
Signed-off-by: Ahnaf Shahriar <shahriarahnaf007@gmail.com>
2026-09-09 10:41:15 -04:00
Anas Nashif
da3c553fef drivers: counter: gd32: use portable IRQ pending API
Replace direct NVIC pending-state calls with k_irq_set_pending()/
k_irq_is_pending()/k_irq_clear_pending(), dropping the dependency on
cmsis_core.h where nothing else needed it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-09 10:39:40 -04:00
Benjamin Cabé
3f6843f3b0 net: ieee802154: remove deprecated IEEE802154_HW_SLEEP_TO_TX
This capability was deprecated in Zephyr 3.6 (see issue #63670): every
OT-capable driver implements transmission directly from a low-power
state, so the bit conveyed no information and only coupled the radio
API to OpenThread's capability and device model.

Drop it from the radio API and from the four drivers still advertising
it, and renumber the subsequent capability bits. The OpenThread
platform glue now behaves as if the capability were always present: it
unconditionally advertises OT_RADIO_CAPS_SLEEP_TO_TX and allows
transmitting from the sleep state.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-09 10:38:59 -04:00
Etienne Carriere
198b07899f drivers: entropy: stm32: Acquire HSEM at RNG initialization
Acquire the HSEM to safely run RNG hardware initialization.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
6e682492d2 drivers: entropy: stm32: Enable RNG only when acquired
Remove enabling of the HW RNG and its interrupts from configure_rng()
local helper function. It is already done from acquire_rng() that
is always called when the RNG is used. For consistency, enable RNG
and its interrupts only once it's configured.

This is more consistent with the RNG disabling sequence that is
implemented in release_rng() local helper function.

A side effect it that the RNG is no more enabled at device initialization
which allowed it the accumulate entropy to serve quicker its first
consumer, at least on single-core MCUs.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
f67e75c586 drivers: entropy: stm32: Assert HSEM acquisition
Add some assertion and inline comment to clarify when the HSEM shall be
taken and released to ease maintenance. HSEM acquisition/release
sequences must be consistent knowing that there are no reference
counting support in HSEM management.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
61b93923e1 drivers: entropy: stm32: Simplify acquire_rng()/release_rng()
Merge entropy_stm32_resume() into acquire_rng() and
entropy_stm32_suspend() into release_rng() to make the implementation
a bit more easy to read.

Remove semaphore acquisition from release_rng() (previously inside
entropy_stm32_suspend() sequence) since the function is only
called when the semaphore was already acquired.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
6cdc354455 drivers: entropy: stm32: Move configure_rng() definition in the file
Move configure_rng() local function definition in entropy_stm32.c
source file to ease factorization in other local helper functions.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
861590224c drivers: entropy: stm32: Enabling RNG clock is not expected to fail
Remove entropy_stm32_resume() return value as it is not used and
we don't expect enabling of the RNG clock to fail.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
dc874a9007 drivers: entropy: stm32: Clarify error case in RNG disable sequence
On STM32WBAX series we must wait a few cycle before disabling the RNG
clock once it is switched off. Clarify the sequence implementation
so that RNG clock remains enable but semaphore is released. This change
addresses an issue where entropy_stm32_suspend() return value was
not used.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
52193e3127 drivers: entropy: stm32: Configurable workqueue for pools refilling
Allow project configuration to select use of either the Zephyr system
workqueue or a dedicated workqueue for fillings the random bytes pools.

By default, the driver uses the Zephyr system workqueue. Projects
can enable CONFIG_ENTROPY_STM32_WORKQUEUE and tune ENTROPY_STM32_WQ_PRIO
to use the dedicated wrokqueue.

Workqueue is configured only at POST_KERNEL initcall level, considering
that the driver init level depends on the STM32 SoC used (i.e. when
IRQLESS_TRNG local macro is enabled or not).

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Etienne Carriere
28838df419 drivers: entropy: stm32: Fix S2RAM sequence and ensure ISR pool filling
Split the initialization function in 2 and call only hardware
initialization on S2RAM resume to fix an issue where S2RAM resume
previously called entropy_stm32_rng_init() and corrupted some software
resource like the system workqueue by calling k_work_init() on an
existing and possibly submitted work.

Prevent entry in PM suspend state unless the ISR random sample pools
are filled so that any interrupt requesting random bytes at wakeup have
a chance to get random bytes. As a side effect, this change makes
entropy_stm32_rng_pm_action() much simpler.

Rename device driver initialization function for consistency.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-09-09 10:38:29 -04:00
Vincent van der Locht
df91365dc7 drivers: ieee802154: fix openthread guard MCXW driver
#112908 killed any other use-case besides openthread for the mcxw72 radio.
This patch fixes the dependency to only the vendor-specific radio use-case
of openthread.

Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
2026-09-09 10:37:44 -04:00
Tobias Meyer
350a730e48 drivers: clock_control: preserve STM32N6 boot clocks
Chain-loaded STM32N6 applications may execute from external XSPI NOR or
PSRAM whose controller depends on the bootloader clock tree. Add an opt-in
MCUboot configuration that preserves the retained RCC state while keeping
the SRAM gates required by the application.

Require the application devicetree to describe retained clock and external
memory hardware. Refresh SystemCoreClock without reinitializing the
application-domain oscillators, PLLs, interconnect, prescalers, ICs, or
SYSCLK.

Tests: git diff --check
Tests: python3 scripts/ci/check_compliance.py -c origin/main..HEAD

Assisted-by: OpenCode:gpt-5.6-sol
Signed-off-by: Tobias Meyer <tobias.meyer@hula.earth>
2026-09-09 10:36:55 -04:00
Yishai Jaffe
042104ba7e drivers: gpio: silabs: fix: undefined macro
Now using the correct macro DT_INST_NODE_HAS_PROP instead of the
undefined DT_INST_HAS_PROP.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2026-09-09 07:44:35 +02:00
Mohamed Azhar
a5b36890b4 drivers: spi: microchip: Update g1 driver
Connect every SERCOM interrupt line the devicetree node declares via
LISTIFY(DT_INST_NUM_IRQS), instead of a fixed index 0-3 subset

Signed-off-by: Mohamed Azhar <mohamed.azhar@microchip.com>
2026-09-09 07:40:33 +02:00
Benjamin Cabé
5469afc281 drivers: i2c: ti: use inclusive terminology
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.

Identifiers mirroring the TI driverlib
(e.g. MAP_I2CMaster* / I2CMaster* driverlib functions, I2C_MASTER_CMD_*
driverlib command macros, I2C_MASTER_ERR_* driverlib error macros) are
kept unchanged.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-09 07:39:02 +02:00
Benjamin Cabé
1de9e08211 drivers: counter: compile 64-bit syscall verifiers unconditionally
counter_ns_to_ticks(), counter_ticks_to_ns(), counter_get_frequency_64()
and the other _64 entry points are declared and implemented
unconditionally, but their verifiers were compiled only under
CONFIG_COUNTER_64BITS_TICKS or CONFIG_COUNTER_64BITS_FREQ, so in other
builds they had no handler at all.

Move those verifiers out of the Kconfig guards. counter_get_value_64()
and counter_set_value_64() use K_SYSCALL_OBJ() because their driver op
is optional and the implementation already returns -ENOSYS when it is
absent; set_top_value_64, set_channel_alarm_64 and get_top_value_64
keep the driver-op check where those ops are defined.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-08 21:16:28 -07:00
Madhab Sharma
7b66f8ae9c drivers: ethernet: wch9120: code cleanup, fix wording and bugs
Clean up unused-parameter warnings, fix Kconfig wording, switch to
native Zephyr socket types, and return proper error values.

Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
2026-09-08 21:16:04 -07:00
Mark H. Spatz
0374826426 drivers: ieee802154: esp32: fix ACK timestamp field name
esp_ieee802154_frame_info_t has no member named "time"; the field is
"timestamp". Broken since the code was added (seemingly an errant copy
paste from the nrf5 driver).

Fixes building with CONFIG_NET_PKT_TIMESTAMP=y.

Signed-off-by: Mark H. Spatz <mspatz@leaflabs.com>
2026-09-08 21:15:13 -07:00
Gabriel Germano
d3cbc9540d drivers: modem: quectel_eg915u: hold PWRKEY long enough to power off
The EG915U hardware design requires PWRKEY to be driven low for at
least 2 s to turn the module on and for at least 3 s to turn it off.
The driver applies power_pulse_duration_ms to both the power-on and
the power-off pulse, so the current 2000 ms only satisfies the turn-on
requirement: a power-off request releases PWRKEY after 2 s, the module
ignores the pulse and keeps running while the driver moves on to
AWAIT_POWER_OFF and reports the device as suspended.

Raise the pulse to 3100 ms, which meets both minimums with a small
margin, as already done for the Fibocom LE250 (3200 ms) and the Telit
xEx10x families (5050 ms).

Not built and not run on hardware.

Signed-off-by: Gabriel Germano <gabriel.germano@edge.ufal.br>
2026-09-08 19:18:31 -04:00
Flavio Ceolin
45c11db8e3 drivers: i2s: reject dynamically allocated memory slabs
Drivers retain the slab, so user mode could free it and trigger a
user after free.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-09-08 19:18:27 -04:00
Paulo Santos
ab6f684490 modem: cellular: make the PDP context identifier configurable
The driver defined, deactivated and dialled PDP context 1
unconditionally, hardcoded in the core APN script and in every vendor
dial script. A module whose own functions already own that context, such
as a host-facing network function that activates context 1 by itself,
refuses a dial for the same context and answers NO CARRIER, and the
leading AT+CGACT=0,<cid> tears that other session down on the way.

Add CONFIG_MODEM_CELLULAR_PDP_CONTEXT_ID and thread it through
AT+CGDCONT, AT+CGACT, ATD and the Sierra Wireless AT+KCNXCFG connection
profile, which uses the same identifier. Vendors that dial without a
context or deactivate every context are left alone. The default of 1
keeps the emitted commands byte-identical.

Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
2026-09-08 19:18:15 -04:00
Tim Pambor
92d1639ccc drivers: ethernet: dwc_mac: stm32: reset the MAC during bus init
Hold the Ethernet MAC in reset while the pins, the PHY interface mode
and the clocks are configured and release it once the setup is done.
The PHY interface mode must be selected while the MAC is under reset.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-08 19:17:55 -04:00
Fin Maaß
da98fc40bf drivers: otp: stm32: bsec: get the upper fuse limit from devicetree
There is only a single BSEC instance, so the upper fuse limit does not
have to be carried around in the driver config. Read it straight from
devicetree and drop the now unused config argument of the accessibility
check.

Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-08 19:17:44 -04:00
Fin Maaß
2ad94143aa drivers: otp: stm32: bsec: add STM32MP13 support
The STM32MP13 HAL exposes a different BSEC API than the N6 and MP2
ones: the SAFMEM fuse array has to be powered up before a fuse can be
read from it or programmed, and reading a fuse loads it into its
shadow register on the way.

The upper fuses can be accessed from the secure world only, which is
where Zephyr runs as the first stage boot loader, whatever the life
cycle state of the device, so only an invalid state is rejected.

The BSEC clock is enabled through the clock control API, and its rate
is used to select the SAFMEM frequency range on power up.

Assisted-by: Claude:claude-fable-5-1
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-08 19:17:44 -04:00
Fin Maaß
3b98890ebf drivers: clock_control: stm32mp13: report the BSEC clock rate
The BSEC is clocked by pclk5, which can be sourced from HSI, HSE or
PLL2_P and may be prescaled, so its frequency has to be looked up
rather than assumed. Report it through the clock control API so that
the BSEC driver can pick the matching SAFMEM frequency range.

Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-08 19:17:44 -04:00
Dhruv Menon
1afedec05e drivers: timer: nrf_grtc: arm first compare in tickless init
Tickless GRTC skipped the first compare and waited for
sys_clock_set_timeout(). The kernel only calls that when insert
reports a new soon-list head. Wheel timeouts past the later window
never do, so announce never starts and k_sleep latches.

The !TICKLESS guard was the old split, a tickful driver must fire
from boot because set_timeout is a no-op, while tickless assumed the
kernel would program the first real deadline. That first call never
comes if soon stays empty, so drop the guard and always arm one tick
at init, matching SysTick and timer_core_init(). The ISR still only
re-arms itself when TICKLESS=n.

Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
2026-09-08 19:17:31 -04:00
Mattia Pennasilico
acfc8ca181 drivers: serial: uart_renesas_ra_sci: always clear ERI error + IRQ
The ERI ISR only cleared the SCI error flags and the pending IELSR.IR
inside the user_cb!=NULL branch. When an RX error (overrun/framing/
parity) occurs while no interrupt callback is registered yet - e.g. the
window during uart_configure()/R_SCI_UART_Open() before the Zephyr
callback is set - nothing is acknowledged, so the error stays pending
and the ISR re-triggers forever, starving the CPU (uart_configure hangs,
USB never enumerates). Always run err_check() and clear IELSR.IR.

Signed-off-by: Mattia Pennasilico <m.pennasilico@arduino.cc>
Assisted-by: Claude:claude-opus-4.8
2026-09-08 19:17:26 -04:00
Tim Pambor
2f9b08b984 flash: spi_nand: respect endianness of ONFI parameter page
The ONFI parameter page stores all fields in little endian byte order.
The driver read them directly from the packed struct, which only yields
the correct values on a little-endian host and would return byte-swapped
geometry and CRC values on a big-endian target.

Convert every multi-byte field on access with sys_le16_to_cpu() and
sys_le32_to_cpu().

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-08 19:17:01 -04:00
Tim Pambor
63010010ea flash: spi_nand: extend ONFI parameter page
The previous parameter page definition described only ONFI revision 5.2
and folded every field that does not exist in 5.2 into opaque reserved
gaps and an electrical_parameters blob. Many NAND flashes in the field
still implement ONFI 1.0, whose parameter page places different
information at those offsets, so those bytes could not be interpreted.

Cover the full range from ONFI 1.0 to 6.0. Replace the opaque reserved
and blob members of struct spi_nand_onfi_parameter_page with the
individual fields defined across all revisions, such as the partial page
geometry and timing parameters. Annotate each field with the ONFI
revision range in which it is valid so that users can tell which
members a device of a given revision actually populates.

The field offsets and the overall 256 byte layout are unchanged, so the
existing BUILD_ASSERT still holds and no reader is affected.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-08 19:17:01 -04:00
Benjamin Cabé
c3ebcba2e3 drivers: sensor: icm40627: shift full-scale value into FS_SEL field
The accel and gyro full-scale setters passed the raw field encoding
(0-3 / 0-7) as the value to a register update whose mask is the
FS_SEL field at bits 7:5, so the masked value was always 0 and the
part stayed at +/-16 g and +/-2000 dps while software scaled for the
requested range. Wrap the value in FIELD_PREP and widen the masks to
the 3-bit field the datasheet defines.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-08 19:16:57 -04:00
Benjamin Cabé
cc1effbeee drivers: sensor: icm40627: fix accelerometer scaling
The accelerometer sensitivity shift was hardcoded to 10, which matches
neither the selected full-scale range nor the part's 16-bit output
(2048 LSB/g at +/-16 g, i.e. a shift of 11), making every reading twice
too large. Derive the shift from the selected range and write the
full-scale selection into the correct bit field so the two agree.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-08 19:16:57 -04:00
Benjamin Cabé
46923f309e drivers: sensor: icp201xx: fix conversion of negative raw values
The fractional part was computed with an unsigned modulo while the
integer part used signed division, so for negative raw values the two
halves used different quotients and the result was one full unit too
high. Compute the value in signed micro-units and let
sensor_value_from_micro() split it consistently.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-08 19:16:53 -04:00
Benjamin Cabé
aa6b64cfa3 drivers: sensor: icp201xx: fix inverted pressure interrupt mask
The pressure trigger setup passed ~int_mask to
inv_icp201xx_set_press_notification_config(), whose argument bits are
cleared from the whole INT_MASK register, so the stray bits set by the
bitwise NOT also un-masked the FIFO watermark, overflow and underflow
sources. Restrict the inverted mask to the two pressure bits.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-08 19:16:53 -04:00