Commit graph zephyr/drivers
Author SHA1 Message Date
Andrzej Głąbek
20736f9345 drivers: flash: jesd216: Extend JESD216_SFDP_4B_ADDR_DW bit definitions
Add more symbols for bits of the 1st DWORD of the 4-Byte Address
Instruction Table.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2026-10-28 22:34:08 -04:00
Andrzej Głąbek
67624fd022 drivers: flash_mspi_nor_sfdp: Take into account read/write IO modes
This is a follow up to commit c696414f8f.

When specific IO modes are configured in dts for read and/or write
operations, they should be used, instead of the `mspi-io-mode` value,
also in macros that prepare the default content for the command info
structure.

On this occassion, the used data rate enumeration values are corrected.
For example for the 1S-8D-8D mode now `MSPI_DATA_RATE_S_D_D` is used
instead of incorrect `MSPI_DATA_RATE_DUAL`.

Finally, as commit 8dd7b20f84 introduced
definitions for octal page program commands, those are also applied.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2026-10-28 22:34:08 -04:00
Ali Talha Yurtseven
7dc98b0f85 drivers: sensor: icm20948: Add the AK09916 magnetometer
The magnetometer of the ICM-20948 is a separate die with its own I2C
address, reachable only through the auxiliary I2C master of the part.

Bring that master up and use slave 4, the only channel that reports
completion and failure, to identify and start the magnetometer. Then arm
slave 0 to copy its output registers into the external sensor registers
on every cycle, so that keeping them current costs the host nothing.
Those registers directly follow the temperature registers, which lets a
single burst read collect every sensor on the part.

The readout starts at ST1 and so ends on ST2. Reading ST2 is what tells
the magnetometer that the sample was taken, and a readout that leaves it
out returns the same measurement forever.

Those mirrored registers keep their last contents when the auxiliary bus
stops answering, which would make a stale sample indistinguishable from
a fresh one. Read the master status alongside them and report the
magnetometer channels as failed while slave 0 is going unacknowledged.

The magnetometer die is mounted turned half a turn about X with respect
to the rest of the part, so Y and Z are inverted to bring it into the
frame the accelerometer and the gyroscope report in.

Select the SPI interface explicitly while doing all this. The part picks
its host interface by watching the bus and the reset in the init
function throws that choice away, and the primary I2C slave holds pins
that the auxiliary master needs.

The magnetometer can be left out with CONFIG_ICM20948_MAGN_EN.

Signed-off-by: Ali Talha Yurtseven <alitqlhq@gmail.com>
2026-10-28 22:34:03 -04:00
Ali Talha Yurtseven
b1ae53e500 drivers: sensor: Add a driver for the InvenSense ICM-20948
The ICM-20948 is a nine-axis motion tracking device. The accelerometer
and the gyroscope sit behind the primary SPI interface, while the
magnetometer is reached through an auxiliary I2C bus of the device.

Add support for the accelerometer, the gyroscope and the die
temperature over SPI. The magnetometer is left for later.

The registers of the part are spread over four user banks that are
paged in through a select register. Encode the bank in the high byte
of every register constant and let the bus layer page it in when it
differs from the last one selected, so that the body of the driver
never deals with banks.

The full scale range and the bandwidth of the low pass filter of both
sensors are taken from the devicetree.

Signed-off-by: Ali Talha Yurtseven <alitqlhq@gmail.com>
2026-10-28 22:34:03 -04:00
Benjamin Cabé
a6cb704bc2 drivers: input: add AXS5106L touch controller driver
Add a driver for the ChipSourceTek AXS5106L self-capacitive touch
controller, used on 172x320 1.47" touch displays such as the Seeed
Studio XIAO 1.47" IPS Touch Display.

The touch report starts at register 0x01 with a gesture byte and the
number of touch points, followed by 6 bytes per point starting with the
12-bit X and Y positions. The register address must be written in its
own I2C transfer, at least 45 us before the data is read, so the driver
does not use a repeated start.

The touch data is read when the interrupt line is asserted, then every
CONFIG_INPUT_AXS5106L_PERIOD_MS while the panel is touched, to report
movement and release as the vendor reference code does, and while the
interrupt line stays asserted, as the controller keeps it asserted until
the touch data is read. The first read happens once the controller is
ready after reset. Without an interrupt line, the touch data is read
periodically. A failed read reports a release, and only the first of
consecutive failures is logged. The reset line is optional, as some
displays share it between the LCD and the touch controller, in which
case the display driver resets both. Only the first touch point is
reported.

The I2C read sequence and its 45 us delay come from the AXS5106
datasheet. The register address, the report format and the reset
timings come from the Seeed Studio reference code, the Seeed_GFX2
library and the examples of the XIAO display gadgets, as the datasheet
does not document them.

Tested with the drivers.input build_all test, and with the
draw_touch_events sample on a Seeed Studio XIAO 1.47" IPS Touch Display
with a XIAO nRF52840 Plus.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
2026-10-28 22:33:58 -04:00
Ryomei Osaki
da3f404db3 drivers: adc: add TI ADS8684/ADS8688 driver
Driver for the TI ADS8684 (4 channels) and ADS8688 (8 channels) 16-bit
SAR ADCs with a per-channel input range, attached over SPI.

Channels are read in manual mode, one MAN_Ch_n command per channel of
the sequence, pipelined since a frame returns the result of the channel
selected in the previous frame.

The input range of a channel is selected with the standard channel
configuration: the gain selects the span relative to the 4.096 V
reference (ADC_GAIN_2_5 for 2.5 x Vref, ADC_GAIN_4_5 for 1.25 x Vref)
and "differential" its bipolar variant, whose samples are returned as
signed values so that adc_raw_to_millivolts_dt() applies unchanged.

Tested on an i.MX8MP Cortex-M7 (ECSPI) with an ADS8688.

Signed-off-by: Ryomei Osaki <o.ryomei1020@gmail.com>
2026-10-28 22:33:35 -04:00
Muhammad Waleed Badar
1717c34565 drivers: pcie: controller: brcmstb: add BCM2711 support
Select the SoC-specific setup with CONFIG_SOC_BCM2711 and
CONFIG_SOC_BCM2712.

On BCM2711, reset the bridge and assert PERST# through RGR1_SW_INIT_1,
take the bridge out of reset, power up the SerDes by clearing
SERDES_IDDQ in HARD_DEBUG, deassert PERST# through RGR1_SW_INIT_1 and
use a 128 byte max burst size. The PLL/MDIO setup, PHY_CTL_15, the
UBUS BAR2 remap and the UBUS error and timeout settings are BCM2712
specific and are skipped on BCM2711. The sequence follows the Linux
pcie-brcmstb driver.

The BCM2712 setup sequence is unchanged.

Built for rpi_5 and rpi_4b; not run on hardware.

Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-28 22:33:20 -04:00
Muhammad Waleed Badar
32edde3360 drivers: pcie: controller: brcmstb: fix config access and link wait
The config space index was built as bdf << 12, while the controller
expects the ECAM layout bus << 20 | dev << 15 | func << 12, which is
bdf << 4. Bus scans therefore addressed nonexistent buses and each
access could stall for up to the UBUS/config retry timeout.

Access the root bus through the RC registers at the controller base,
as only the root port lives there, refuse downstream accesses while
the link is down and set the root port bus numbers so recursive scans
reach bus 1. Only allow device 0 on bus 1: the VL805 on BCM2711
ignores the device number and shows up again as 1:2.0, and the access
to 1:3.0 raised an SError. Select bus 1, device 0 in the index
register before the endpoint BAR writes instead of relying on its
reset value.

Replace the two fixed 500 ms delays with the 100 ms wait after PERST#
deassertion required by the PCIe CEM specification followed by polling
for link-up for up to 100 ms, and fail init when the link stays down.

Built for rpi_5 with the shell_module sample; not run on hardware.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-28 22:33:20 -04:00
Syed Maaz
b0ec225bcb drivers: adc: add Microchip ADC G2 multi-core driver
Add a driver for Microchip's Group G2 ADC peripheral where multiple SAR
cores share one physical register block. Global init (SWRST, fuse
calibration, CTRLA, CTRLD) runs once regardless of how many core
instances are enabled; per-core init handles pinctrl, IRQ, divider, and
ANLEN/CHNEN. Enable via ADC_MCHP_G2_MULTI_CORE, defaulted on for
SOC_FAMILY_MICROCHIP_PIC32CZ_CA.

Signed-off-by: Sunil Abraham <Sunil.Abraham@microchip.com>
Signed-off-by: Syed Maaz <Syed.Maaz@microchip.com>
2026-10-28 22:33:05 -04:00
Johannes Schuler
53878ab411 drivers: fuel_gauge: hy4245: add emulator
Add an I2C emulator for the HY4245 that models the standard commands
with fixed readings, the Control() subcommands, the seal and calibration
mode state and a small data flash with the BlockData() checksum
handling, so the driver can be tested on native_sim.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-10-28 22:33:01 -04:00
Johannes Schuler
13c3b365fd drivers: fuel_gauge: hy4245: add relearn commands
Add properties for the ClearLearned() and QuickStart() Control()
subcommands, so an application can make the gauge relearn the battery
capacity, e.g. after the battery has been replaced. The gauge holds the
bus for 250 ms after QuickStart(), the driver waits accordingly.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-10-28 22:33:01 -04:00
Johannes Schuler
9943e14d61 drivers: fuel_gauge: hy4245: add data flash access
Add a calibration mode property that unseals the gauge and enables data
flash access, a reset property and buffer properties for single data
flash blocks, the manufacturer info blocks A, B and C and for programming
and verifying a configuration image. The configuration image handling
skips the blocks holding device specific calibration data and preserves
the device specific bytes of the shared block, so the caller does not
need to know the image layout.

The unseal keys come from the unseal-keys devicetree property, which
defaults to the factory keys, so a gauge programmed with vendor specific
keys can be used as well.

Leaving calibration mode resets the gauge and waits for
CONFIG_HY4245_RESET_SETTLE_TIME_MS before returning, as the gauge does
not deliver valid data until its algorithm has restarted.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-10-28 22:33:01 -04:00
Johannes Schuler
ba9317646d drivers: fuel_gauge: hy4245: add status and version properties
Expose the Control() status and version information of the HY4245 as
device specific fuel gauge properties in a new hy4245.h header: control
status, OperationCfgA(), Flags(), safety status, lifetime over
temperature duration, data flash checksum, data flash version and
firmware version. The data flash update enable, OperationCfgA().UPD_EN,
can also be set through the SetUPD_EN() subcommand.

Add Control() subcommand helpers and use them for the chip id read.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-10-28 22:33:01 -04:00
Johannes Schuler
84329d282f drivers: fuel_gauge: hy4245: move register definitions to a header
Move the command and Control() subcommand definitions from hy4245.c to
a private header, so that they can be shared with an emulator. No
functional change.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-10-28 22:33:01 -04:00
Ahmed Ashraf NourEldeen
a837cdf039 drivers: sensor: icm42605: add bus abstraction
Introduce a bus abstraction for the ICM42605 sensor driver to support
multiple bus implementations.

Move bus-specific register access out of the core driver and add support
for both SPI and I2C backends.

fixes: #118030

Signed-off-by: Ahmed Ashraf NourEldeen <a.programmer55559@gmail.com>
2026-10-28 22:32:47 -04:00
Ryomei Osaki
4c1cb39059 drivers: spi: use spi_context_clear_completion()
Replace the open-coded semaphore/ready-flag resets in spi_nrfx_spi,
spi_cdns, spi_ambiq_spic and spi_mcux_ecspi with the new helper. For
spi_cdns and spi_ambiq_spic this also covers the !CONFIG_MULTITHREADING
path, which previously did not compile because struct spi_context has no
sync member there.

No functional change with CONFIG_MULTITHREADING.

Signed-off-by: Ryomei Osaki <o.ryomei1020@gmail.com>
2026-10-28 22:32:42 -04:00
Ryomei Osaki
17f1397e4e drivers: spi: spi_context: add spi_context_clear_completion()
A driver that gives up on a transfer, typically after
spi_context_wait_for_completion() timed out and the transfer was
aborted, has to discard the completion a late interrupt may still
signal; otherwise the stale signal satisfies the next transfer's wait
immediately.

The signal lives in ctx->sync with CONFIG_MULTITHREADING and in
ctx->ready without it, so every driver had to open-code the #ifdef, and
some reset only the semaphore.

Add spi_context_clear_completion() to hide this, next to
spi_context_wait_for_completion() and spi_context_complete().

Signed-off-by: Ryomei Osaki <o.ryomei1020@gmail.com>
2026-10-28 22:32:42 -04:00
James Smith
a3d614e21e drivers: flash: rpi_pico: make the IRQ lock optional
Add FLASH_RPI_PICO_LOCK_IRQS, on by default under XIP, which locks
interrupts around the pico-sdk write and erase calls only when it is
set. An application linked to run entirely from RAM has no interrupt
handler executing from flash, so the IRQ lock blocks all interrupts for
the entire write/erase operation unnecessarily.

The IRQ lock was the driver's only mutual exclusion, so this change also
takes a semaphore in read, write and erase to allow only one flash
operation at a time. The semaphore compiles out under
CONFIG_MULTITHREADING=n.

Tested with an XIP app and an in-RAM app, and with CONFIG_MULTITHREADING
on and off.

Signed-off-by: James Smith <james@loopj.com>
2026-10-28 22:32:28 -04:00
James Smith
26bb93fba5 drivers: flash: rpi_pico: take flash geometry from devicetree
FLASH_SIZE and the read base come from CONFIG_FLASH_SIZE and
CONFIG_FLASH_BASE_ADDRESS, which arch/Kconfig defaults to 0 when XIP is
disabled. An application linked to run entirely from RAM therefore
reports a zero-sized flash, and rejects every read/write/erase.
RP2350 can already be linked this way.

This commit takes those values from the controller's soc-nv-flash node
in the devicetree instead. Values are unchanged under XIP.

Signed-off-by: James Smith <james@loopj.com>
2026-10-28 22:32:28 -04:00
Hongquan Li
0150dcfa89 drivers: intc_gicv3_its: reject out-of-range level 1 device table index
The indirect device table check in gicv3_its_init_device_id() bounded
the level 1 index with "offset > (1 << indirect_dev_lvl1_width)", so
"offset == (1 << indirect_dev_lvl1_width)" was accepted as well. The
width compared against is the one the level 1 table is sized with
(device_ids -= lvl2_width + 1, then page_cnt = ROUND_UP(entry_size <<
device_ids, page_size) / page_size), so that index is one entry past the
table allocated for it: indirect_dev_lvl1_table[offset] is read first
and, when it evaluates as "level 2 table not allocated yet", written
with the new level 2 table pointer. It is 8 bytes past the end of the
allocation whenever the entry count is an exact multiple of the page
size, which with the 64 KiB pages and 8-byte entries an ITS may report
is the case from 27 DeviceID bits on.

Reject that index, so the accepted range matches the width the table was
sized for.

Fixes #119193

Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
2026-10-28 22:32:17 -04:00
Hongquan Li
cd2f566184 drivers: intc_gicv3_its: size the level 1 table for the DeviceID space
its_alloc_tables() derives the level 1 index width of an indirect device
table with one bit too few: it subtracts lvl2_width + 1 from the IDbits
reported by GITS_TYPER, where the Linux driver this code is ported from
subtracts only ilog2(page_size / entry_size) in its_parse_indirect_baser()
(the comment above the block is a verbatim copy of that code). The level
1 table therefore covers 2^(IDbits - lvl2_width - 1) entries instead of
the 2^(IDbits - lvl2_width) the hardware indexes, since a level 1 entry
is ID / (Page Size / Entry Size).

Because the same value is used as the accept bound in
gicv3_its_init_device_id(), the driver also rejects every DeviceID in
the upper half of the space its own GITS_TYPER.Devbits advertises. That
is the case indirect tables were added for: the
"interrupt_controller: gicv3_its: Implement Indirect Two-level table"
commit calls it "necessary to support platforms with DeviceID bits > 16".

Subtract only the level 2 width, so that indirect_dev_lvl1_width is the
index width covering the whole DeviceID space. The bound it is compared
against then matches the DeviceID range, but it also has to reject the
index equal to that width: the comparison is off by one (#119193), and
without that fix this change moves the out-of-range index from inside
the old, half-sized table to 8 bytes past the new one.

Reject a page count that cannot be represented by GITS_BASER.Size before
allocating the table. Otherwise MASK_SET() truncates the count when
programming the register, leaving hardware with a smaller table than
software allocated.

Fixes #119204

Assisted-by: Codex:GPT-5
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
2026-10-28 22:32:17 -04:00
Anthony Raterta
069f921cf5 drivers: regulator: max20362: Add support for other DVS sources
- Added support for pseudo SPI and round-robin DVS source
- Added DT properties for default DVS source
- Exposed APIs needed as per request for runtime usage

Signed-off-by: Anthony Raterta <Anthony.Raterta@analog.com>
2026-10-28 22:32:13 -04:00
Duc Viet Le
c83b76739b drivers: i3c: mcux: propagate COMPLETE timeout
Propagate the error returned by the COMPLETE status wait so that a
transfer timeout is not reported as a successful transfer.

Signed-off-by: Duc Viet Le <levietduc0712@gmail.com>
2026-10-28 22:32:08 -04:00
Duc Viet Le
33bc70f5f7 drivers: i3c: mcux: fix write length truncation
Use size_t for the write transfer length instead of uint8_t to
prevent transfer lengths greater than 255 bytes from being silently
truncated.

Signed-off-by: Duc Viet Le <levietduc0712@gmail.com>
2026-10-28 22:32:08 -04:00
Jose Rojas Chaves
6394284f3a intc: swerv-pic: decode meihap using XLEN
Fix meihap decoding to use XLEN so the interrupt controller handles
both 32-bit and 64-bit targets correctly.

Signed-off-by: Jose Rojas Chaves <jose.rojas.chaves@intel.com>
2026-10-28 22:31:57 -04:00
Lucas van der Ploeg
378bf04863 drivers: misc: nordic_vpr_launcher: apply pinctrl from devicetree
Apply VPR VIO pin configurations from devicetree. This allows configuring
the drive strength for the VPR VIO pins from devicetree on the app core
in the same way as other peripherals.
The VPR core accesses this pin using its VIO number not through GPIO so
it makes more sense to configure the GPIO register from the APP core.

Signed-off-by: Lucas van der Ploeg <lucas.vanderploeg@nordicsemi.no>
2026-10-28 22:31:48 -04:00
Lucas van der Ploeg
b60d2b0cb9 drivers: pinctrl: nrf: add VPR VIO pin function
Add a generic NRF_FUN_VPR_VIO pinctrl function so that a pin can be
assigned to a VPR core and driven directly through its VIO interface.

Where the local core can select pin routing (NRF_GPIO_HAS_SEL) the pin is
routed to the VPR here; otherwise routing is controlled by the secure
domain via UICR and no action is needed at configure time.

Signed-off-by: Lucas van der Ploeg <lucas.vanderploeg@nordicsemi.no>
2026-10-28 22:31:48 -04:00
Wojciech Sipak
68117f5ce8 drivers: timer: cmsdk_apb_timer: add support for wuc
This allows to configure the CMSDK Timer as a wakeup source.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2026-10-28 22:29:39 -04:00
Qiang Zhang
7997e1830d drivers: input: mcux_tsi: support TSI channels beyond 31
channel-mask was a single uint32_t, limiting addressable channels to
0..31; widen it to a devicetree array of 32-bit words so parts with
more channels (e.g. MCXA577's 70-channel TSI) can use them, and size
channels[] per-instance to the enabled count instead of a fixed max.
Also attach FRO_HF_DIV as the TSI0 clock source before gating it on
MCXA, since the clock mux resets to "NONE" there and calibration
hangs forever without it.

Confirmed on frdm_mcxa577: boot, calibration, and touch events work
correctly across channels beyond 31.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-10-28 22:29:33 -04:00
Michal Frankiewicz
f7aa64dedb samples: Replace divider set API with set rate API in clock users
Replaced nrfx_clock_hfclk_divider_set with clock_control_set_rate API.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
2026-10-28 22:29:28 -04:00
Michal Frankiewicz
327762ecf0 drivers: clock: Implement rate APIs for clock_control_nrf
Implemented clock_control_set_rate and clock_control_get_rate
APIs for HFCLK and HFCLK192M.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
2026-10-28 22:29:28 -04:00
Satya Sri
fa397758ae drivers: counter: xlnx_ttc: map MMIO and serialize register access
The in-tree driver programs TTC registers with the parent block's
physical address. That is not valid on MMU builds, where the range
must be mapped first.

Use DEVICE_MMIO_NAMED for register access. Keep the physical parent
address as block_id so sibling timers in the same IP can reuse one
mapping, share one IRQ, and be dispatched from the same ISR.

Add a per-device spinlock around counter-control and interrupt-enable
RMW so thread context and the ISR cannot race. Connect the ISR with
the irq_connect_dynamic() signature, clear late-alarm flags on
cancel, reject set_top_value while alarms are active, and disable
the interval IRQ when no top callback is set.

Signed-off-by: Satya Sri <satyasri.katru@amd.com>
2026-10-28 22:29:23 -04:00
Svitlana Drozd
e9366a5197 drivers: firmware: scmi: add OP-TEE SCMI transport
Add support for SCMI transport using the OP-TEE SCMI Pseudo Trusted
Application (PTA). This allows Zephyr to exchange SCMI protocol messages
with OP-TEE executing in Secure World via synchronous TEE invocations.

Because the OP-TEE subsystem initializes during POST_KERNEL, adjust the
SCMI transport, clock control, and reset driver initialization levels
and priorities to POST_KERNEL when ARM_SCMI_OPTEE_TRANSPORT is enabled.

Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-10-28 22:29:18 -04:00
Benjamin Cabé
38e6597025 drivers: espi: validate the packet snapshot handed to the driver
Six verifiers copied the caller's packet into a local but then
range-checked the buf/data and len fields by re-reading them from the
live user struct, so the buffer that was checked need not be the one
the driver uses. espi_read_flash() also forwarded the user pointer
rather than the snapshot.

Check the fields on the snapshot, and pass the snapshot to
z_impl_espi_read_flash(). Also correct espi_flash_erase(), which
checked for the flash_write op while its implementation calls
flash_erase.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-10-28 22:29:03 -04:00
DineshKumar Kalva
d264f8fb92 drivers: intc: acp: route DMA and IPC to separate Xtensa lines
On ACP 7.X, program interrupt routing so aggregated DMA completion
uses EXT_LEVEL3 and host-to-DSP IPC uses EXT_LEVEL5. Keep other ACP
SoCs on EXT_LEVEL3.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2026-10-28 22:28:59 -04:00
Manimaran A
4f2c5ac61c drivers: watchdog: mchp: add PM_DEVICE and WDT_OPT_PAUSE_IN_SLEEP support
Add a CONFIG_PM_DEVICE handler that stops the WDT on suspend and
restarts it with a fresh timeout on resume, gated on the
WDT_OPT_PAUSE_IN_SLEEP option (previously rejected with -ENOTSUP).
Behavior is unchanged when the option is not requested.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
Assisted-by: Claude:claude-opus-4-8
2026-10-28 22:28:55 -04:00
Scott Worley
8d68558989 drivers: mspi: microchip: Add XEC GPSPIv2 controller based driver
We added a MSPI driver using the Microchip XEC GPSPI version 2
controller. GPSPIv2 is a highly reduced QMSPI supporting only single
and dual SPI operations. The following hardware feature were removed:
descriptors, local-DMA, and the FIFO level interrupt. GPSPIv2 supports
only one hardware controlled chip select. The chip select timing register
was moved to a different offset. GPSPIv2 does include the 8-byte TX and RX
FIFOs. It can use the central-DMA controller to move data between the
FIFOs and memory. This MSPI drivers supports both MSPI_PIO and MSPI_DMA
operations.

This driver supports only MEC174x/5x/165xB chips

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2026-10-28 22:28:40 -04:00
Muhammad Waleed Badar
5a62a19eaa drivers: fuel_gauge: add native_sim Linux sysfs backed driver
Add native_sim fuel gauge driver backed by a Linux power_supply sysfs
device of the host (e.g. /sys/class/power_supply/BAT0). Implements
get_property() and get_buffer_property(), mapping FUEL_GAUGE_*
properties onto their sysfs attributes.

The path property is the directory of the power supply, so a directory
holding the attribute files of a fake power supply serves on a host
without a battery; the --fuel-gauge-path command line option overrides
it. Initialization fails unless the directory holds a power supply of
the Battery type.

A battery is not required to provide every attribute, so a property
whose attribute is missing is reported as unsupported; the host errno
crosses the native simulator boundary through nsi_errno. Attribute
values are parsed strictly and checked against the range of the
property, and the SBS name fields take names as long as the field.

The fuel_gauge0 node of native_sim is disabled by default, as the
name of the battery depends on the host.

Tested with samples/drivers/fuel_gauge on native_sim/native/64 with
the node enabled for the BAT0 battery of the host.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-28 22:28:22 -04:00
Arkadiusz Grzelka
a3ebbac415 drivers: hwinfo: microchip: g1: support PIC32CM SG/GC
On PIC32CM SG/GC, RCAUSE is 16 bits and has four reset sources
between POR and EXT, where the current enum has three, so EXT, WDT,
SYST and BACKUP sit at different bits. With the current enum an
external reset reads as a watchdog reset.

Add an enum for this family and report its CPU lockup bit.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
2026-10-28 22:28:17 -04:00
Arkadiusz Grzelka
a0c4de5fe1 drivers: hwinfo: microchip: g1: read RCAUSE per family
Read RCAUSE through the HAL's rstc_registers_t instead of an 8-bit
pointer, so each family's register definition gives the offset and
width. Check the brown-out bits with one mask defined next to the enum.

No functional change for SAM D5x/E5x, PIC32CX SG and PIC32CM JH.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
2026-10-28 22:28:17 -04:00
Nicolas Pitre
5605d62985 drivers: timer: npcx_itim: use the generic timer core
The counter and the alarm are two different timers here, which the core
keeps apart. The cycle domain is the free-running 64-bit ITIM64; the wakeup
comes from a separate 32-bit ITIM32 counting down at the low-frequency
clock. That makes it a RELOAD backend whose range is bounded by the second
timer rather than by the counter, so TIMER_CORE_ALARM_MAX_CYCLES is
NPCX_ITIM32_MAX_CNT of the event timer's cycles expressed in the counter's,
and the floor is one of them.

The core takes over the tick accounting: cyc_sys_announced, last_ticks and
last_elapsed go, and with them the deadline computation that turned a tick
count into an event-timer countdown. timer_driver_set_reload() is left with
the domain conversion and the register sequence. sys_clock_set_timeout(),
sys_clock_elapsed() and both cycle getters come from the core.

Reading ITIM64 is a two-register sequence that the power-management path
also adds a compensation to, so TIMER_CORE_COUNTER_NONATOMIC has the core
take the clock lock around the public getters, as the driver's own getters
did.

The event timer is one-shot, so the ISR re-arms it for a ticked kernel: the
core leaves a reload backend alone there, expecting hardware that reloads
itself.

Build-tested on npcx9m6f_evb, tickless and tickful, with
CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE and with CONFIG_PM.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-10-28 22:27:48 -04:00
Nicolas Pitre
c6838a221a drivers: timer: npcx_itim_timer: drop a dead macro and a hand conversion
EVT_CYCLES_FROM_TICKS() has no user. Remove it.

NPCX_ITIM_EN_TIMEOUT_CYCLES hand-rolls a microsecond to cycle conversion
through SYS_CYCLES_PER_USEC, which truncates on a rate that is not a
multiple of a megahertz. Use k_us_to_cyc_ceil32() instead and drop
SYS_CYCLES_PER_USEC, its only user.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-10-28 22:27:48 -04:00
Benjamin Cabé
a3b6b41e74 drivers: sensor: mmc56x3: don't report temp in continuous mode
The RTIO submit path set has_temp purely from the requested channels,
but mmc56x3_sample_fetch_helper() only reads the temperature when the
device is not in continuous mode, so the decoder converted an
uninitialised value from the RTIO buffer. Gate has_temp on the device
mode so the decoder reports no data instead.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-10-28 22:27:43 -04:00
Benjamin Cabé
ef621ceb72 drivers: sensor: mmc56x3: preserve ctrl0 config on one-shot measure
In one-shot mode the fetch path wrote the take-measurement bits to
Internal Control 0 as bare values, clearing the sticky Auto_SR_en bit
that chip init had programmed, so automatic set/reset stopped running
after the first fetch. OR the command bit onto the cached register
value instead, taking the cache from dev->data since the helper's data
argument is the RTIO encode buffer on the async path.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-10-28 22:27:43 -04:00
Benjamin Cabé
863b9b035c drivers: sensor: mmc56x3: fix bandwidth bits never being cleared
mmc56x3_chip_set_decimation_filter() only ORed the BW bits into the
Internal Control 1 cache, so once set they could never be cleared, and
it committed the new configuration before checking the register write.
Use an explicit set/clear read-modify-write and only update the cache
and config on a successful write.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-10-28 22:27:43 -04:00
Benjamin Cabé
dc72e9d9e2 drivers: sensor: mmc56x3: keep unrelated attributes on attr_set
mmc56x3_attr_set() built a zero-initialised configuration and only
filled in the requested field, so mmc56x3_chip_configure() saw all the
other fields as changed and reprogrammed them, e.g. dropping the part
out of continuous mode or disabling automatic set/reset. Seed the
working copy from the cached live configuration instead.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-10-28 22:27:43 -04:00
Priyadharsan Saravanan
bee25a09de charger: bq24190: rename header file
Rename the bq24190 header file and update its include references.

Signed-off-by: Priyadharsan Saravanan <priyadharsan@sacrasys.com>
2026-10-28 22:27:38 -04:00
Priyadharsan Saravanan
9ad6767256 drivers: charger: bq24190: add WDT configuration
Add support for configuring the BQ24190 watchdog timer through a
Devicetree property.

Use the configured watchdog timeout to update the corresponding
charge termination and timer control register during device
initialization.

Signed-off-by: Priyadharsan Saravanan <priyadharsan@sacrasys.com>
2026-10-28 22:27:38 -04:00
Priyadharsan Saravanan
16856a8a13 charger: bq24190: remove shift macros
Remove unnecessary shift macros from the bq24190 charger header file
and update their references accordingly

Signed-off-by: Priyadharsan Saravanan <priyadharsan@sacrasys.com>
2026-10-28 22:27:38 -04:00
Yuzhuo Liu
8bd30cf0f8 drivers: i2c: bee: add target mode
Add I2C target (slave) support to the Realtek Bee I2C driver, gated by
CONFIG_I2C_TARGET.

The peripheral's device-mode field selects controller or target, so an
instance can act as one role at a time but not both simultaneously.
target_register() reconfigures the peripheral into slave mode reusing
the previously configured bus speed, and target_unregister() restores
controller mode. To keep the two roles mutually exclusive, configure(),
transfer() and transfer_cb() return -EBUSY while a target is registered,
and target_register() returns -EBUSY if one is already attached.

The target ISR follows the DesignWare slave model: RX_FULL drains the RX
FIFO into the write_requested/write_received callbacks, RD_REQ feeds one
byte per request through read_requested/read_processed, RX_DONE ends a
slave-transmit and STOP_DET reports the end of the transaction. Only
7-bit addressing and byte mode are supported for now.

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-10-28 22:27:33 -04:00