The migration from static const struct audio_codec_api to DEVICE_API()
accidentally removed the static qualifier from aic26_api. Restore static
to keep the symbol file-local and match the previous visibility
semantics.
Signed-off-by: Alexandre Rey <alx.rey@icloud.com>
The driver so far hardcoded INT1 (INTMAP1_LOWER at 0x2A) for all
interrupt mappings, so a board that routes only INT2 to the host could
never receive trigger or FIFO watermark interrupts. INT1 and INT2 have
bit-for-bit identical event mapping registers (INTMAP2_LOWER at 0x2B).
Select the connected pin from the int1-gpios/int2-gpios devicetree
properties and route the interrupt mappings to the matching register,
following the pattern already used by the adxl345 driver. When only
int1-gpios is present the driver keeps using INT1, so existing device
trees continue to work unchanged.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
For the power sequence writes, a previous PR accidentally
implemented standard writes instead of raw writes for a
number of register write sequences, which results
in CS40L5x devices never waking from hibernation. Just
need to change the existing writes to raw writes.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The HX8353E's GRAM is 132x162 (columns x rows). Setting rotation to 90
or 270 sets the MADCTL row/column-exchange (MV) bit, which swaps which
GRAM axis the width/height devicetree properties address. The existing
BUILD_ASSERT never accounts for this, so a panel wired at 90 or 270
degrees with e.g. width = 160, height = 128 (a valid 132x162 GRAM
config once swapped) is incorrectly rejected at compile time.
This mirrors the same fix already running in production on real
MD-UV390 PLUS hardware in a downstream out-of-tree board.
Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Andrew Yong <me@ndoo.sg>
Replace direct SDMMC register accesses with the equivalent
sdmmc_ll_* low-level helpers from hal_espressif for interrupt
handling, controller and fifo reset, DMA setup, the command
engine, timeout configuration, card data-busy polling and
bus-width selection. The two duplicated local DMA helpers are
dropped in favor of sdmmc_ll_init_dma and sdmmc_ll_stop_dma.
Register accesses with no low-level equivalent (whole-register
interrupt-mask save, restore and set, and the response fifo
read) are left unchanged.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Every bus width, clock and timing change logged at info level, so
enumerating a card printed a dozen lines of routine progress on
any build with info logging on. An sdio peripheral on the second
slot doubles that.
Drop those messages to debug level. The error paths are
unchanged, so a failure still reports at its original level.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Both slots are served by a single sdmmc controller: one register
block, one command engine, one dma channel and one interrupt
line. The driver kept that state per instance, so enabling a
second slot had the two fight over the shared registers and the
build asserted on more than one slot.
Move the controller-wide state into a shared struct and run the
bring-up once, on whichever slot initialises first. A controller
mutex serialises transactions across slots and records the owner,
so the interrupt handler routes completion events to the right
queue and the per-slot clock divider is reprogrammed through a
clock update command when the bus changes hands. Restore the
saved interrupt mask on every error path in the clock helper,
which previously left the mask blanked and killed the other
slot's interrupts.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The esp32 sdhc driver routed its slot pins directly and had
no path for block-mode CMD53 transfers or for the DAT1 card
interrupt, so an sdio card function could not be driven from
it.
Route the slot pins through the gpio matrix and add CMD53
block and byte transfers plus card interrupt enable and
disable, which an sdio client needs to move frames and to be
woken by the card. The card interrupt is masked in the
handler and re-armed by the consumer, so the enable and
disable helpers avoid sleeping primitives and stay callable
from the callback.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Enable the full-speed USB device controller on STM32L1:
- Assert PLL VCO = 96 MHz at build time (USB clock = VCO / 2).
- Skip the runtime 48 MHz clock check; the clock is deterministic.
- Drive the DP pull-up via SYSCFG_PMC USB_PU (no disconnect GPIO).
- Add the usb controller node and a nop USB PHY in devicetree.
Signed-off-by: Florian Moesch <florian.moesch@draeger.com>
The MIPI_DBI_SPI_READ_REQUIRED macro is used directly in
preprocessor conditionals; the leftover file-scope variable named
var is unused and pollutes the global namespace.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Each detected error was assigned with '=', so simultaneous conditions
reported only the last one checked. OR the flags together.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add support for uc8253 e-paper display driver. This chip shares most
registers layout with uc8151, hence the extension of the uc81xx driver
to also support the uc82xx without changing the filename.
Tested with Waveshare sku22698 e-paper HAT connected to Nucleo f446re
via SPI.
Signed-off-by: Grabowski Łukasz <lukasz.grabowski@pcosa.com.pl>
Propagates haptics API changes to the CS40L26/27 driver, notably
*_calibrate(), *_select_source(), and *_set_level(). Removes
CS40L26/27-specific API functions that were exposed in the
public header that have now been replaced by the haptics API.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The VREFBUF output voltage is factory-calibrated by ST. On series such
as STM32H5 or STM32U5, the VREFBUF loads trimming data automatically
when changing voltage scale. However, on series such as STM32WB, the
software is responsible for loading the correct trimming data from OTP.
Implement reading of trimming data from OTP and manual application of
the proper trimming data by software, gated behind a new Kconfig option
for the driver, CONFIG_REGULATOR_STM32_SOFTWARE_TRIM, enabled by default
on series without automatic loading by hardware (these series' DTSI are
updated to provide the `nvmem-cells` property which gates the option).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
-Add option to have IR using vendor command without PDN toggle
to over come resetting of a non BT CPU in case of COEX scenarios
Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
Add a Dom0 wrapper for XEN_DOMCTL_unbind_pt_irq.
Use SPI-only argument handling, matching the existing bind_pt_irq wrapper.
Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Expose a Dom0 wrapper for XEN_SYSCTL_tbuf_op using the Xen public
headers provided by zephyr-xenlib.
The wrapper follows the existing sysctl helper pattern: validate the
caller-provided request, copy it into xen_sysctl, issue
HYPERVISOR_sysctl(), and copy Xen-updated fields back on success.
Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Fix build error on the ace_v1x_{art,rtc} drivers where compiler
cannot find the register header files. Since those header files
reside at the same directory, convert it to local include.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
make the part that is needed for the esp32 to
change the offsets for the mac and base registers
more generic and use the devicetree for it.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
pcf8523_get_calibration() decodes the offset register with
(offset << 1U) >> 1U, intended to clear the mode bit and sign
extend the signed 7-bit offset field. Under C integer promotion
the expression operates on a 32-bit int, so it is a no-op: the
MODE bit is not cleared and acts as the sign bit of the int8_t
register value instead of the actual field sign at bit 6.
In fast offset mode every readback is decoded through the set MODE
bit, e.g. a stored offset of +9 (register 0x89) reads back as -119
steps. In slow mode, with the offset field now written correctly
masked, a stored offset of -9 (register 0x77) would read back as
+119 steps. Mask the offset field and decode it with
sign_extend().
Built tests/drivers/build_all/rtc (i2c_devices.overlay) for
qemu_cortex_m3 with CONFIG_RTC_CALIBRATION=y. No hardware run;
register-level analysis against the PCF8523 data sheet.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
pcf8523_set_calibration() converts the requested frequency
correction into a period offset and writes it to the offset
register without masking. A positive calibration request becomes a
negative period offset, and bit 7 of its two's complement
representation lands in the MODE bit of the offset register: with
the default slow offset mode, every positive calibration request
silently switches the device into fast mode, where the hardware
applies a 4069 ppb step while the driver computed the value with
the 4340 ppb step (about 6.7% scale error and a different
correction cadence).
Mask the value with the signed 7-bit offset field so the MODE bit
is controlled only by the configured offset mode. The unused
PCF8523_OFFSET_MASK define matches the field exactly.
Built tests/drivers/build_all/rtc (i2c_devices.overlay) for
qemu_cortex_m3 with CONFIG_RTC_CALIBRATION=y. No hardware run;
register-level analysis against the PCF8523 data sheet (offset
register, table 29).
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Add an I2C driver for the Analog Devices ADXL313 3-axis accelerometer
with classic sensor API support for range and ODR configuration.
Use i2c_reg_update_byte_dt for register read-modify-write, reconfigure
range/ODR in standby, and add build_all coverage plus a release-notes
entry.
Signed-off-by: Leo Li <leo.li@rakwireless.com>
Fix for RTIO streaming. When stream is canceled
with rtio_sqe_cancel before IRQ or when sequence
for getting data from FIFO, data->sqe is set to NULL.
This will result with early exit from some functions.
Because data->fifo_watermark_irq remain set, it was
not possible to start new stream.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
The BMP581 SPI protocol requires every data byte in a multi-byte write
to be preceded by its register address. The driver currently submits
one address followed by all data bytes, so the second data byte is
interpreted as another register address.
Build one two-byte RTIO SQE for each register-address/data pair and
chain the SQEs as one transaction to keep CSB asserted. Leave the I2C
and I3C paths unchanged.
Update the SPI emulator to parse address/data pairs independently of
SPI buffer boundaries. This supports the corrected transaction layout
and rejects the previous malformed write sequence.
This allows OSR_CONFIG and ODR_CONFIG to be programmed correctly
during initialization and prevents the data registers from remaining
at their reset values.
Tested by building samples/sensor/pressure_polling for an STM32F407
target.
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Yu He <auhy@mail.scut.edu.cn>
After a soft reset, BMP581 returns to its power-up I2C/I3C mode.
The first SPI transaction selects SPI mode and returns invalid data.
The driver performs the post-reset dummy read only after soft_reset()
returns. However, soft_reset() reads INT_STATUS first, so the status read
is consumed as the SPI activation transaction and initialization fails
with -EFAULT.
Move the dummy read into soft_reset(), after the reset delay and before
reading INT_STATUS. The I2C and I3C paths remain unchanged.
Tested by building samples/sensor/sensor_shell for
arcap/stm32f407xx.
Link: https://github.com/zephyrproject-rtos/zephyr/pull/109240
Link: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp581-ds004.pdf
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Yu He <auhy@mail.scut.edu.cn>
these drivers are already conditionally
included/added in drivers/CMakeLists.txt
so we dont' need another if.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
the hal based stm32 ethernet driver has no support
for PTP on the stm32f1, f2 and f4, so use the dwc_mac
driver when PTP support is needed.
Signed-off-by: Fin Maaß <info@finmaass.de>
the hal based esp32 ethernet driver has no support
for PTP, so use the dwc_mac driver when PTP
support is needed.
Signed-off-by: Fin Maaß <info@finmaass.de>
Describe the EMAC PTP reference clock as a second clock on the
esp32p4 Ethernet node so it can be enabled and queried through
the clock control driver.
The rate is resolved from the PTP reference clock source, so
Ethernet PTP support does not need to assume a fixed frequency.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
After a read the cache invalidation only covered one block even
for multi-block transfers, leaving the remaining blocks to be read
from stale cache lines. Invalidate the full transfer size, which
matches the range flushed when the DMA descriptors are prepared.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
In the processor 1 macro block, every helper maps to the LL_C1
variant except IPCC_DisableReceiveChannel, which used the LL_C2
function and therefore masked the other core's receive channel.
Disabling reception was a no-op on the local core and corrupted
the remote core's mask instead.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This patch fixes the initialization of Affinity Routing if Zephyr is ran
as a Non-secure software. The layout of the Distributor Control register
is different, when accessed from Secure or Non-secure world.
Signed-off-by: Mateusz Karlic <mkarlic@antmicro.com>
Add a driver for Espressif's analog comparator (ana_cmpr) peripheral
against the generic comparator API, for ESP32-P4, ESP32-C5 and
ESP32-H2.
This IP revision only latches edge-cross events; there is no register
reflecting the instantaneous comparison result, so get_output() is not
supported and returns -ENOTSUP. Source and reference GPIO pads are
fixed per SoC/unit and configured as pure analog inputs during init.
Units whose interrupt source is shared with another unit (ESP32-P4) or
another peripheral (ESP32-H2's GPIO driver) use
esp_intr_alloc_intrstatus() with a per-instance status register/mask
so the interrupt controller can dispatch to each handler
independently.
The ISR is the only code that ever touches the hardware status
registers: it clears whatever int_st reports (already masked to the
armed trigger by int_ena) and either invokes the user callback or
latches a software pending flag, which trigger_is_pending() then just
reads and clears.
Hardware-validated on ESP32-C5-DevKitC-1, ESP32-H2-DevKitM and
ESP32-P4-Function-EV-Board via the gpio_loopback comparator test (see
next commits).
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
On ESP32-H2, the analog comparator (ana_cmpr) unit shares its
interrupt source (GPIO_INTR_SOURCE) with the GPIO peripheral, but uses
its own separate status/enable/clear registers (GPIO_EXT.*). Register
the GPIO driver's own interrupt via esp_intr_alloc_intrstatus() with
ESP_INTR_FLAG_SHARED, scoped to the GPIO status register/mask, so both
drivers can coexist on the same line independently.
Only takes effect when the new ana_cmpr driver is enabled, so this is
a no-op otherwise.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
Convert the RV3028 driver from an RTC-only driver into a
multi-function device driver.
The RV3028 provides multiple functional blocks including RTC,
EEPROM, RAM and timestamp functionality. Split the existing
driver into an MFD parent and RTC child driver to allow the
additional features to be supported through their respective
Zephyr subsystems.
The existing RTC functionality remains unchanged.
Signed-off-by: Janez Ugovsek <janez@ugovsek.info>
Capture the timestamp at GPIO callback time (IRQ time) rather than
in the RTIO completion callback after the data has been read. Add odr
to the encoded header, fix base_timestamp_ns to reflect the time of
the first FIFO sample, and add timestamp_delta per sample, matching
the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 8cdcdeb189e63e0fed1cc06b2eb7a74fd9e9ce5d)
Add a MUX controller backend for the Analog Devices ADGM3121 DPDT MEMS
switch (DC-24GHz). The four switches are modeled as a single control line
whose state is a 4-bit switch bitmask (bit i = SW(i+1), 1 = closed):
mux_control_set() drives all four at once, mux_control_disconnect() opens
them all, and mux_state_get() reads the mask back. Both SPI (adi,adgm3121)
and parallel GPIO (adi,adgm3121-gpio) control modes are supported.
Co-authored-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Add a generic GPIO-backed mux controller: the selected state value is
binary-encoded LSB-first across the GPIO lines listed in the mux-gpios
property (bit N -> mux-gpios[N]). Useful for board-level analog/digital
muxes that are simply wired to MCU GPIOs.
Single-channel by design, so the binding pins #mux-control-cells = 0
and #mux-state-cells = 1. The driver plugs into the existing mux
subsystem (set / get_state ops) and reuses CONFIG_MUX_INIT_PRIORITY, so
consumers reference it through the generic mux-controls / mux-states
model.
Co-authored-by: Felix Wang <fei.wang_3@nxp.com>
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The mux subsystem redefines the "nxp,inputmux" binding as a mux
controller (#mux-control-cells / #mux-state-cells). The SCTimer PWM
capture path still programmed the INPUTMUX directly through the
fsl_inputmux HAL using two parallel "input-channels" /
"inputmux-connections" arrays, so on SoCs that expose the mux
controller node the two models conflicted. Move SCTimer capture onto
the generic mux model:
- nxp,lpc55S3x: add the INPUTMUX mux controller node (disabled by
default) so capture consumers can reference it; enabled per board.
- nxp,sctimer-pwm.yaml: drop the input-channels / inputmux-connections
arrays and include mux-consumer.yaml; the capture routing is now a
single "mux-states" phandle-array carrying <&inputmuxN index
connection>.
- pwm_mcux_sctimer: drop the direct fsl_inputmux HAL calls and apply
the routing through mux_state_apply(), guarded by device_is_ready().
The mux controllers init at priority 40, before PWM at 50, so they
are ready at SCTimer init time.
- Migrate the lpcxpresso55s36 pwm_loopback overlay to the mux-states
syntax and enable the INPUTMUX node.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The mux subsystem redefines the "nxp,inputmux" binding as a mux
controller (#mux-control-cells / #mux-state-cells), which collided with
the EQDC driver's use of the same compatible through a
"specifier-space: inputmux" phandle-array. Reconcile the two by moving
the EQDC PHASEA/PHASEB input routing onto the generic mux model:
- nxp,mcxa156 / nxp,mcxa344 / nxp,mcxaxx6: switch the inputmux node
from #inputmux-cells to #mux-control-cells / #mux-state-cells so it
validates against the new binding (nxp,mcxa153 was already done).
- nxp,mcux-eqdc.yaml: drop the local inputmux-connections property and
include mux-consumer.yaml; routing is now described with "mux-states".
- eqdc_mcux: drop the direct fsl_inputmux HAL calls and apply the
routing through mux_state_apply(), guarded by device_is_ready(). The
mux controllers init at priority 40, before the sensor at 90, so they
are ready at EQDC init time.
- Migrate the frdm_mcxa153/156/266/344/346/366 QDEC sample overlays to
the mux-states syntax.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The mux subsystem redefines the "nxp,inputmux" binding as a mux
controller (#mux-control-cells / #mux-state-cells), which collided with
the previous ctimer PWM-capture use of the same compatible through a
"specifier-space: inputmux" phandle-array. Reconcile the two by moving
ctimer PWM capture onto the generic mux model:
- nxp,mcxa153: switch the inputmux node from #inputmux-cells to
#mux-control-cells / #mux-state-cells.
- nxp,ctimer-pwm.yaml: drop the local inputmux-connections property and
include mux-consumer.yaml; routing is now described with "mux-states".
- pwm_mcux_ctimer: drop the direct fsl_inputmux HAL calls and apply the
routing through mux_state_apply() guarded by device_is_ready(). The
route is applied when capture is configured, where all devices are
ready. Update the test overlay to the mux-states syntax.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>