Add an explicit (void *) cast when assigning the const device pointer
to the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Adding initial of baud_setting.clock_source variable.
Fixing p_reg in extended configuration to cover sci and sci_b
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Initialize p_reg with the register base address from devicetree.
Add an explicit `(void *)` cast when assigning the const device pointer to
the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Initialize p_reg with the register base address from devicetree.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Initialize p_reg with the register base address from devicetree.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Update extended configuration and replace the FSP start API
with the FSP enable API to align with the MTU module workflow.
Add an explicit `(void *)` cast when assigning the const device pointer to
the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
At I2C 400 kHz the host must wait only t_BUF = 1.3 µs after STOP
before driving the next START. The STO/BER ISR handler was invoking
the stop() callback before re-arming the controller. If stop() exceeds
t_BUF (GPIO writes, buffer processing) the controller is still
unregistered when the next START arrives, causing a silent NACK.
A concrete failure mode: during HID over I2C enumeration Windows issues
RESET back-to-back with SET_POWER (no software gap between them). The
RESET START fires ~1.3 µs after SET_POWER STOP; if stop() for
SET_POWER takes longer, RESET is NACKed silently and Windows
re-enumerates from scratch indefinitely.
Fix: call restart_target() first in the STO/BER path, then invoke
stop(). If a new START arrives while stop() is still running the AAT
interrupt is latched by the NVIC and delivered after the ISR returns,
so no transactions are lost.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
eSPI TAF takes exclusive ownership of the QMSPI controller when
enabled. Reject config, dev_config, get_channel_status,
register_callback, and transceive, and no-op the PM action
callback, so the driver never touches QMSPI registers while TAF
owns the block.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
eSPI TAF takes exclusive ownership of the QMSPI controller when
enabled. The transceive and release paths already reject requests
in that case; extend the same check to the PM action callback so
suspend/resume/turn on/off do not touch registers TAF is using.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
The TEMP_OUT register holds an 8-bit two's-complement value, but the
byte was assigned straight to the int16_t raw channel, zero-extending
it so every reading below 25 degC came out 256 degC too high. Cast
through int8_t, and initialize val2 which was left uninitialized.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
fxls8974_get_accel_data() took data->sem but returned early without
releasing it when the CTRL_REG1 read failed or an unsupported channel
was requested, permanently deadlocking every later driver call. Route
both error paths through the existing unlock/exit tail instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The driver parsed the devicetree "range" property into its config but
never used it, unconditionally programming (and verifying) the +/-2 g
full-scale range. Map the configured range to the CTRL_REG1 FSR field
and verify the read-back against the requested value.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Wire the BL808 on-chip controller into the Bouffalo Lab HCI driver:
add the SoC platform block and controller init/deinit, and set the
ACL TX and event RX buffer counts (7/8) to match the buffer size the
controller reports in LE Read Buffer Size.
Signed-off-by: William Markezana <william.markezana@gmail.com>
First commit to support UHC driver for Renesas RA family
Signed-off-by: Minh Hoang <minh.hoang.wm@bp.renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Add a driver for the AD Semiconductor TSM12 12-channel capacitive touch
sensor, which also covers register-compatible parts such as the Si12T
used on the M5Stack StackChan.
Each configured channel reports a key press as soon as any touch level
is detected. The sensor is polled, or read on interrupt when int-gpios
is set and then polled until all channels are released.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The raw microchip,pad-edge-rate property duplicates the Linux devicetree
ABI for the same hardware control.
Replace it with vsc8531,vddmac and vsc8531,edge-slowdown. Convert the
voltage-dependent slowdown percentage to the register setting at compile
time using the datasheet table. Reject unsupported combinations at build
time and leave the pad edge-rate control register untouched when
edge-slowdown is absent.
Document the percentages as typical silicon measurements and add build
coverage for default and explicit settings.
Assisted-by: Codex:GPT-6
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
setup() is Host code living in the HCI driver vtable: most
implementations call bt_hci_cmd_send_sync(), which is why the op exists
at all, and why a driver's vendor-specific initialization has nowhere
to run in a build without a Host. A driver does that work inside open()
instead, over its own transport, with the packet and lockstep helpers,
taking the public address from bt_hci_get_public_addr().
Deprecate the op, bt_hci_setup(), its parameter structure and
BT_HCI_SETUP, so that an out-of-tree driver still implementing setup()
is pointed at the replacement. The Host keeps calling the op through
the deprecation window; the op, its Kconfig and the h4 vendor hook are
removed two releases from now.
No attribute is put on the op or the function: the Host reads the
member to call it, so an attribute would warn on the Host rather than
on the drivers the deprecation is for. Selecting the deprecated Kconfig
symbol is what makes a build say so, and that fires exactly for the
drivers that have not moved.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
ENET_TIMER2 clock root, used for PTP timestamping, was
never configured. Configure both to 100 MHz since the ptp_timer is mostly
used to precisely time 1s. A 24 MHz timer would result in a rounding
error.
Add guards for both instances so each is only configured when its
devicetree node is present.
Signed-off-by: Mateo Ivankovic <mateo.ivankovic@inovex.de>
get_subsys_rate() did not differentiate between enet and enet1g.
If both instances were used, only the clock rate of one instance
would be returned for both.
The fix uses the instance to differentiate between enet and enet1g.
Signed-off-by: Mateo Ivankovic <mateo.ivankovic@inovex.de>
NBU firmware verifies the FCS in hardware and strips it before
delivering ACK frames to the host. OpenThread ParseFrom(kParseFully)
expects the PSDU to include the FCS. Without it, RemoveFooter() fails,
mParsedFully stays false, and ProcessEnhAckSecurity() rejects the ACK.
This breaks SED attachment (Child ID Request treated as NoAck).
Append 2 dummy FCS bytes in handle_ack() so the ACK frame length
matches what OpenThread expects.
Signed-off-by: Baptiste Coffin <baptiste.coffin_1@nxp.com>
The next power state was read on the way into every action, including the
TURN_ON and TURN_OFF the domain answers without consulting it, and the read
dereferenced whatever pm_state_next_get() returned. That call is a stub
returning NULL without CONFIG_PM, and the domain device does not get to
assume the state machine is there to ask: it exists whenever
CONFIG_POWER_DOMAIN is on, because peripherals name it in power-domains and
that reference has to resolve.
Read it in the one branch that still needs it, and answer the action
instead of dereferencing NULL when there is nothing to read.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The domain only handed out TURN_ON when the state it was resuming from was
one of the states in its onoff list, which misses a device that was never
turned off in the first place. A device whose init runs while the domain is
suspended is told it has no power and skips its own power-up, and the only
thing that will ever tell it otherwise is a TURN_ON from the domain. It
never came, and the device stayed unconfigured for the rest of the run.
Hand it to every child on RESUME instead. A device that is already powered
answers -EALREADY and nothing happens to it, so the state check bought
nothing except that missed case.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Since hclk is not fixed in sama7d65, added hclk control feature.
Add clock control when suspending and resuming for better power efficiency.
Signed-off-by: CHEN Xing <xing.chen@microchip.com>
Add clock control driver
Implement bootup clock initialization, on, off, configure and get_rate API
Signed-off-by: Sountharya P <Sountharya.P@microchip.com>
Functions LL_RNG_SetNoiseConfig and LL_RNG_GetNoiseConfig do not exist on
HAL2. They are replaced by LL_RNG_SetNoiseConfig and LL_RNG_GetOscNoiseSrc
which take an additional argument, and do not set/get the full register
in one call.
For the sake of simplicity, write/read the register with stm32_reg_write
and stm32_reg_read for both HAL versions (possible because the register
name is always NSCR).
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The EPOD booster clock is the PLL1 source clock divided by PLL1MBOOST;
PLL1M is not in its path (RM0456 Rev 7, RCC_PLL1CFGR in section 11.8.9,
p.526, and Figure 38, p.487). set_epod_booster() divides by PLL1M as
well, so with PLL1M > 1 and a source above 16 MHz it picks too small a
prescaler: blackpill_u585ci (25 MHz HSE, PLL1M 5) gets /1 and feeds the
booster 25 MHz, outside the 4 to 16 MHz of section 10.5.4 (p.410). The
pll_hse_fracn_160 scenario of the stm32u5_core clock test (16.78 MHz
HSE, PLL1M 2) gets /1 as well.
Leave PLL1M out of the computation. Build-tested only.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
set_epod_booster() returns before enabling the booster when PLL1 runs
from HSI16 or from an HSE of 16 MHz or less, so those configurations
raise SYSCLK above 55 MHz with the booster off. RM0456 Rev 7 requires
it whatever the source: BOOSTEN "must be set in range 1 and range 2
before increasing the system clock frequency above 55 MHz" (section
10.10.4, p.450), and section 10.5.4 (p.410) has the same step. The
early return dates from commit 687330acca ("drivers: clock_control:
stm32u5 enables the EPOD").
Take the HSI16 or HSE frequency for the prescaler, as for MSIS, and
always enable the booster above 55 MHz.
This affects nucleo_u5a5zj_q, stm32u5g9j_dk2 and steval_stwinbx1, and
the pll_hsi_160, pll_hsi_fracn_160 and pll_hse_160 scenarios of the
stm32u5_core clock test. Build-tested only.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
DT_INST(0, soc_nv_flash) enumerates soc-nv-flash nodes across the
whole devicetree, ordered by dependency ordinal, not scoped to the
flash controller this driver instance actually owns. On boards with
more than one soc-nv-flash node (e.g. frdm_mcxa577, which has both
the internal MCXA577 flash and an external W25Q64 SPI NOR flash),
instance 0 can resolve to either node depending on their relative
position in the tree, so SOC_NV_FLASH_NODE silently picks up the
wrong node's write-block-size and erase-block-size.
This was hit after moving the fmu node out from under &peripheral:
the reordering flipped DT_INST(0, soc_nv_flash) from the internal
flash to the external SPI NOR flash, so the flash page layout
reported an erase-block-size of 0x1000 (the SPI NOR's) instead of
the internal flash's actual 0x2000. Erasing with that wrong size
triggers kStatus_FLASH_AlignmentError from the ROM API on real
hardware.
Use DT_CHILD(DT_DRV_INST(0), flash_0) instead, which looks up the
flash_0 child of this driver's own instance instead of searching the
whole tree. flash_0 is the child node name used by every soc-nv-flash
node under the compatibles this file matches.
Verified on frdm_mcxa577 hardware via CMSIS-DAP/MCU-Link:
tests/drivers/flash/common now reports the correct 8K erase-block-size
and the full suite passes (SUITE PASS - 100.00%, 6 passed, 3 skipped).
Build-only checked frdm_k64f and lpcxpresso55s69 (single soc-nv-flash
instance each) to confirm no regression.
Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
Some tests are restricted to running on 1 CPU only.
These tests would hold other CPUs spinning with interrupts
disabled. As sys_clock_driver_init() is only called on
core #0, if core #0 is not the one running the tests and
simply spinning with interrupts locked, we would not be
getting any timer interrupts, resulting in hung tests.
So just for testing, we enable timer interrupt for all
cores.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Send the resets, the baud rate updates, the firmware download, the
public address and the SCO route from the H:4 driver's open-time hook
through the lockstep helper, instead of from bt_h4_vnd_setup() with
the Host's command API, so that a build without a Host, which did not
link, runs the same sequence. The public address comes from
bt_hci_get_public_addr(),
and the firmware blocks are sent from a static command buffer sized
for the longest command, off the caller's stack. The extension selects
BT_H4_VND_OPEN instead of BT_HCI_SETUP.
Build-tested with the peripheral_hr and hci_uart samples on
cy8cproto_062_4343w, the latter with an overlay choosing the c2h UART,
and with peripheral_hr on arduino_giga_r1/stm32h747xx/m7. Not run on
hardware.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Send the baud rate update, the calibration data and the IR
configuration from the H:4 driver's open-time hook through the
lockstep helper, instead of from bt_h4_vnd_setup() with the Host's
command API. A build without a Host did not link, and would have
skipped the calibration commands, which returned success without being
sent; they are now sent in every build. The firmware upload stays in
bt_hci_transport_setup(), and the extension selects BT_H4_VND_OPEN
instead of BT_HCI_SETUP.
Build-tested with the peripheral_hr and hci_uart samples on
mimxrt1170_evk@B/mimxrt1176/cm7, the latter with an overlay choosing
the c2h UART, and with peripheral_hr on frdm_mcxn947/mcxn947/cpu0 with
the nxp_arduino_aw510_wifi_bt shield. Not run on hardware.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The vendor extensions of the H:4 driver initialize their controller
from bt_h4_vnd_setup(), called from the setup() op with the Host's
command API, so a controller-only build, which has no such API, does
not link, and the sequence could only ever run below a Host.
Add bt_h4_vnd_open(), which the driver calls last in open(), once the
UART is running, with a lockstep helper: the extension's commands go
through the driver's own TX path from a buffer of their own, and the
RX thread feeds every received packet to the helper before delivering
it. A failing hook fails open(), which then drops what is queued or
half received, as close() now does too, so that a retry starts clean.
bt_h4_vnd_setup() keeps working through the setup() op.
The extension's commands go through a buffer of up to
CONFIG_BT_BUF_CMD_TX_SIZE parameter bytes, the option for the longest
HCI command a build sends, which the Infineon extension already raises
for its firmware download; the driver fails a longer command with
-EMSGSIZE instead of overflowing the buffer.
Build-tested with the H:4 samples of the in-tree extensions, which the
following commits convert, and with peripheral_hr on arduino_portenta_c33,
whose H:4 driver has no extension. Not run on hardware.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Recent upstream changes added initial 8-bit Intel 8080 bus support to the
STM32 FMC MIPI-DBI driver, but left several gaps and safety checks:
- In mipi_dbi_stm32_fmc_write_display(), 16-bit mode increments by 2
bytes without validating whether desc->buf_size is even. If an odd
buffer size is provided, sys_get_le16() reads 1 byte past the end of
the buffer. Add an explicit check returning -EINVAL for odd buffers.
- Replace the naked MIPI_DBI_FMC_IS_8BIT macro with a parenthesized
MIPI_DBI_FMC_ADDR_SHIFT macro using BIT() to prevent
operator precedence issues or unsigned integer overflow.
- Add a compile-time BUILD_ASSERT in MIPI_DBI_STM32_FMC_INIT verifying
that the parent memory bus width is strictly 8-bit or 16-bit.
- Update dts/bindings/mipi-dbi/st,stm32-fmc-mipi-dbi.yaml to document
both 8-bit and 16-bit Intel 8080 operation and explain the physical
HADDR address shifting rules.
Related to #118104
Signed-off-by: Priyanshu Singh <singhpriyanshu9838@gmail.com>
When a data underrun occured for the I2S transmitter, the tx
stream gets disabled. If the application then also disables
the tx stream (e.g., I2S_TRIGGER_DROP), the driver would hang
forever in the while loop waiting for the TX FIFO to drain on
an already disabled peripheral.
Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
When CONFIG_ADC_STM32_VREFINT_CALIBRATE is enabled, measure VREF+ from
VREFINT on each owning ADC child at init and on sequence.calibrate,
cache it SoC-wide, and return it from adc_ref_get() / adc_ref_internal().
Parent DT vref-mv remains the fallback.
Look up st,stm32-vref io-channels against ADC child nodes, including
disabled vref nodes. Read the cache without taking stm32_adc_vref_lock
in the stream ISR.
Link: https://github.com/zephyrproject-rtos/zephyr/issues/113971
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Replace the shared DEVICE_API (which always reported the first common
block's vref-mv) with a per-child API using DT_PROP(DT_PARENT(node_id),
vref_mv). Stream headers take the reference from api->ref_internal.
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Add adc_stm32_disable_dma_transfer(). On F1, only clear the CR2 DMA bit
when it is already set so writing CR2 with ADON=1 does not start a
conversion. Use it from calibration and the F4 DMA start path.
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Factor regular-path EOC flag and interrupt helpers so the ISR and
start_read use the same series-specific accessors.
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Share sequence-to-register programming (channels, resolution,
sequencer, oversampling) so callers can set up the ADC without enabling
IRQs or starting adc_context. Run hardware calibration before
prepare_read when sequence.calibrate is set.
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Replace the ADRDY busy-wait loop with WAIT_FOR() and named timeouts.
Write ADEN once and drop the F0 rewrite-until-ADRDY loop; the HAL and
adc_api already pass with a single enable.
Assisted-by: Cursor:grok-4.6
Signed-off-by: Lasse Fröhner <lasse@starcopter.com>
Current was scaled in place into pins_v1_v2_values[0]/pins_v3_v4_values[0],
so the SENSOR_CHAN_ALL fetch path clobbered the just-computed current with
the raw differential voltage read back by the voltage step. Give current
dedicated storage and skip the computation for pins that are not configured
as differential, which also avoids scaling a stale value by 1/Rsense.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
adltc2990_trigger_measurement() updated the cached acquisition format
before the control register read-modify-write, so a failing I2C transfer
left the cache permanently out of sync with the device and the equality
guard skipped any retry. Cache the format only after the control
register write succeeds.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The INT1 pad is left disabled by the soft reset at init, so FIFO
interrupts never reach the host and streaming never completes. Enable
it as a push-pull output whose active level follows the int1-gpios
polarity.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
BMA4XX_CMD_FIFO_FLUSH is the command value 0xB0 written to the CMD
register, not a bit mask, so FIELD_PREP(BMA4XX_CMD_FIFO_FLUSH, 1)
wrote 0x10 and the FIFO was never flushed. Write the command value
directly, as done for the other CMD register writes.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The performance power mode bit was set in a standalone write to
ACC_CONF, but the later ODR/bandwidth write to the same register
overwrote it with zero, leaving the sensor in CIC averaging mode.
Fold the bit into the ODR/bandwidth value and drop the redundant
write.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5