A stationary sensor reports no motion for every sample, so at the
12.6 Hz streaming rate the warning floods the console with a condition
that is expected rather than exceptional.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The chip rewrites the LED control register on its own when its
automatic mode switching runs, so the state written during
configuration does not persist: a device configured with the LED
disabled ends up strobing again a few seconds after init. Extract the
LED control sequence into paa3905_apply_led_config() and re-apply it
from the stream path roughly once a second, so the devicetree
configured state is authoritative across mode switches.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Commit a93e31f280 ("drivers: uart: stm32: don't read TC interrupt flag
multiple times") introduced a regression.
When building with both `PM` and `UART_ASYNC_API` enabled, using
`poll_out` on a UART causes the PM lock to be released twice after being
acquired a single time.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
Return an int per the prototype, not a cy_rslt_t. Both technically
work since callers will be checking for a non-zero return meaning
failure, but it's inconsistent
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5.0
Most of the variables, macros, and functions were prefixed with
an underscore. Removed these to match the standard Zephyr naming
scheme
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5.0
PCIe configuration-space helpers use DWORD indices, but the PTM code
added byte offsets directly to the extended capability base. This made
it access the wrong Capability and Control registers.
Replace compiler-dependent register bitfields with explicit masks,
including the granularity fields, and convert PTM register offsets to
DWORD indices. Update PTM Control with read-modify-write so unrelated
control bits are preserved.
Assisted-by: ChatGPT:GPT-5.6 Sol
Signed-off-by: Alejandro Sánchez <alesangreat@gmail.com>
%zu should only used for argument of size_t type, but the buf_size is of
uint32_t type. Casting to size_t is required. Otherwise, a warning will
occur with compiler of 64-bit platforms.
drivers/display/display_ed2208_gca.c:238:25: error: format
'%zu' expects argument of type 'size_t', but argument 3 has
type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Make the driver generic so that similar ILI display controllers, such as
ILI9881c, can reuse and extend it with their own register initialization
sequences.
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
lis2dh_trigger_anym_tap_set() tears down both INT2 event sources
(any-motion and tap) and disables the GPIO interrupt before storing the
new handler, but returned early on handler == NULL, permanently killing
the other trigger still registered on that line. Only return early when
neither handler is registered, so lis2dh_start_trigger_int2() re-arms
whichever source remains.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The runtime ODR setter only rejected 1620 Hz outside low power mode,
so 5376 Hz wrote the reserved CTRL_REG1 code 0b1010 in normal/high
resolution mode, and 1344 Hz in low power mode programmed code 0b1001
which means 5376 Hz there. Reject both unsupported combinations with
-ENOTSUP.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The raw temperature is a left-justified two's complement value, so the
fractional bits are always a positive addend to the signed integer part.
Negating the fraction for sub-zero readings moved them further from zero
(-0.25 C was reported as -1.75 C); renormalize val1/val2 instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
lis2dh_spi_update_reg() discarded the result of the register read and
merged the mask into an uninitialized stack byte, writing garbage bits
back to the device while reporting success. Propagate the read error
instead, matching the I2C backend's contract.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The RX callback reloads and restarts the DMA for each chunk after the
first. If either call fails it leaves through rx_disable, which only
stops the transfer, so the state is left as it was and i2s_read()
waits for data that can no longer arrive.
Every other error exit in that callback sets I2S_STATE_ERROR before
leaving. These two did not; the gap predates this series.
Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
A stopped stream loses one mem-slab block per DROP: the block the DMA
was writing is never returned, so the slab runs dry and a later
i2s_write() waits on it forever.
On GDMA, free it once dma_stop() has quiesced the channel, and stop
the I2S unit before the DMA on RX so nothing keeps filling the FIFO.
ESP32 and ESP32-S2 have no GDMA reset, so their stop path still does
not free. Their ISR runs the callback only on EOF, though, so the
block is already back from the DMA there and the callbacks return it
before reporting a descriptor error. The DROP leak on those two parts
is left alone; I have no ESP32 or ESP32-S2 to run a fix on.
Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
GDMA_INLINK_STOP_CHn is a command strobe with no acknowledge, so a
channel can still be writing to the descriptor buffer after
dma_stop() has returned, and the caller then frees a buffer the DMA
overwrites. Reset the channel so the stop is observable, and clear
the events the abandoned transfer latched: the reset writes
conf0.in_rst and leaves int_raw set, while dma_reload() and
dma_start() do not clear.
An AXI channel cannot be reset mid-transaction, so every reset site
(configure, reload and stop) now goes through one helper that
aborts, waits for the reset to become available, resets, then
releases the abort (esp-idf 4393a0d0728b).
I have no ESP32-P4, so the AXI path is build-tested only.
Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
Add counter driver for the Renesas RA Ultra-Low-Power Timer (ULPT)
with Kconfig, devicetree binding, and driver implementation
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Signed-off-by: Khai Cao <khai.cao.xk@renesas.com>
Add support for CMD5, CMD52, CMD53 for Renesas RA to support
SDIO mode
Add interrupt enable/disable API and support SDIO in-band interrupt
callback
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Extend the MSPI QSPI controller driver to support the MCXE31X
series. Key differences from MCXE24X:
- No FIFO byte-swap needed (native LE byte ordering)
- Use QSPI_SetDelayChainConfig instead of QSPI_SocConfigure
- No dataHoldTime field (FSL_FEATURE_QSPI_HAS_NO_TDH)
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Add QSPI Serial Flash Clock (SFCK) initialization and rate query
to the MC_CGM clock driver. Configures MUX_10 divider and selects
PLL_PHI1 as clock source when QSPI is enabled in devicetree.
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Add MSPI controller driver for NXP QSPI hardware. The driver
dynamically builds LUT sequences from MSPI transfer parameters,
supporting single and quad SPI modes. It handles MCXE24X hardware
quirks including SFAR auto-reset, minimum 16-byte TX IDATSZ, and
big-endian FIFO byte ordering.
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Choose the per-chip config at build time from the node compatible
instead of matching device-name at runtime.
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Generalise the octal-only driver to a per-chip config and LUT table
so it can also drive the on-board Winbond W25Q512NW quad SPI NOR on
RT700 XSPI0. The octal path is unchanged.
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Add memc_xspi_reset(): an XSPI software reset that invalidates the
controller's AHB read/prefetch buffer while keeping the LUT and device
config. The flash driver calls it after a program or erase so a
memory-mapped read issued right afterwards returns the freshly written
data instead of stale prefetched data.
Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
Fixes an issue where scanning nested multifunction bridges premature-
dives down the first bridge function before processing peer functions
on the same slot. This can cause missing hardware tracking cells if
secondary buses aren't allocated in order.
Maintain the core DFS pattern but defer the vertical branch descent until
the horizontal function traversal across the parent slot node completes.
This queues the target buses into an array buffer to secure parent
interfaces before downstream enumeration begins.
Signed-off-by: Khadem Ullah <khadem.systems@gmail.com>
The VSC8541 MAC-interface pad edge rate depends on the VDDMAC supply
voltage and board-level signal-integrity requirements. The driver
currently leaves the setting at its reset default, so boards cannot
select the value recommended for their electrical design.
Add a microchip,pad-edge-rate devicetree property accepting values 0
through 7. Default it to 7 to preserve existing behavior, and program
the selected value into page 2 register 27 after the PHY software
reset.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
lis2de12_enable_xl_int() hard-coded the CTRL_REG3 I1_ZYXDA routing bit
to 1, so disabling the data-ready trigger left INT1 asserted with a NULL
handler, wedging lis2de12_handle_interrupt() in an endless status-read
loop. Program the bit from the enable argument and leave the handling
loop when no handler is registered.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Add a short delay after asserting or deasserting reset bits in the
Intel SoC reset controller. Some reset lines were not released on
hardware because the sequence completed too quickly.
Signed-off-by: Syed Muhammad Murtaza <syedx.muhammad.murtaza@altera.com>
CTIMER_SetupPwmPeriod() only rewrites the match registers; it does
not touch TC. Shrinking the period while the timer is running can
leave TC above the new MR[period_channel] value, so the reset-on-
match condition never fires again until TC wraps around 32 bits,
freezing the output for up to 2^32 timer cycles.
Reset the counter whenever the period value actually changes.
Duty-cycle-only updates keep the counter running, so they introduce
no phase discontinuity.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
"Enhanced Max PS" is supposed to provide a workaround for AP which does not
support PS-Poll frames.
This mode take place of the Fast PS mode. In practice, users enabling this
compile time option will never be able to restore Fast PS behavior.
Considering the PS-Poll algorithm is very bandwidth limited (2Mbps Rx in
the best case), most of the users want Fast PS. So, enabling this option by
default is confusing for most of the users.
Change the default and update the description.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
get_state and disconnect are optional in mux_control_driver_api, and
z_impl_mux_state_get()/z_impl_mux_control_disconnect() return -ENOSYS
when the slot is NULL. Their verifiers used
K_SYSCALL_DRIVER_MUX_CONTROL(), which also asserts the op is non-NULL,
so a userspace caller got killed instead of the documented -ENOSYS:
mux_state_get() on nxp,inputmux, or mux_control_disconnect() on
nxp,inputmux, nxp,trgmux and nxp,xbar.
Check the object type only with K_SYSCALL_OBJ(), leaving the op check
to z_impl. mux_control_set() and mux_state_apply() keep the op form
since set is mandatory.
Not built or run; the mux tests do not cover userspace.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
mux_control_copy_from_user() negated K_SYSCALL_VERIFY_MSG(), which is
already non-zero on failure. The cells-length guard therefore behaved
the opposite way round: every valid length was rejected with -EINVAL
and an oversized len was let through to overflow the k_cells[] stack
buffer. Drop the extra negation.
Not built or run; the mux tests do not cover userspace.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
regulator_get_voltage() is documented optional (-ENOSYS when
unimplemented), and six in-tree drivers leave .get_voltage NULL.
regulator_common_init() still treats -ENOSYS as fatal in its
range-snapping block, which is gated on the range being constrained -
something a binding can do with a default:, not just a board.
espressif,esp32-regulator defaults the range to 500000/3300000 and has
no get_voltage, so every LDO on every ESP32-P4 board fails init and
device_is_ready() is false for all of them.
Skip the range-snapping when the voltage cannot be read back; there is
nothing to snap, which is not an error.
Fixes: #116177
Assisted-by: Claude:claude-opus-5
Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
AM13 IOMUX has PINCM[0] at base+0 (no RESERVED0 word), unlike MSPM0/
MSPM33 where PINCM[0] is at base+4. Select the correct offset at
compile time using CONFIG_SOC_SERIES_AM13E.
Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
The generic dwc_mac driver handles the NuMaker EMAC, and both
in-tree boards now describe the MDIO controller and the PHY that it
needs. Remove the NuMaker Ethernet driver, its Kconfig option and the
phy-addr property that only it used.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
This driver accesses the PHY through the MAC itself and provides no
MDIO driver, so it cannot serve a devicetree with the MDIO node
enabled. Depend on that node being disabled, which leaves such boards
to the dwc_mac driver.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Add a dwc_mac platform glue driver for the Synopsys DesignWare MAC
integrated in the Nuvoton NuMaker M467 and M55M1 SoCs, where the IP
is named EMAC.
When the devicetree carries no MAC address, the driver derives one
from the chip's unique ID read through hwinfo and spreads it over
the address the way the NuMaker Ethernet driver does, so a board
that relied on the generated address keeps the one it had.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Report the EMAC module clock rate on the M467 and the M55M1, so
drivers can query it instead of hardcoding a frequency. The EMAC has
no clock source selection and no divider: it runs off HCLK on the
M467 and off HCLK0 on the M55M1.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
A DAT entry written when a device is attached, or during dynamic
address assignment, left the SIR reject bit clear, so an in-band
interrupt raised before any driver call had armed the target was
accepted with no callback registered.
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5
Program both the static address and the dynamic address into the DAT
entry. This way, a device that is only known by its static address
can still be addressed via SETDASA.
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5
get_free_pos() returns -1 when the table is full, but the return
type was unsigned. Consumers checked if the pos was valid with
pos < 0, which is always true, thus a full table wouldn't be
caught.
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5
Fixed the DA source - add_slave_from_daa read the address back out of
the DAT entry the driver had programmed rather than the one the IP
recorded. Databook figure 2-14 puts the assigned DA in DCT LOC4[7:0],
so read it from there and patch the DAT entry to match, otherwise the
descriptor and the target disagree on the address and every transfer
to it is NACKed.
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Assisted-by: Claude:claude-opus-5
mfd_rv3028_read_regs() and mfd_rv3028_write_regs() log their size_t len
argument with %d, which fails to build with -Werror on targets where
size_t is unsigned long. Use %zu instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5