Commit graph zephyr/drivers
Author SHA1 Message Date
Ofir Shemesh
ddf31ea68b drivers: entropy: mcux_trng: return -EIO on SDK errors
The driver asserted !status on the TRNG SDK calls and always
returned 0. In release builds __ASSERT_NO_MSG is a no-op, so
HW failures were silently swallowed and callers received
success with a possibly zero-filled buffer, poisoning the
xoshiro128 seed and pinning sys_rand_get() to 0.

Return -EIO on any status_t != kStatus_Success in both the
get_entropy and init paths, and propagate the init return
value from the PM TURN_ON action.

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2026-07-29 08:16:37 -07:00
Fabio Baltieri
a3b8d829fa drivers: i2c: target: use buffer and buffer_size from rom
Drop the buffer and buffer_size pointer from the data struct and use the
ones in cfg directly, guess this was originally done to avoid using the
data dev pointer in data, but now it's there anyway so we may as well
use it to find back the cfg pointer and use the buffer and buffer_size
from there directly, save few bytes of sram.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-07-29 08:15:52 -07:00
Fin Maaß
53e91367be drivers: dwc_mac: qos: try refill in irq
try refilling rx in the interrupt if possible

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-29 08:14:37 -07:00
Fin Maaß
a9db14e690 drivers: ethernet: dwc_mac: qos: put two fragments in tx desc
put two tx fragments in one descriptor.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-29 08:14:37 -07:00
Benjamin Cabé
82b36fc2cc drivers: flash: stm32h7: Use bank2 ECC flags for bank2 status
The dual-bank error check read SR2 but tested the bank1 ECC error
flags, so bank2 ECC errors were reported based on bank1 bits. Use
the bank2 flags like the rest of the bank2 block.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-29 08:14:16 -07:00
Deepti Deshatty
87ff71debc drivers: espi: it8xxx2: clear PMC2 processing flag at init
PM2STS.GPF (host-command BUSY) is set in the PMC2 IBF ISR and cleared
on the response path. If a sysjump happens in between, the response
never runs and GPF is left set. The new image re-enables the PMC2
interrupt but doesn't clear the BUSY bit, so the host sees a
permanently BUSY interface and every subsequent host command times
out.

Clear PM2STS.GPF in pmc2_it8xxx2_init() before enabling the IBF
interrupt, matching the equivalent fix in the Nuvoton NPCX driver
(host_hcmd_init() in drivers/espi/host_subs_npcx.c clears HIPMST.F0
for the same reason)

Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>
2026-07-29 10:48:52 +02:00
Laura Carlesso
48ba390762 drivers: flash: Add get_size to infineon serial memory
The driver did not implement the get_size api, added
the function to the device api.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-07-29 10:47:24 +02:00
Laura Carlesso
7d36c5231f drivers: flash: Impose alignment on Infineon RRAM operations
The RRAM driver was allowing unaligned operations for erase
and write because the underlying PDL driver would correct the
operation doing read-modify-write. Rather than relying on the
lower level implementation to correct the alignements and due
to the fact that the flash apis specifically state that alignment
must be checked, added the check and returned error for
unaligned operations.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-07-29 10:47:24 +02:00
Zhaoxiang Jin
9705910bd9 drivers: counter: mcux_lptmr: allow run-time enable as a wakeup source
A plain LPTMR counter that is not the system-timer companion can also
serve as a wakeup source - for example an application arming an alarm
before entering a deep low-power state - but whether it should wake the
SoC is a run-time decision, not a fixed role.

In addition to the companion path, arm the wakeup controller when the
instance has been enabled as a wakeup source at run time
(pm_device_wakeup_enable(), PM_DEVICE_FLAG_WS_ENABLED); the device
declares the capability in devicetree (wakeup-source) and the
application enables it. Register a pm_device so the device can carry the
flag; the action callback has no device power state to manage, so it
accepts suspend/resume and returns -ENOTSUP for anything else. The
registration and the flag check are a no-op unless CONFIG_PM_DEVICE is
enabled, so the companion path stays free of any PM_DEVICE dependency.

Disarming still keys off the static "is a wakeup source" condition and
deliberately does not re-check WS_ENABLED: the run-time flag can be
cleared between arming the alarm and its firing or cancellation, and a
disarm gated on WS_ENABLED would then be skipped, leaving a stale entry
armed in the controller. Because the static condition is a superset of
the arm condition, whatever armed the WUU is always disarmed, and
disarming an instance that never armed is an idempotent no-op.

Build-tested tests/subsys/pm/power_mgmt_soc on frdm_mcxn947.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-07-29 10:46:25 +02:00
Zhaoxiang Jin
8d49729f05 drivers: counter: mcux_lptmr: arm WUU wakeup as timer companion
When the LPTMR is the system-timer low-power companion, the main system
timer is stopped in deep low-power states and the LPTMR alarm is what
wakes the core. On SoCs that gate the alarm interrupt behind a wakeup
controller (the NXP WUU) the alarm only wakes the SoC once the LPTMR is
armed as a wakeup source, which the driver never did.

Arm the wakeup controller in set_alarm() and disarm it in
cancel_alarm() and the ISR when the LPTMR is a wakeup source -
devicetree both declares it one (wakeup-source) and routes it to a
controller (wakeup-ctrls) - and it is the chosen system-timer companion
(zephyr,system-timer-companion), whose alarm is intrinsically a wake
event. Keying the companion off the devicetree chosen keeps it
independent of the system-timer implementation and needs no device-PM
state; it also covers an application that drives the companion instance
directly (e.g. a system-off wake timer).

The controller is armed and disarmed under the alarm spinlock so a
concurrent set_alarm()/cancel_alarm() pair cannot leave it armed with no
pending alarm (or vice versa); the WUC calls only write registers, so
they are safe under the spinlock and in the ISR. Arming happens before
the alarm is committed and a failure propagates as the set_alarm()
return value rather than a log: on the companion path the console may
already be suspended when this runs, and if the arm failed the SoC would
sleep without waking to flush a deferred message, so only the return
value can act before the sleep. The ISR ignores the disarm result for
the same reason; disarming a devicetree-defined source does not fail.

The companion arms only when it has a deadline to wake for, which falls
out of the alarm lifecycle with no extra check:
  - no finite timeout (K_TICKS_FOREVER): the PM core does not hand the
    deadline to the companion, set_alarm() is never called and the WUU
    stays unarmed, so the SoC waits for another wakeup source;
  - finite timeout: the companion is given an alarm, set_alarm() arms
    the WUU so the alarm wakes the core.

Disarming keys off the static "is a wakeup source" condition, not on
whether it armed: for the companion this condition never changes, so
arm and disarm always agree and no stale WUU entry is left behind.

Build-tested tests/subsys/pm/power_mgmt_soc and the s2ram / system_off
samples on frdm_mcxn947.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-07-29 10:46:25 +02:00
Muhammad Waleed Badar
d202a57c14 drivers: power_domain: add bcm283x power domain driver
Add a power domain driver for the BCM283X SoC family, enabling VideoCore
firmware-based power management via the mailbox property channel.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-29 10:43:39 +02:00
Old Ding
e4765c6ae1 drivers: flash: free Cadence NAND read page buffers
cadence_nand_read_page() allocates main and spare buffers before
submitting the read-page command. Free both buffers on every exit path so
repeated reads do not leak host memory.

Signed-off-by: Old Ding <ai.neo.ae86@gmail.com>
2026-07-29 10:42:43 +02:00
Tedd OKANO
8c956c7399 drivers: spi: nxp_lpspi: release native CS on spi_release()
lpspi_end_xfer() only clears TCR CONT/CONTC when SPI_HOLD_ON_CS is
absent from the transfer's config, so that consecutive
spi_transceive() calls within a HOLD_ON_CS transaction keep native
(non-GPIO) CS asserted between transfers, as intended.

However, once the caller finishes the whole transaction and calls
spi_release(), those bits were never cleared, leaving native CS
asserted indefinitely - spi_context_unlock_unconditionally() already
force-releases GPIO-based CS via _spi_context_cs_control(ctx, false,
true), but has no way to know about the LPSPI-specific TCR bits for
native CS.

Clear TCR CONT/CONTC directly in spi_lpspi_release() so that
spi_release() actually deasserts native CS as its API contract
implies, matching the existing GPIO CS behavior.

Confirmed on real hardware (FRDM-MCXN947, LPSPI1 native PCS0): CS
previously stayed low indefinitely after the first HOLD_ON_CS
transaction (as used by the Arduino SPI API, which always sets
SPI_HOLD_ON_CS to support multiple transfer() calls per transaction);
with this fix CS correctly returns high after each endTransaction().

Signed-off-by: Tedd OKANO <okano.akifumi@gmail.com>
2026-07-28 20:51:53 -04:00
Anas Nashif
72e5c301b2 drivers: kconfig: drop 'select UART' of nonexistent symbol
There is no 'config UART' base definition in the tree; the only
definition was an accidental bare declaration in the
cy8cproto_062_4343w board Kconfig.defconfig, so every
'select UART' resolved against a phantom bool that gates nothing.

- bluetooth: hci: BT_AIROC: drop the select. BT_H4 already selects
  BT_UART, which selects SERIAL and UART_INTERRUPT_DRIVEN, so the
  H4 transport is fully covered.
- sensor: explorir_m, fcx_mldx5, s3km1110: drop the select. These
  drivers already have 'depends on UART_INTERRUPT_DRIVEN', which
  requires SERIAL; replacing the select with 'select SERIAL' would
  create a Kconfig dependency loop through UART_INTERRUPT_DRIVEN.
- input: ch9350l: drop the select for the same reason (it depends
  on SERIAL_SUPPORT_INTERRUPT and selects UART_INTERRUPT_DRIVEN).
- stepper: adi_tmc: STEPPER_ADI_TMC_UART: replace with
  'select SERIAL', matching the sibling STEPPER_ADI_TMCM_RS485
  symbol, so enabling the UART bus variant actually enables the
  serial drivers.

Found by a full-tree Kconfig audit cross-referencing every defined
symbol against its uses.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-28 20:51:01 -04:00
William Markezana
bcb7110882 drivers: clock_control: bl61x: run UART peripheral clock at 20 MHz
Change the boot-time UART clock divider from /3 to /4 (BCLK 80 MHz ->
20 MHz). The BL61x CAN controller is clocked from the UART peripheral
clock (halved by the SJA1000 internal bit-timing divider), and the
previous 80/3 MHz setting cannot be divided down to any standard CAN
bitrate exactly, causing CAN driver init to fail with -ENOTSUP. A
20 MHz UART clock yields a 10 MHz CAN core clock, which divides evenly
into all standard bitrates.

The UART driver computes its baud divisor from the live divider, so
console operation is unaffected.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-07-28 18:12:39 -04:00
William Markezana
b1450bdfb7 drivers: can: add Bouffalo Lab BL61x CAN (ISO11898) driver
Add a classic CAN 2.0 controller driver for the Bouffalo Lab BL61x
(BL616/BL618) SoCs. The ISO11898 peripheral is an NXP SJA1000 compatible
PeliCAN core with 8-bit registers on a 32-bit word stride, so it is
implemented as a thin front-end over the shared CAN_SJA1000 driver.

The controller is clocked from the UART peripheral clock domain (halved
for the SJA1000 internal bit-timing divider) and its TX/RX signals reach
GPIO pads through the UART signal multiplexer, configured via pinctrl.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-07-28 18:12:39 -04:00
Holt Sun
11385749ba drivers: counter: fix frequency log format specifiers
counter_config_info.freq is uint64_t when COUNTER_64BITS_FREQ is
selected, but counter_mcux_gpt logs it with %u and the ITE it51xxx,
ITE it8xxx2 and Xilinx AXI timer drivers with %d. Any build that
compiles one of these drivers with COUNTER_64BITS_FREQ enabled fails
under -Werror=format=.

Log the frequency with %llu and an explicit cast, which is correct
for both the 32-bit and the 64-bit layout of the field.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-07-28 18:11:13 -04:00
Pete Johanson
3d0f9fb0d8 drivers: adc: Consistently return -ENOMEM for buffer size validation
Fix up ADC drivers to consistently return -ENOMEM when validation of a
sequence buffer size fails.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-07-28 18:09:40 -04:00
Pete Johanson
3bda971a52 drivers: adc: Use standard sequence buffer validation
Adjust the MAX32 and MCUX LPADC drivers to use the new common sequence
buffer validation utility.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-07-28 18:09:40 -04:00
Pete Johanson
9338c518bf drivers: adc: Add common sequece buffer validation
Extract a private common ADC sequence buffer validation function to be used
by drivers.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-07-28 18:09:40 -04:00
Qiankun Li
4d6404c91f drivers: wifi: nxp: fix NET_BUF_ALIGNMENT for platforms without DCACHE
The configdefault for NET_BUF_ALIGNMENT references DCACHE_LINE_SIZE
unconditionally. On platforms where CACHE_MANAGEMENT is enabled but
CACHE_TYPE is not DCACHE (e.g., EXTERNAL_CACHE for instruction-only
caches), the DCACHE_LINE_SIZE symbol is hidden inside `if DCACHE`
and resolves to 0. Kconfig stores int 0 as an empty string, which
breaks GEN_ABSOLUTE_SYM_KCONFIG and produces an assembler error:
"missing expression".

Add an `if DCACHE` guard and use SDHC_BUFFER_ALIGNMENT for
platforms without DCACHE, which reflects the actual USDHC ADMA2
DMA transfer alignment requirement.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2026-07-28 12:40:05 -07:00
Mathieu Choplain
b7b55f2a2e drivers: usb: common: stm32: fix Kconfig options leak
The Kconfig options related to USB common code should be gated by the
STM32_USB_COMMON option. Otherwise, they can appear in Kconfig of builds
where USB is not enabled at all (notably, the options related to logging
configuration were always leaked)

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-28 12:38:48 -07:00
Kevin Wang
8aa03c78c7 drivers: watchdog: andes_atcwdt200: prevent timeout truncation
Keep the timeout calculation in 64-bit arithmetic through the hardware
range validation so that oversized timeouts are rejected instead of being
truncated.

Signed-off-by: Kevin Wang <kevinwang821020@gmail.com>
2026-07-28 12:37:48 -07:00
Benjamin Cabé
a576f1d1c9 drivers: input: vs1838b: Fix pointer member access
vs1838b_init() used data_input.port on a pointer, which does not
compile when the driver is built. Use data_input->port.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-28 12:35:35 -07:00
Muhammad Waleed Badar
379d3fc18b drivers: ethernet: add broadcom genet driver support
Add Ethernet driver for the Broadcom GENET MAC controller
found on the BCM2711 SoC, targeting the rpi_4b board.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-28 12:33:48 -07:00
Muhammad Waleed Badar
352d598beb drivers: mdio: add broadcom genet mdio driver support
Add  MDIO driver for the Broadcom GENET MDIO controller,
used to access the PHY attached to the BCM2711 GENET MAC.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-28 12:33:48 -07:00
Muhammad Waleed Badar
302886633f drivers: gnss: add erisson f5521gw gnss driver
Add support for the GNSS receiver integrated in the
Ericsson F5521gw (HP HS2340) WWAN module.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-28 12:33:17 -07:00
Fin Maaß
27b92415e0 drivers: ethernet: dwc_mac: 1000: enable APCS
Enable Automatic pad/CRC stripping (APCS) for
packets that have a ethertype/lenght <= 1500.
The other option (CSTF) only strips the
FCS for a ethertype greater than 0x0600 (1536).

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
4ecd8fc57f drivers: ethernet: dwc_mac: improve help for ETH_DWC_ETHER_TX_HW_CHECKSUM
improve help for ETH_DWC_ETHER_TX_HW_CHECKSUM

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
3216cbd735 drivers: ethernet: dwc_mac: 1000: only log tx/rx errors on debug
rx and tx errors can happen durring normal
operation, but are not fatal, so we only
log them with debug level to not confuse
the users

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
94ed34cf09 drivers: ethernet: dwc_mac: check return code of net_recv_data
When net_recv_data returns a negative value,
we have to do a net_pkt_unref ourself in
the ethernet driver.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
267f61a77d ethernet: dwc_mac: esp32p4 support
add support for the esp32p4

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
fe3f536196 drivers: ethernet: dwc_mac: 1000: log hardware features
log the hardware features

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
745cdd10c7 drivers: ethernet: dwc_mac: esp32: add support
add support for the esp32 in the generic
dwc_mac driver.
esp32 specific code is based
the init of the original esp32 eth driver in zephyr.

The esp32 uses HW version 3.70.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
545dc18be7 drivers: ethernet: dwc_mac: add define for region
on some socs, the dma and mac registers are
in a different order, add the possibility to change that.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Manimaran A
dd2823ea4a drivers: i2c: mec: enable START-bit wake in target mode
The XEC SMB-I2C block samples SCL/SDA asynchronously even when its PCR
SLEEP_EN is asserted and auto clock-stretches SCL on a START until the
clocks recover.

Add an opt-in wakeup-source boolean to the binding and arm the block's
START-bit wake (WAKE_STATUS bit 0 / WAKE_ENABLE bit 0 at offsets 0x60
and 0x64) plus the GIRQ22 source bit during PM_DEVICE_ACTION_SUSPEND
when the property is set and a target is attached.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-07-28 12:30:42 -07:00
Manimaran A
958c331716 drivers: i2c: mec: fix I2C wake aggregator GIRQ number
XEC_I2C_SMB_WK_GIRQ was set to 26, but per the MEC172x and MEC175x
datasheets the SMB-I2C START-bit wake events are routed through GIRQ22
(bits 1..5 for controllers 0..4); GIRQ26 is the GPIO 240..261 aggregator
and unrelated.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-07-28 12:30:42 -07:00
Manimaran A
173d54c417 drivers: i2c: mec: add suspend/resume support
Add a pm_action handler to i2c_mchp_xec_v2 to gate the I2C block clock via
PCR sleep-enable on suspend and restore it on resume.

Hold a PM_STATE_SUSPEND_TO_IDLE policy lock for the duration of each
controller transfer to prevent the system from entering suspend mid-
transaction.

Additionally, acquire the PM_STATE_SUSPEND_TO_IDLE policy lock on address
match (AAT) within the target ISR. Release this lock upon IDLE, external
STOP, and bus error exits. Also, release the lock in target_unregister to
prevent lock leakage if an unregister action races with an in-flight
transaction.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2026-07-28 12:30:42 -07:00
Nathan Olff
8bd72d7354 drivers: led: is31fl319x: add support for is31fl3193 led driver
Extend generic is31fl319x driver to support is31fl3193 variant.
Similar to 3194 but with slight differences on register and
features.

Reword error message.

Update example in binding of is31fl3194 as well for required
current-limit attribute.

Assisted-by: Claude:claude-sonnet-4.6 Claude-Code

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2026-07-28 12:30:05 -07:00
Vit Stanicek
7907c08f0b drivers: audio: Add wolfson,wm8960
Add driver for the Cirrus (Wolfson) WM8960 codec. Modify Kconfig
fragments, add DT bindings and documentation.

Signed-off-by: Hake Huang <hake.huang@nxp.com>
Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
Assisted-by: Cody:Opus_4.6
2026-07-28 12:29:31 -07:00
Yuzhuo Liu
85b61f7fb3 drivers: can: add Realtek Bee series driver
Add CAN driver support for Realtek Bee series SoCs,
including RTL87x2G.

This driver supports:
- Classic CAN 2.0A/B
- Standard and Extended identifiers
- Remote and data frames
- Transmission and Reception

Unsupport features:
- CAN FD mode
- Manual recovery

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-07-28 12:29:05 -07:00
Johnny Chuang
f84834f2f4 drivers: serial: Add UART driver for ELAN EM32 series
Add initial UART driver support for the ELAN EM32 SoC family. The driver
implements basic polling TX/RX via the Zephyr serial API and instantiates
devices from devicetree when an EM32 UART node is present and okay.

Devicetree:
- Compatible: "elan,em32-uart" (binding included)

Notes:
- The driver is initialized at PRE_KERNEL_1
  with CONFIG_SERIAL_INIT_PRIORITY
so the device is ready before the console backend binds.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
2026-07-28 12:28:40 -07:00
Johnny Chuang
facf2869b6 drivers: pinctrl: Add PINCTRL driver for ELAN EM32 series
Add the initial pinctrl driver support for the ELAN EM32 SoC family.
This driver provides basic pin multiplexing and electrical configuration
support. Device tree bindings are included for pin function definitions.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
2026-07-28 12:28:40 -07:00
Johnny Chuang
a74f7ee65a drivers: gpio: Add GPIO driver for ELAN EM32 series
Add the initial GPIO driver support for the ELAN EM32 SoC family.
The driver provides basic GPIO input/output control, pin configuration,
and interrupt handling. Device instances are created from devicetree.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
2026-07-28 12:28:40 -07:00
Johnny Chuang
e7dad85633 drivers: clock_control: add Elan EM32 AHB/APB clock controller
Add clock control drivers for the Elan EM32 AHB and APB domains along with
DT bindings and clock gate IDs.

Model peripheral clock gating with #clock-cells = <1>, where the clock
specifier carries a gate-id. Introduce EM32_GATE_NONE for nodes that only
need a parent clock reference without a hardware gate.

Update the EM32 SoC/board devicetree to pass gate-ids in `clocks`
properties and integrate the drivers into Kconfig/CMake.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
2026-07-28 12:28:40 -07:00
Benjamin Cabé
2edcf5bbc5 drivers: clock_monitor: Add set_source syscall verifier
clock_monitor_set_source() is declared as a __syscall and has a
z_impl_ implementation, but clock_monitor_handlers.c never provided
the matching z_vrfy_ shim (and its _mrsh.c include) like the other
four syscalls do. With CONFIG_USERSPACE=y the generated syscall
table falls back to the unimplemented-syscall handler, so a user
mode caller of clock_monitor_set_source() faults instead of being
dispatched.

Add the verifier mirroring the other optional op (get_rate): check
the device via K_SYSCALL_DRIVER_CLOCK_MONITOR() and forward the two
scalar cookies to z_impl_clock_monitor_set_source().

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-28 11:35:40 +01:00
Rafal Dyla
dadc7c8d9a drivers: i2s: Changing init value for fsync_duration
Changed init valueof fsync_duration to align with other chips.

Signed-off-by: Rafal Dyla <rafal.dyla@nordicsemi.no>
2026-07-28 11:34:45 +01:00
Benjamin Cabé
6b13ddc117 drivers: fuel_gauge: sbs_gauge: Cast average current to signed int16
SBS_GAUGE_CMD_AVG_CURRENT returns a 16-bit signed integer (in mA,
negative when discharging). Cast tmp_val to int16_t before
multiplying by 1000 so negative values are properly extended to
int32_t instead of producing large positive uA values.

Assisted-by: Antigravity:gemini-3.6-flash
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-28 11:34:05 +01:00
Erwan SZYMANSKI
29c149dc6d drivers: clock_control: clock_stm32_ll_mp13: add Timer clk management
STM32MP13 has the possibility to use timers IP such as other MCUs
already upstreamed in the project.
Add the necessary clock support to handle it.

STM32_SRC_TIMPCLKx index has been chosed as 1,2 and 6 to match
with the APBx clock used for each timers.
Then we distinguish 3 groups of timers, each one corresponds to
one APB clock used for the timers. In the LL, they are noted as
LL_RCC_TIMG1PRES, LL_RCC_TIMG2PRES and LL_RCC_TIMG3PRES.

We so make the following assocations:

Group 1 - From TIM2 to TIM7:
Use APB1 --> STM32_SRC_TIMPCLK1 --> LL_RCC_TIMG1PRES

Group 2 - For TIM1 and TIM8:
Use APB2 --> STM32_SRC_TIMPCLK2 --> LL_RCC_TIMG2PRES

Group 3 - From TIM12 to TIM17:
Use APB6 --> STM32_SRC_TIMPCLK6 --> LL_RCC_TIMG3PRES

Signed-off-by: Erwan SZYMANSKI <erwan.szymanski@st.com>
2026-07-28 11:33:50 +01:00
Erwan SZYMANSKI
923bb1471b drivers: counter: counter_stm32_timer: add GIC support
In order to prepare the Timers integration of STM32MP13,
this driver needs to be changed a bit.
Indeed, NVIC functions are called by default at some places but
MP13 is cortex A and uses GIC as interrupt controller.

Get inspired by renesas and nxp drivers to add GIC support
in STM32 one.

Signed-off-by: Erwan SZYMANSKI <erwan.szymanski@st.com>
2026-07-28 11:33:50 +01:00