gpio drivers need to have struct gpio_driver_config and
struct gpio_driver_data at the first position of the data
and config struct.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Enabling proper zoom/scaling for windowed resolutions;
e.g. smaller than uxga
That makes camera's ISP to downscale frame to a desired resolution
Signed-off-by: Roman Pustobaiev <romanpustobayev@gmail.com>
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
There is no standard way to launch a secondary CPU out of its quiescent
state. While ARM Cortex-A cores use standardized secondary cpu launch
methods like PSCI or spin-tables, other multi-core SoC's (eg.
raspberrypi rp2350, nxp lpc55s69, etc) enable-methods are entirely
vendor-specific.
The devicetree specification section 3.8.1 describes the enable-method
property of a cpus/cpu* node. It may have the value "[vendor],[method]"
which describes the vendors-specific method by which a CPU is released
from a disabled state.
Remove enum from enable-method binding and update DT macros that relied
on enable-method being an enum type property.
Document the [vendor],[method] value in the enable-method property of
cpu.yaml.
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
CONFIG_I2C_RTIO=y enables CONFIG_I2C_STM32_INTERRUPT since STM32 I2C RTIO
drivers are only supported with interrupts enabled.
Remove the sentence in I2C_STM32_V2 config symbol description about
I2C_STM32_INTERRUPT selection since it is already explicitly stated by
the 'select' command and makes I2C_STM32_V2 description more consistent
regarding I2C_STM32_V1 description.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add the HCI driver that carries Bluetooth traffic over the
esp-hosted-mcu transport core, so Wi-Fi and Bluetooth share the
single link to the coprocessor. The driver asks the coprocessor
to initialise and enable its controller, then acts as a raw H4
bridge.
Received frames are copied into a slab slot on the shared receive
thread and rebuilt on a dedicated delivery thread, so waiting on
a host buffer pool cannot stall the Wi-Fi path. The framed
transport adds call depth on the tx processor thread, which runs
the driver send path, so its stack default is raised.
The coprocessor firmware advertises the controller to host flow
control commands but rejects them, so the binding sets the
no-flow-control quirk by default.
Extended advertising is left to the application. The coprocessor
is a separate part whose Bluetooth generation is not known when
the host is built: an esp32 provides Bluetooth 4.2 and has none,
while the riscv parts provide 5.0. Keep the legacy advertising
commands available so either generation works.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add the Wi-Fi driver for an Espressif coprocessor running
esp-hosted-mcu firmware. The driver registers station and access point
interfaces with the network stack and carries their frames over the
esp-hosted-mcu transport core.
Management operations are driven over RPC against the coprocessor
esp_wifi API: scan, connect and disconnect, access point enable and
disable, mode and channel, power save, connected access point details
and station deauthentication. Connection results and station events
are reported asynchronously from the coprocessor event stream.
Assisted-by: Claude Code:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add the transport core shared by the esp-hosted-mcu Wi-Fi and
Bluetooth drivers. The core owns the framing, the checksum, the
sequence counter and the RPC request and response matching, and it
demuxes received frames to the registered interface consumers.
Transports are pure byte movers behind a four function vtable, so the
protocol handling stays in one place. Both an sdio backend, driving
the coprocessor SLC register window, and a full duplex spi backend
with reset, handshake and data-ready lines are provided; the transport
is selected at build time from devicetree.
At init the core asks the coprocessor for its firmware version and
logs it, falling back to the version carried in the boot event when
the firmware is too old to answer. The expected version is only a
Kconfig declaration: the firmware is flashed to a separate chip, so
a mismatch is warned about and never fails init.
The boot event also carries the SDIO datapath mode. When the
coprocessor aggregates frames it pads each one to a four-byte
boundary, so the receive walk reads the advertised mode and steps by
the aligned stride; a byte-tight coprocessor is unaffected.
Assisted-by: Claude Code:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
A UART that woke the SoC keeps PM_STATE_SUSPEND_TO_IDLE locked forever
once the hardware receiver timeout is in use.
The WKUP interrupt takes the lock and sets rx_woken. The IDLE arm of
uart_stm32_isr() would release it, but set_timeout_itr() disables the
IDLE interrupt when it programs RTOR, so the RTO arm reports the end of
reception instead and only clears the flag and flushes. The lock is never
released, so the system never enters a Stop state again.
Move acquire and release into helpers and call them from both paths, so
the behaviour at the end of reception is consistent.
Also move enable_wakeup_line out of the block with the PM policy helpers.
Tested on a nucleo_l476rg, cyclic asynchronous reception with PM enabled.
Fixes: #116273
Signed-off-by: Eden Frosst <eden.frosst@rbr-global.com>
Add a driver for the Aesc Silicon SPI XIP controller, exposing the
execute-in-place mapped SPI NOR flash as a Zephyr flash device. The
flash region is a soc-nv-flash child of the "aesc,spi-flash-controller"
node.
Reads are served from the memory-mapped XIP window. Programming is not
supported yet, so write() and erase() return -ENOSYS.
When the "aesc,quad-mode" property is set, the driver switches the
controller and flash to quad read mode at init, skipping the
reconfigure when a bootloader already enabled it.
Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
Convert the Xtensa CCOUNT/CCOMPARE timer to system_timer_generic.h.
CCOMPARE fires only on CCOUNT == CCOMPARE, so an already-past target is
missed until CCOUNT wraps: that is the COMPARE_EXACT backend, whose
verify loop replaces the minimum-delay bump the driver applied by hand.
The driver keeps timer_driver_cycle_get() (CCOUNT) and
timer_driver_set_compare() (CCOMPARE), and the core takes over the tick
accounting: the last_count baseline, the tickful re-arm and the
sys_clock_elapsed()/set_timeout() tick math all go. smp_timer_init()
primes the per-CPU timer through timer_core_smp_prime().
ccount() still adds the low-power compensation offset, so the cycle count
and every announced delta pick it up. The Espressif LPM hook
(CONFIG_XTENSA_TIMER_LPM_TIMER_HOOK) moves to sys_clock_idle_enter() and
folds the missed cycles into that offset; the non-low-power idle path
drops to the weak sys_clock_idle_enter() default, which arms through
sys_clock_set_timeout().
The low-power exit hands its recovered span to the core directly rather
than folding it into the counter for the announce to find. CCOUNT is 32
bits, so a sleep can outrun what the masked delta resolves, which at
240 MHz is under nine seconds. The compensation still takes the same
span, so the counter stays in step and what CCOUNT did see is left for
the next announce.
kernel.timer.sloppy_idle gains qemu_xtensa/dc233c: with nothing pending
the core arms the longest interval it allows, so the time base keeps
running.
timer_api, context, sleep and tickless pass on qemu_xtensa/dc233c.
Build-verified on esp32 with the LPM hook (CONFIG_PM=y) and with SMP.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Writing CCOMPARE is what clears the pending timer interrupt. The ISR
never wrote it in tickless mode, relying on sys_clock_set_timeout()
being reached after the announce to do so.
That holds only as long as something does call it. On SMP each CPU has
its own CCOMPARE, but sys_clock_announce_locked() returns early on all
but the announcing one, so the rest return from the ISR with the
interrupt still pending and take it again immediately. Nothing
guarantees a new deadline is armed on UP either: with no timeout pending
the kernel may legitimately choose not to.
Write a compare one behind the current count on entry. That clears the
interrupt, and since the match is on equality it also puts the next one a
whole counter period away, which is as far as a 32-bit comparator
reaches. The arming path overwrites it in the normal case.
Split the raw CCOUNT read out of ccount() so the ISR can form that value
without the low-power compensation the cycle domain carries.
Fixes: #115442
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The implementation of EM4 wakeup pin support assumed all ports
have at least one EM4WU capable pin. Support the case where
EM4WU pins may not be available on every port.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Microchip MEC5 SoCs use the same Synopsys DWC_mipi_i3c IP as other
supported platforms, wrapped with XEC-specific interrupt routing and
a HOST_CFG port-select register. Reuse the existing DW I3C driver by
adding a microchip,xec-i3c compatible and binding for MEC5 I3C nodes.
Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
Assisted-by: Claude:claude-opus-5
Convert the MIPS CP0 timer to system_timer_generic.h. The CP0 Count
counter with its Compare register is a COMPARE backend, and the first
converted driver whose counter actually wraps during operation: on
32-bit MIPS TIMER_CORE_COUNTER_WIDTH defaults to the native 32 bits, so
the core masks every delta at the 2^32 boundary.
Compare raises the interrupt only on Count == Compare, so an
already-past target is missed until Count wraps all the way around. That
is the COMPARE_EXACT backend: the core writes the register through its
verify loop, replacing the driver's own bump-and-retry and its MIN_DELAY
floor in both set_timeout and the ISR. Writing Compare also clears the
interrupt.
The core now owns the tick accounting and the locking, so the driver's
private spinlock is gone. This also fixes a slow drift: the driver
resynced its baseline to the raw count each ISR and discarded the
sub-tick remainder, where the core keeps the baseline tick-aligned.
timer_api and context pass on qemu_malta, which joins the sloppy-idle
timer_api variant.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
A down-counter reloaded from the preload register 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, declared 28 bits wide like the hardware. That read touches
state the ISR and the reload path also write, so the core is told the read
is not atomic and serialises the public getters, as the driver's own getter
did.
The core takes over the tick accounting, which removes the split between
the tickless and ticked builds: last_announcement, two ISR variants, two
sys_clock_elapsed() variants and the deadline computation all collapse into
one ISR that accounts the consumed reload and announces, plus a reload
primitive that folds in what a replaced reload had counted.
The same overflow as in the Realtek driver was here too: the tickless ISR
reloaded MAX_TICKS * CYCLES_PER_TICK, which is TIMER_MAX rounded down and
then multiplied again, wrapping past the counter's 28 bits. It now reloads
the counter's maximum. sys_clock_elapsed() likewise took the absolute value
of a difference computed backwards; the core computes it once, from the
counter.
sys_clock_idle_enter() takes over stopping the timer, the one place it is
safe: the CPU is on its way to sleep, so nothing is left to read a
synthesized count that stops with it, and sys_clock_idle_exit() starts it
again. The magic tick value that used to request it could arrive with the
CPU still running, outside any locked section.
Build-tested on mec172xevb_assy6906, tickless and tickful, with and without
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The counter and the alarm are two different timers here, which the core
keeps apart. The cycle domain is the free-running 32-bit timer, counting
down from 0xffffffff and read back inverted; the wakeup is a separate
24-bit event timer, a one-shot countdown. That makes it a RELOAD backend
whose range is bounded by the event timer rather than by the counter. Both
select the same clock, so the core's cycles are the event timer's without
conversion.
The core takes over the tick accounting: last_announced_hw_cnt, last_ticks
and last_elapsed go, and with them the deadline computation and the clamp
that turned a tick count into an event-timer count. What is left is the
register sequence in timer_driver_set_reload() and an ISR that
acknowledges, re-arms the one-shot event timer for a ticked kernel, and
announces. sys_clock_set_timeout(), sys_clock_elapsed() and
sys_clock_cycle_get_32() come from the core, the last in the same domain
the driver reported. HW_CNT_PER_SYS_TICK and EVEN_TIMER_MAX_CNT_SYS_TICK
go with them, the one cycles-per-tick user left, the one-tick event timer
a ticked kernel starts at init, reading TIMER_CORE_CYC_PER_TICK instead.
IDLE_BLOCK_TIMER_TICKS spelled the same microsecond-to-cycle division out
by hand and becomes k_us_to_cyc_ceil32().
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE used to leave the event timer disabled
once the timeout queue drained. The core arms the longest span the event
timer can hold instead; sys_clock_no_timeout() is not implemented.
Build-tested on it8xxx2_evb, tickless and tickful, with and without
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The counter and the alarm are two different timers here, which the core
keeps apart. The cycle domain is the free-running 32-bit timer, counting
down from 0xffffffff and read back inverted; the wakeup is a separate
24-bit event timer, a one-shot countdown. That makes it a RELOAD backend
whose range is bounded by the event timer rather than by the counter. Both
select the same clock, so the core's cycles are the event timer's without
conversion.
The core takes over the tick accounting: last_announced_hw_cnt, last_ticks
and last_elapsed go, and with them the deadline computation and the clamp
that turned a tick count into an event-timer count. What is left is the
register sequence in timer_driver_set_reload() and an ISR that
acknowledges, re-arms the one-shot event timer for a ticked kernel, and
announces. sys_clock_set_timeout(), sys_clock_elapsed() and
sys_clock_cycle_get_32() come from the core, the last in the same domain
the driver reported. HW_CNT_PER_SYS_TICK and EVEN_TIMER_MAX_CNT_SYS_TICK
go with them, the one cycles-per-tick user left, the one-tick event timer
a ticked kernel starts at init, reading TIMER_CORE_CYC_PER_TICK instead.
The ticked path announced MS_TO_COUNT(HW_CYCLES_PER_SEC, 1) ticks per
interrupt, a cycle count where a tick count was wanted, so a ticked kernel
on this driver ran its uptime fast by that factor. The core announces what
the counter says.
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE used to leave the event timer disabled
once the timeout queue drained. The core arms the longest span the event
timer can hold instead; sys_clock_no_timeout() is not implemented.
Build-tested on it51xxx_evb, tickless and tickful, with and without
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The free-running 64-bit TSC with an absolute deadline (the TSC_DEADLINE
MSR, or the local APIC timer ICR in one-shot mode as the fallback) is a
COMPARE_ORDERED backend. The driver keeps timer_driver_cycle_get()
(rdtsc) and timer_driver_set_compare() (set_trigger), and the core takes
over the tick accounting, the deadline math, the range clamp and the
announce. The last_cycle baseline and the sys_clock_elapsed() /
sys_clock_set_timeout() tick math go, the ISR reduces to an announce,
and smp_timer_init() keeps copying CPU0's LVT to each secondary.
The TSC is 64 bits wide even on a 32-bit build, so the driver states
that width; the old code divided its deltas at the native register
width.
The deadline arm range narrows from the driver's former three-quarter
span to the core's default half span, which reserves the upper half as
IRQ-latency headroom so a late announce of a maximum-length arm still
yields an in-range delta.
The set_timeout() guard that pinned a deadline to UINT64_MAX when the
computed deadline wrapped the 64-bit TSC goes; the core's range clamp
bounds the arm instead.
Built on qemu_x86_64 and qemu_x86 with the TSC deadline comparator, and
on qemu_x86_64 with the APIC_TIMER_TSC ICR fallback.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
If errata 16 is present mailbox (vevif) driver need to start as soon
as possible, just after the launcher. 0 priority level is common so
there might a delay between starting the launcher and initializing the
mailbox driver for receiving events from the VPR core. When errata 16
is present, less common level is used to minimize the time when
events from VPR could get lost.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This mailbox is used only for communicating with VPRs started by
the VPR launcher. Some SoCs has an error where events from VPR triggered
before mailbox initialization is completed might be lost. On the other
hand mailbox driver cannot be started before VPR as it accesses registers
which are powered up by the launcher. We need to minimize the time between
VPR launching and mailbox initialization. It is acheived by using adjacent
priorities.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The baudrate divisor calculation should take the fractional parameter
into account when a DLF-capable UART is used. Otherwise non-optimal
integer divisors can be derived, especially for low pclk or high
baud_rate values.
Signed-off-by: Andreas Weissel <andreas.weissel@synaptics.com>
SysTick is an auto-reload 24-bit down-counter, so a RELOAD backend. The
driver keeps its hardware-specific parts, the synthesized cycle count
with COUNTFLAG-based wrap detection and the LOAD reprogram with its
drift compensation. The core takes over the tick accounting:
announced_cycles and last_elapsed go, along with the deadline-to-reload
conversion, the range clamp and the announce. The 24-bit LOAD caps the
arm range, and the existing min_delay becomes the reload floor.
The driver carries no cycles-per-tick of its own. The reload floor is
already a cycle count, so the only remaining use for that value is the
one-tick LOAD at init and on the low-power restart, which reads the
core's TIMER_CORE_CYC_PER_TICK. The "tickless does nothing" pragma goes
too, the core build-asserting a non-zero cycles-per-tick.
The synthesized count is 32 bits whatever
CONFIG_CORTEX_M_SYSTICK_64BIT_CYCLE_COUNTER says. That option used to
widen it to 64, putting 64-bit arithmetic on every path to serve one: a
low-power sleep can outrun a 32-bit count, and routing it through the
counter was the only way to announce it. sys_clock_idle_exit() hands
that span to the core directly instead, advancing the counter across it
so the two stay in step, so only that path pays for the wider math. The
option is left advertising sys_clock_cycle_get_64() to the rest of the
system, which is all it was ever about.
The counter is no longer stopped when the timeout queue drains. That is
what CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE did here, and it froze
k_cycle_get_32() under a running thread. The core arms the longest
reload the hardware can hold instead, and the stop 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.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Assert CS with zero-byte transaction since BLE HCI SPI(hci_spi_st.c) driver
relies on zero-byte transaction for asserting CS.
It fixes the SPI communication for radio co-processors (RCP).
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
That is the only driver in the tree that uses odd flags from the
bitfield in struct udc_ep_stat. udc_ep_stat may have RMW bugs due to
bitfields modified from different contexts. The use of odd bitfield is
safe in this driver, as all writes are in the ISR handler.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
_i2c_set_peri_divider() called ifx_cat1_utils_peri_is_fract_div() twice to
gate two separate branches. Compute it once into a named boolean and reuse
it, making the fractional-versus-integer divider handling easier to follow.
No functional change.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
The clock_peri_group data member and the PERI_INFO() initializer macro
that sets it are write-only in this driver: the member is populated from
devicetree at build time but is never read anywhere in the driver. The
divider source frequency is reconstructed directly from the running
clock (current_output * current_ratio), so the peripheral-group index is
not needed here.
Remove the member, the PERI_INFO() macro definition, and its two
invocations in I2C_PERI_CLOCK_INIT().
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
ifx_cat1_i2c_init() always brought the controller up at I2C_SPEED_STANDARD,
ignoring the devicetree "clock-frequency" property. A controller therefore
came up at 100 kHz regardless of the configured rate, and an explicit
i2c_configure() call was required to reach the requested speed.
Map the devicetree clock-frequency (already stored in
config->master_frequency) to a bitrate and pass it to
ifx_cat1_i2c_configure() at init so the bus is usable at the configured
rate without an i2c_configure() call. Move the i2c-priv.h include out of
the CONFIG_I2C_INFINEON_BUS_RECOVERY guard since i2c_map_dt_bitrate() is
now needed unconditionally.
Measured SCL on kit_pse84_eval (m33) with clock-frequency set to FAST and
no i2c_configure() call from the application:
Before: 93 kHz (STANDARD - property ignored)
After: 362 kHz (FAST - matches the configured rate)
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
The Infineon CAT1 I2C driver only programmed the SCB oversampling-clock
divider on PSoC 4. On every other CAT1 family the runtime divider was
never set, so a STANDARD, FAST or FAST_PLUS configuration all ended up
producing the same SCL frequency (whatever the static devicetree divider
happened to yield) instead of the requested data rate.
Replace the dead USE_I2C_SET_PERI_DIVIDER path and the PSoC 4-only
_i2c_set_peri_divider_psoc4() with a single _i2c_set_peri_divider()
compiled for all families. It maps the requested data rate to the SCB
oversampling-clock window, reconstructs the divider source frequency
(source = current_output * current_ratio, which is independent of the
family's HFCLK-to-peripheral-group routing), programs the integer or
fractional peripheral divider, and lets Cy_SCB_I2C_SetDataRate() derive
the SCL low/high phases. The divider is already running (it feeds the
SCB), so the value change follows the disable -> set -> enable sequence
the DIV_CMD register requires, and the Cy_SCB_I2C_SetDataRate() return is
checked so an unachievable rate is reported. The routine now returns a
negative errno on failure so ifx_cat1_i2c_configure() can propagate the
error.
Use the ifx_cat1_utils_peri_pclk_get_divider(),
ifx_cat1_utils_peri_pclk_get_frac_divider(),
ifx_cat1_utils_peri_pclk_disable_divider() and
ifx_cat1_utils_peri_is_fract_div() clock-control helpers to read back the
current divider ratio, disable the divider before reprogramming it, and
select the integer or fractional divider path by type instead of an
unclear block bitmask at the call sites.
Measured SCL on kit_pse84_eval (m33) after the change: STANDARD 100 kHz,
FAST 362 kHz, FAST_PLUS 862 kHz. Before the change all three speeds
produced the same rate regardless of the requested speed.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Add support for STM32H5E/F line SoCs: in particular, the power
initialization sequence for OTG_HS usage was incomplete.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add code to enable automatic trimming of the HSI48 clock using USB SOF
interrupts using the built-in Clock Recovery System (CRS).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The BT_HCI_RAW_H4 and BT_HCI_RAW_H4_ENABLE Kconfig options lost their
last code references in commit 26d97164be ("Bluetooth: HCI: Use H:4
encoding for buffers"), which made the HCI raw layer use H:4 packet
encoding for all buffers unconditionally. Since then setting these
options has had no effect.
Remove the option definitions, the stale references in the sample
configurations, as well as a dead conditional default in the
BT_DRV_RX_STACK_SIZE option. Document the removal in the release
notes; since the options have been no-ops for several releases and
were never part of a deprecation cycle, there is no migration to
describe beyond dropping them.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Mechanism of early interrupt handling introduced for
nRF54L errata 16 can be used even if the anomaly
itself is not present on a chip.
It can solve the issue of missed events from early
booting VPR core.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Remove the duplicated reference switch by wrapping
adc_emul_ref_get() from adc_emul_get_ref_voltage().
Assisted-by: Cursor:grok-4.5
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Allow drivers to expose a runtime millivolt scale for any
adc_reference via optional ref_get. adc_ref_internal() becomes a
wrapper; adc_raw_to_*_dt prefers adc_ref_get() and falls back to
channel DT zephyr,vref-mv on failure.
Update adc_emul and tests accordingly.
Tested with: west twister -T tests/drivers/adc/adc_emul -p native_sim
Assisted-by: Cursor:grok-4.5
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Wire emulator INTERNAL reference storage through the optional getter,
so host tests can exercise dynamic adc_ref_internal() via
adc_emul_ref_voltage_set().
Tested with: west twister -T tests/drivers/adc/adc_emul -p native_sim
Link: https://github.com/zephyrproject-rtos/zephyr/issues/113971
Assisted-by: Cursor:grok-4.5
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Implement suspend, resume and remote wakeup. Make sof_enable callback a
no-op because controller automatically handles SOF generation when the
port is not suspended.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
If GPPI is using IPC communication then delay the initialization of an
UARTE instance which is using GPPI connection after GPPI is initialized
which happens after IPC service is setup.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Implemented get_iface_caps() in NXP wifi driver. It will check net
interface capability and return corresponding bitmask of
BIT(enum wifi_nm_iface_type).
Signed-off-by: Hui Bai <hui.bai@nxp.com>
Enable the on-board self-capacitive touch electrode E2 on
frdm_mcxa577 by wiring up the existing nxp,tsi-input driver,
following upstream commit that added TSI to the mcx_n9xx/n5xx boards.
Add a tsi0 node to the shared MCXA5x SoC devicetree (base offset
0xc3000, End-of-Scan / Out-of-Scan IRQs 124/125, MCUX_TSI_CLK),
disabled by default. On the board, add the TSI0_CH0 (P5_3) pinctrl
group, enable &tsi0 mapping E2 -> INPUT_KEY_A, set up the TSI clock
in board_early_init_hook (attach kFRO_HF_DIV_to_TSI0, divider 4),
and mark tsi as supported.
The clock_control mcux_syscon driver previously enabled only the
MCXN TSI gate (kCLOCK_Tsi). MCXA uses kCLOCK_GateTSI0, so make the
gate enable family-aware; without it the peripheral is unclocked and
the driver's init-time calibration faults the CPU before the console
comes up.
Tested on frdm_mcxa577 with samples/subsys/input/input_dump:
touching E2 emits INPUT_KEY_A press/release events.
Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
channel_mask is a uint32_t, so the driver can only address TSI
channels 0..31 regardless of how many the hardware exposes. On SoCs
with more than 32 channels (e.g. MCXA577 has 70) two problems arise:
BIT_MASK(FSL_FEATURE_TSI_CHANNEL_COUNT) overflowed the 32-bit shift in
the mask range check, and the per-channel state array was sized to the
full hardware count, wasting RAM on channels that can never be used.
Introduce MCUX_TSI_MAX_CHANNELS = MIN(FSL_FEATURE_TSI_CHANNEL_COUNT,
32) and use it for the state array, the mask range check, the scan
round-robin bound, and the calibration loop. This fixes the shift
overflow and drops the wasted per-channel state (about 300 B of RAM
on MCXA577).
Built samples/subsys/input/input_dump for frdm_mcxa577.
Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>