When the endpoint is re-enabled, check if the current FIFO settings can
be reused. Further work is needed to improve FIFO memory handling for
more advanced interface configurations.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
In lis2dux12_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.
Fixes: CID 529855
Signed-off-by: Armando Visconti <armando.visconti@st.com>
In lsm6dsv16x_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.
Fixes: CID 529864
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Set fifo_mode structure to zero and initialize it properly according
to what interrupt event the user has selected.
Fixes: CID 529871
Fixes: CID 529865
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Cache CTRL1 into reg_ctrl1_active_val inside lis2dh_init_chip()
in the PM_DEVICE_ACTION_TURN_ON path. This prevents the first
runtime-PM RESUME from writing 0x00 to CTRL1 and disabling the sensor
when runtime-PM is enabled.
Fixes: #92196
Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
The second argument should unconditionally be the size of the output
memory area, not computationally derived from the input payload length.
The previous length validations would be incorrect when
`cmd_len == CONFIG_LORA_RYLRXX_CMD_BUF_SIZE`, as `snprintf` would be
told the output buffer was `CONFIG_LORA_RYLRXX_CMD_BUF_SIZE + 1` bytes
long.
Fixes#92619Fixes#92624
Signed-off-by: Jordan Yates <jordan@embeint.com>
Makes the choice CORTEX_M_SYSTICK_LPM dependent upon the
CORTEX_M_SYSTICK to prevent its default from showing up in
the .config of projects that do not use the CORTEX_M_SYSTICK
timer driver.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The clock get rate api can be slow in certain targets and thus slowing
each SPI transaction. Instead on startup fetch the clock rate and store
this in ram. Then each spi configure action is simply reading that
variable
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Virtio headers are moved to zephyr/drivers/ as they have no reason to be
top-level headers since virtio is a driver class.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Peripheral clocks are currently not being disabled for JTAG reset
condition, which causes driver init failures when debugging the SoC
with JTAG. Fix by disabling all clocks for this reset type.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Coverity reports a potential integer overflow in the accel_range
computation due to the use of a left shift on an int type.
CID 520269: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
Even though the register value is constrained to 0–3 by the BMA456 spec,
and no real overflow occurs, an explicit cast to int64_t prevents false
positives and aligns with safe coding practices.
Fixes: #90517
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
There was an unnecessary nested `if` in `ifx_cat1_counter_init` with the
same condition already checked in the outer block.
This results in dead and redundant code with no functional impact but
harms readability.
The inner `if (rslt != CY_RSLT_SUCCESS)` was removed to clean up the
function.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The function counter_rz_gtm_set_alarm was accessing alarm_cfg->flags and
alarm_cfg->ticks before verifying that alarm_cfg is non-NULL.
This could lead to undefined behavior or crashes if a NULL pointer is
passed.
The pointer check has been moved before any dereference to fix this bug.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The bus helpers for SETDASA and SETNEWDA could have the same
dynamic address assigned as it's static addr for SETDASA or
as it's dynamic addr for SETNEWDA. (Althrough, only a clown
would set the new dynamic address to the same old dynamic
address, it is still a valid address to set to).
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Drop LOG_ERR calls from driver level related to transfer calls.
Application can handle the result and decide whether to log or not.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Build a combined mask from the tx_invert and rx_invert flags and pass it
to uart_hal_inverse_signal(). Only invoke the HAL call when the mask is
non-zero, preventing unintended inversions and eliminating redundant
calls when no inversion is requested.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The LTDC RGB565 format corresponds to the PIXEL_FORMAT_BGR565 format.
Update the LTDC driver to advertise PIXEL_FORMAT_BGR565 as the supported
format instead of PIXEL_FORMAT_RGB565. This change ensures correct color
rendering in the sample display application and enables usage of the
video capture sample application.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Fix I2C target implementation so NACKs are issued if the callback returns
an error. This allows for proper signaling to the I2C host when commands
or data are invalid for the I2C target.
Signed-off-by: Alex Hogen <alex@edt.com>
Fix compile error due to unknown macro when building CONFIG_I2C_TARGET for
Silabs Thunderboard EFM32GG12 (SLTB009A). The previous macro exists in
(all?) EFR32 part headers but not EFM32.
Signed-off-by: Alex Hogen <alex@edt.com>
Change backup domain access gating in STM32 RTC interrupt handler
to only request access when RTC registers ar to be modified
instead of during the whole RTC interrupts service including
interrupt consumer callback execution.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Fix the backup domain access request in STM32 RTC initialization that
was unbalanced in case of clock configuration failure.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Add missing backup domain access requests in STM32 RTC counter
driver that are needed to modify RTC registers.
Remove backup domain access requests in rtc_stm32_read() since this
function only reads RTC registers and backup domain access protection
protects RTC registers against write accesses only.
Fixes issue 92511.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Add the 'const' qualifier when casting 'dev->config' to 'struct
bmp581_config *' to preserve const-correctness and fix SonarQube warning :
"A cast shall not remove any const or volatile qualification from the
type of a pointer or reference."
This improves maintainability by respecting the const contract and resolve
static analysis issues.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Move null check for 'dev' before dereferencing it to access dev->config.
This ensures the check is meaningful and avoids undefined behavior in case
of a null device pointer.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
When WDT_OPT_PAUSE_IN_SLEEP option is passed in set enableWait flag
in addition to the enableStop.
Fixes#86437
Signed-off-by: David Leach <david.leach@nxp.com>
Move the IronSide APIs to soc/nordic from drivers/firmware since
these are vendor specific APIs. The header files are now included
from <nrf_ironside/*.h>. Adjust code that uses these APIs accordingly.
Also move the DT binding for "nordic,ironside-call" from
bindings/firmware to bindings/misc.
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Defaults cannot be overidden (even with configdefault extension), they
only work if the original symbol is defined after the override e.g.,
"drivers and then subsys/net" but for kernel symbols,the default value
overrides don't work due "kernel and drivers" order, the kernel defines
the original symbol with the default and then it cannot be overridden.
Move the kernel symbol override to the original definition to make it
affect. Else any sample that uses nRF70 but doesn't enable WPA
supplicant ends up with 1024 and crashes.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Fix a null pointer dereference in akm09918c_submit(), where writeByte_sqe
was dereferenced before checking if it was NULL.
Coverity reported this as CID 516247: the pointer returned by
i2c_rtio_copy_reg_write_byte() may be NULL, and accessing its `flags`
field before checking leads to undefined behavior.
Move the access to writeByte_sqe->flags after confirming both
writeByte_sqe and cb_sqe are valid.
Fixes: CID 516247
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
In case the dmic had previous been run and stopped,
make sure active_buf_idx is initialized to 0 when
setting up dma on start, otherwise the dma callback
can return the wrong buffer.
Also purge the rx_queue before freeing the slab buffers,
to minimize risk of any async read request getting
back a slab buffer that is freed.
Signed-off-by: Mike J. Chen <mjchen@google.com>
The interrupt handling was not deterministic before because it relied
on "guessing" if the lpspi was a v1 type that was stalling due to design
errata. This obviously ended up being wrong in some cases. So we really
need to fix this so that it is deterministic, and my idea to do that is
to explicitly count how many words we have written to the TX fifo
throughout the whole transfer.
As a side effect of making the IRQ more deterministic, we can't support
the SPI_HOLD_ON_CS flag for v1 LPSPI anymore. It is fundamentally
impossible due to the fact that the transfer can only complete in
hardware as a result of CS deasserting. If this is absolutely a
requirement to support this flag in the future, my recommendation is to
update the driver so that it muxes the pin to a gpio before ending the
transfer, but that would kind of defeat the point of having a native CS,
at least at the end of the xfer.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Update the driver to handle -ENOSYS from phy_configure_link(), which is
now returned when the cfg_link callback is missing (e.g., in fixed-link
PHYs).
Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Avoid the following clang error
`error: label followed by a declaration is a C23 extension`
by writing this switch case as a codeblock.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Until register ABB->STATUSANA is visible it must be checked using
defined offset to base ABB register.
Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
Add a log for the device name on bitrate changes, without this it's very
hard to understand what's going on in a system with multiple bridges.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The GRTC counter is not cleared at startup, therefore the
`last_count` variable needs to be initialized accordingly.
This change:
- Prevents overflow of the `sys_clock_announce()` int32_t parameter
- Ensures the correct uptime value, which should be reset during
initialization
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
Previously, FUNC_3 related setting were cleared unconditionally,
regardless of the selected alternate function. This could
unintentionally disable FUNC_3 settings when configuring other
alternate functions.
This change ensures that FUNC_3 gcr/ext bits are only cleared
when alt_func is IT8XXX2_ALT_FUNC_3.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Fix for compiling i2s drivers on the NXP mimxrt1010_evk board.
For mimxrt1011, the defines kCLOCK_Sai2... are not defined as the sai2
peripheral does not exist. Trying to compile gives error. Fixed by adding
check for device tree node around code that uses the defines. Also added
same for sai1 and sai3. Thanks @lucien-nxp, @ZhaoxiangJin from NXP.
Signed-off-by: Imran Sajjad <imran.sajjad@iconfitness.com>
Fix variable declaration so that this driver will compile with clang,
which does not support variable declarations within switch statements
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Enable the RTC-domain and main digital regulators early in clock init,
then load and program the factory/runtime calibrated bias values for
high-power and low-power regulators into the PMU. This ensures the
correct voltage/current settings for stable, low-noise clock operation
in active, modem and sleep modes.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>