Add a sensor driver for the SoC die temperature on Raspberry Pi
BCM283x devices. The temperature is read through the VideoCore
firmware GET_TEMPERATURE property tag -- the source behind
`vcgencmd measure_temp` -- over the rpi_fw mailbox property
interface, and exposed as SENSOR_CHAN_DIE_TEMP.
The sensor owns no MMIO of its own, so it is modelled as a child of
the raspberrypi,bcm283x-firmware node.
Wire up the VideoCore mailbox (brcm,bcm2711-mbox) on the BCM2710, and
put the firmware (raspberrypi,bcm283x-firmware) node with its
shared-memory property buffer on the board, matching where rpi_4b
keeps them. Enable the sensor on the Zero 2 W and the Pi 4 B.
Signed-off-by: Jonathan E. Peace <jep@alphabetiq.com>
Add a DAC driver for the 10-bit, 30Msps DAC inside the PSC3 series'
HPPASS CSG. Each instance represents a single DAC inside a CSG slice.
This driver implements the Zephyr DAC API in direct-write only mode (no
LUT or slope generation). The driver handles DAC configuration and
output settings, as well as interrupt handling for the DAC interrupt.
The driver provides for deglitch properties (see TRM reference for
details) and sets an (optional) initial value for the DAC output.
Assisted-by: Github Copilot:claude-opus-4.7
Signed-off-by: John Batch <john.batch@infineon.com>
This commit moves pinctrl registers definition file to RTS5817
soc directory, because gpio driver will also include this file
Signed-off-by: Darcy Lu <darcy_lu@realsil.com.cn>
GITS_CBASER.Size is encoded as (number of 4KB pages) - 1 per the
GICv3 ITS specification. Write pages-1 instead of the raw page count.
Signed-off-by: Li Wan <wanli@kylinos.cn>
Update driver to use new HAL library that supports both
Series 2 and Series 3 SoCs that share the same IP.
Split the check for transfer doneness in the block append
function into semantically equivalent parts: Check CHSTATUS
to see if the channel is active when appending a block, and
check CHDONE in the ISR.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
GPIO index 32 belongs to GPIO_GRP1 bit 0, but the split used '> 32',
sending index 32 into a 32-bit shift on GPIO_GRP0 instead. Use '>=',
consistent with the gpio_idx - 32 addressing used for the high group.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The dma slot selection mapped any nonzero unit to the I2S1
trigger, so the esp32p4 i2s2 controller would bind its DMA
channel to the wrong peripheral. Compute the trigger from the
unit index and add the missing I2S2 trigger identifier.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
On esp32p4 the I2S_CLK_SRC_DEFAULT enumerator is an auto-select
sentinel with value zero instead of an alias of a concrete module
clock, so the clock tree resolved its rate to zero and every
i2s_configure() call failed with mclk_div equal to zero. Select
PLL_F160M explicitly on that soc and enable the source branch at
driver init. Transfers now execute; the remaining data-path
issues on esp32p4 are tracked separately.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add a WS2812 LED strip driver on top of the pulse_io subsystem.
Pixel data is encoded as fixed-period cells with per-bit duty and
sent through a pulse_io transmit channel, so the driver runs on
any SoC with a pulse_io backend. Add a led_strip sample overlay
driving the on-board WS2812 of the esp32s3_devkitc through the
RMT backend, selected with the pulse_io file suffix.
Assisted-by: Claude Code:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add an RMT (Remote Control Transceiver) backend for the pulse_io
subsystem, derived from the standalone RMT driver proposal and
reworked around the vendor-neutral API. Channels map directly to
hardware channels, state is statically allocated and transfers
use the sync pulse_io calls with ping-pong refill and drain from
a shared interrupt. DMA is supported on ESP32-S3 through the last
transmit and receive channels.
Assisted-by: Claude Code:opus-4-8
Signed-off-by: Joel Guittet <joelguittet@gmail.com>
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add tx_channel_mask and rx_channel_mask to the capability
descriptor so backends with dedicated transmit and receive
channels can expose which channel indexes support each
direction. The loopback backend reports all channels in both
masks.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add a functional loopback backend that loops transmitted symbols
back on receive, with deferred async transmit completion and a
streaming receive path. Add ztest suites covering capabilities, the
channel lifecycle, configuration, codec encode/decode, sync and
async transfer, streaming receive, and the userspace syscall path.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add the pulse_io subsystem API: the public header with the driver
vtable, capability and configuration structs, the SYMBOL and CELL
submission descriptors, sync and async transmit and receive entry
points, and the byte/symbol encoder and decoder helpers.
The channel lifecycle and transfer calls are exposed as syscalls
with userspace verification handlers. Includes the controller
binding, subsystem documentation, release note and maintainer entry.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
MSPI is read as an initialism, so it takes "an", not "a". Fix the
remaining occurrences across the MSPI headers, the JEDEC NOR flash
driver and the MSPI samples.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
move_by() and run() logged timing source update and start
failures but always returned success. Return the captured error
like the step_dir controller does.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
step_work_timing_source_start() and _stop() returned the raw
k_work_reschedule() and k_work_cancel_delayable() results, which are
positive on success, while the timing source API documents 0 on success
and a negative errno on failure. Normalize both so that callers can
propagate the return value unchanged.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
adxl355_submit_stream() read route_to_int2 from the driver data
struct, which is never initialized and thus always false, so boards
wired to INT2 toggled the FIFO_FULL_EN1 bit instead of EN2. Use the
devicetree-derived value from the config struct, as the trigger code
does, and drop the dead data-struct member.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The call to adxl355_stream_irq_handler() was nested inside an
unrelated CONFIG_ADXL355_TRIGGER_OWN_THREAD guard, so with STREAM
enabled and the trigger mode at NONE or GLOBAL_THREAD the GPIO
callback disabled the interrupt and never completed the pending
stream request, hanging streaming forever. Guard the call only by
CONFIG_ADXL355_STREAM, matching the ADXL367/ADXL362 drivers.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
adxl355_decoder_has_trigger() returned false unconditionally when
CONFIG_ADXL355_STREAM was enabled, the only configuration in which the
buffer carries a struct adxl355_fifo_data header with status1. Invert
the guard to #ifndef, matching get_frame_count in the same file, so
streaming builds report FIFO trigger events and non-streaming builds
return false.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
adxl355_submit_stream() compared and stored the 0/1 FIFO-watermark IRQ
enable flag in data->fifo_watermark, the cached FIFO_SAMPLES watermark
count, corrupting the value reported by attr_get and triggering
spurious INT_MAP rewrites and FIFO flushes. Use the dedicated
data->fifo_watermark_irq field instead, as sibling drivers do.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
attr_set and trigger_set unconditionally place the device in standby
but returned directly on unsupported attribute/channel/trigger or
register errors, silently halting conversions (and leaving the GPIO
interrupt disabled). Restore MEASURE mode and re-enable the interrupt
on all error paths.
Failures during the restore are logged but do not override the
original error, so the root cause still reaches the caller.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
adxl355_submit_fetch() acquired the RTIO RX buffer and immediately
completed the SQE without any bus access, so sensor_read() returned
uninitialized memory. Read XDATA3..ZDATA1 into the buffer as a
struct adxl355_sample (raw register bytes as the decoder expects),
set the range, and size the buffer for a single sample.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
hci_tx_pkt is a file-scope variable, but psoc6_bless_send() clears and
populates it before taking psoc6_bless_operation_sem, so two senders
can overwrite each other's packet information, and the one holding the
semaphore can end up handing the controller a packet that describes the
other buffer.
Nothing else uses the variable, and it does not need to outlive the
call: Cy_BLE_SoftHciSendAppPkt() copies the packet into the
controller's buffer before returning, as documented in cy_ble_stack.h.
Make it a local variable, which removes the shared state instead of
locking it.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
A down-counter reloaded from LDCNT that interrupts at zero and does not
free-run, so a RELOAD backend. The counter the core reads is synthesized,
the reloads consumed so far plus what the one in flight has counted down,
and it is declared 28 bits wide like the hardware. That read touches
state the ISR and the reload path also write, so
TIMER_CORE_COUNTER_NONATOMIC has the core serialise the public getters.
The core takes over the tick accounting: last_announcement and the
announced-tick arithmetic go, along with sys_clock_set_timeout(),
sys_clock_elapsed() and sys_clock_cycle_get_32(). The driver is left with
folding the consumed reload into the synthesized count, in the ISR and
again when a new reload replaces one in flight.
Two oddities in the replaced code are worth recording. The ISR reloaded
RTMR_COUNTER_MAX * CYCLES_PER_TICK, a product that overflows 32 bits and
wraps to an arbitrary value, where the intent was simply to keep counting
until the next deadline; it now reloads the counter's maximum.
sys_clock_elapsed() took the absolute value of a difference that it
computed backwards, so an announce arriving between the two reads turned
into elapsed time counted forwards; the core computes it once, from the
counter.
sys_clock_cycle_get_32() now counts over the full 32-bit space, where the
driver's own masked it to the counter's 28 bits. The sleep compensation
masked the difference of two readings to match, which would truncate a
sleep past 0x0fffffff cycles, so that mask goes.
Stopping the timer moves to sys_clock_idle_enter(K_TICKS_FOREVER), where
the CPU is on its way to sleep and sys_clock_idle_exit() is guaranteed to
restart it. The magic tick value that used to request it could arrive
with the CPU still running.
Build-tested on rts5912_evb, tickless and tickful, with and without
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
A free-running counter and a compare register that matches on equality, so
a value written after the counter has passed it is missed for a whole
counter period: a COMPARE_EXACT backend. The core writes the comparator
through its verify loop, which is what the driver's MIN_DELAY floor existed
for, and the counter's own width is declared so the core masks deltas at
the real wrap rather than at a register boundary.
The core takes over the tick accounting. announced_cycles, counter_delta()
and the round-up-to-the-next-tick arithmetic go with it, along with
sys_clock_set_timeout(), sys_clock_elapsed() and the driver's own
CYCLES_PER_TICK. The ISR is left with the flag clear and the announce.
The counter is now free-running in both modes. It used to reset on match
for a ticked kernel, which an absolute compare cannot express, and that
also retired the private cycles accumulator the tickful cycle counter was
built from: the counter itself now carries that, and the core emits
sys_clock_cycle_get_32().
sys_clock_no_timeout() takes over the sloppy-idle case that keyed off a
magic tick value. It masks the wakeup and leaves the counter running, so
the cycle getters keep working. Under a ticked kernel it does nothing: the
interrupt it would mask is the periodic tick.
Build-tested on frdm_mcxw71, tickless and tickful, with and without
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The underlying RTC hardware used by Infineon only supports a 2 digit
year. The PDL hardcoded an assumption that the current century is
2000, and this assumption was propagated into the Zephyr driver.
Removing the 20xx-century restriction by updating the minimum valid
year to be tm-compliant (19xx) and performing day-of-week calculations
using the correct century.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Zayne Stites <Zayne.Stites@infineon.com>
Offload VWIRE callback execution from `espi_vw_idx2_isr` to a dedicated
background thread. This commit introduces an 8-slot ring buffer to
capture VWIRE events inside the ISR, significantly reducing the ISR
execution time and ensuring all back-to-back packets are reliably
processed.
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
The existing buffer check includes a full pitch after every row,
including padding after the final row. It therefore rejects valid
strided buffers that contain only the pixels reachable from their
starting address.
Compute the required size from the offsets of the last row and its
requested width. This allows callers to pass a view into a larger
framebuffer without requiring inaccessible trailing padding.
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Yu He <auhy@mail.scut.edu.cn>
When pitch is larger than width, the driver sends each row in a
separate MIPI DBI transfer. Pitch is the distance between row starts
and must only be used to advance the source pointer.
Using pitch as the transfer size includes pixels outside the requested
row from the second row onward and corrupts the display. Size each
transfer from the requested width instead.
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Yu He <auhy@mail.scut.edu.cn>
The esp32p4 fsls phy pads are shared with usb-serial-jtag
through an lp_sys mux that defaults to the usj. Hand the pads
to the otg-fs controller when the phy is enabled and return
them to usb-serial-jtag in the disable quirk. The usj console
and flashing keep working until the device stack is enabled
and are restored at runtime once the stack is disabled,
without a chip reset.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This changes include:
- Streamline data structures by embedding espi_taf_pckt directly into
driver data, eliminating manual field copies and indirection.
- Optimize completion handler to write directly to FLASHTXBUF register.
- Implement defensive RX/TX bounds validation to guard against buffer
overflows.
- Add safety fallback for unsupported eSPI cycle type.
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
The nrf54l has high speed pad ctrl (slew rate) of the fast GPIO port
(P2), configurable through registers sharing the address space of the
GPIO port.
Extend the nordic,nrf-gpio devicetree binding with a property
indicating if hspadctrl is available for a port, and add an optional
property for setting the optional HSBIAS value of the GPIOHSPADCTRL
BIAS register. The datasheet recommends always setting HSBIAS to its
highest value (3), which will now be set by the nrf gpio device
driver on init, unless the user specifies otherwise in the
devicetree.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Add page-size to the JEDEC MSPI NOR property allow list and honor
it in FLASH_PAGE_SIZE_INST(): when the property is present, it
overrides the SFDP-derived or default page size.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Add an MSPI controller driver for Microchip MEC174x/5x/MEC165x
based on the QMSPI controller.
The driver uses the QMSPI local-DMA (LDMA) channels for the data path
when CONFIG_MSPI_MCHP_XEC_QMSPI_LDMA is enabled and the request
specifies a DMA-mode transfer; otherwise it uses the PIO FIFO. Note
the LDMA engine is internal to the QMSPI block and is independent of
the central DMA controller.
Both synchronous and asynchronous transfers are supported in PIO and
DMA modes. The driver operates in controller mode and supports
half-duplex transfers only; full-duplex is not implemented.
Initial PM_DEVICE support is added using the PM subsystem calls during
driver init, as recommended by the Zephyr PM_DEVICE documentation.
The driver supports the QMSPI hardware chip enables only; GPIO chip
enables are not supported. A controller configuration that specifies
GPIO CEs (num_ce_gpios != 0) is rejected with -ENOTSUP.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Add macros that treat the QMSPI Mode register's three clock bits (idle
state, transmit phase, sample phase) as a single SPI-mode field to
simplify driver code.
The Control and Descriptor registers' TX and RX DMA-enable fields use
the same value encoding, so share one direction-agnostic set of value
macros (DMA_DIS; LDMA_CH0..2 for local-DMA channels; DMAC_U1B/U2B/U4B
for central-DMA access size) while keeping separate TX/RX get/set
macros. This also corrects the 4-byte TX value, which was 4 (out of
range for the 2-bit field) and is now 3, matching RX.
Update the existing spi_xec_qmspi_ldma.c consumer to the new LDMA_CH0
names; identical field values, so no functional change.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
The driver programmed its devicetree-assigned RX/TX DMA channels with
dma_config() without ever reserving them in the DMA controller's
allocation bitmap. A dma_request_channel(dev, NULL) caller on the same
controller (for example a memory-to-memory transfer) could therefore be
handed a channel already owned by SPI, corrupting both transfers.
Reserve each channel at init through dma_request_channel() with a
BIT(channel) filter. This forces exactly the devicetree channel, marks it
allocated in the shared bitmap so it can no longer be handed out, and
fails init if the channel is already in use.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
The async driver reserved its devicetree-assigned RX/TX DMA channels by
poking the DMA controller's dma_context atomic bitmap directly with
atomic_set_bit(). That bypassed the public DMA API, never detected a
channel that was already in use, and dereferenced dma_rx/dma_tx.dma_dev
unconditionally: when only one direction is wired to DMA the other
dma_dev is NULL, so the reservation crashed on a NULL pointer.
Reserve each channel through dma_request_channel() with a BIT(channel)
filter instead. This forces exactly the devicetree channel, registers it
in the same allocation bitmap that dma_request_channel(dev, NULL) callers
(such as memory-to-memory transfers) consult, and returns an error when
the channel is already taken. Each direction is now guarded by its own
NULL check, fixing the single-direction crash.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Remove the seven "nxp,"-prefixed properties of the nxp,kinetis-acmp
binding, deprecated in Zephyr 4.0 in favour of the un-prefixed
enable-pin-out, use-unfiltered-output, enable-high-speed-mode,
filter-enable-sample, filter-count, filter-period and enable-window-mode
properties declared in the same binding.
The MCUX_ACMP_DT_INST_PROP()/_OR() compatibility shims in the sensor-class
driver existed only to fall back to the old names, so they collapse to
plain DT_INST_PROP()/DT_INST_PROP_OR() at the instance definition. The
comparator-class driver already used the new names only.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
This commit enables power management support for the MAX32 timer counter
driver. It allows the driver to enter low-power states when the counter
is not in use, improving energy efficiency.
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Make the `send_oob` function atomic to prevent race conditions and
data conflicts with concurrent IO read operations.
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
Valid slave selects are 0 to SPI_CHIP_SELECT_COUNT - 1, but the guard
used '>', letting slave 4 through to
Cy_SCB_SPI_SetActiveSlaveSelect(). Use '>=' and reword the error
message to match.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Since frame-timeout-supported DT property if of boolean type, use of
dt_compat_any_has_prop() without an explicit value argument of True
makes that function to always return true. Set function argument
value to True to get the expected behavior.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Since supports-2bit, supports-4bit and supports-dtr-4bit DT properties
are of boolean type, use of dt_compat_any_has_prop() without an
explicit value argument of True makes that function to always return
true. Set function argument value to True to get the expected behavior.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The scan and status handlers had no case for the WPA/WPA2 and
WPA2/WPA3 transition authmodes, so mixed-mode access points were
reported as UNKNOWN. Feeding such a result back into a connect
request was then rejected. Map both to WPA_AUTO_PERSONAL, which
is how other Wi-Fi drivers group these modes, and map the DPP
authmode to its own security type.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
parse_freq() only rejected a frequency when strtoul() returned exactly
ULONG_MAX, which does not detect overflow reliably and, on 64-bit hosts
such as native_sim/native/64, lets any value above UINT32_MAX through to
be silently truncated by the cast to uint32_t. 0x100000000 was accepted
and configured the modem at 0 Hz.
Check errno for ERANGE and reject anything that does not fit in the
uint32_t the API takes.
Signed-off-by: Ben Shalem <benshalem93@gmail.com>
enum lora_signal_bandwidth and enum lora_datarate were renumbered to
carry their kHz and spreading factor values directly, but the shell was
not updated:
- bw_table was indexed by the enum value, so a table intended to hold 3
entries became a sparse 501 entry array (~2 kB of rodata) whose values
are identical to their index.
- Only 125, 250 and 500 kHz could be selected, leaving 12 of the 15
bandwidths supported by the API unreachable.
- The spreading factor was limited to SF6..SF12, leaving SF5 unreachable.
Drop the table, print the bandwidth directly, validate the requested
value against the enum and widen the spreading factor range.
Signed-off-by: Ben Shalem <benshalem93@gmail.com>
Add support for enabling the volatile SR write.
It gives more flexibility how to deal with the flash chip.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Add support for the Fitipower EK79007 1024x600 MIPI-DSI panel.
The driver performs the vendor initialization sequence over DCS,
attaches to the host in video mode, and drives the reset and
backlight pins. Pixels are streamed by the display controller the
panel is wired to, so the driver reports the panel geometry and
handles blanking only.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>