The JESD216_DW15_QER_VAL_S2B1v5 case had incorrect status register
read/write logic. It was reading only SR2 but writing both SR1 and SR2,
which could corrupt SR1 if not read first.
Merge the S2B1v5 case with S2B1v1/v4 cases since they all set bit 1 of
SR2. Update the common path to properly handle both single-byte (SR2 only)
and two-byte (SR1+SR2) read/write operations by:
- Reading SR1 first when rd_size is 2, saving it temporarily
- Reading SR2 using the scratch command
- Combining both bytes with SR2 in the upper byte when needed
- Writing the combined value with the QE bit set
Remove the now-redundant S2B1v5-specific case and simplify the LUT
sequence to read SR2 directly instead of reading SR1 first.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Remove local Tx buffer allocated in the
bt_hci_stm32wba_send() function.
Get Event buffer resource to store data returned
by lower layer and provide it to Host in case of
Tx packet is an HCI Command type.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
When uart_rx_disable is called, or rx gets otherwise disabled,
UART_RX_DISABLED event should be emitted.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
uart_bcm2711_poll_in() incorrectly returned the received byte
instead of writing it to the provided buffer.
Update the implementation to store the character in *c and
return 0 on success, matching the UART poll_in API.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Instead of reading calibration data (device-unique, but never changing!)
as part of each conversion, perform the read once and cache the value.
This notably avoids frequently an ICACHE disable/enable cycle on STM32H5,
which is a somewhat slow operation.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Using a union enables accessing the calibration data using member names
instead of an array index, which makes the code more readable.
As long as the layout of struct { T m1; ... T mN; } and array A[N] is the
same (implementation-specific?), usage of the union type as done should
be Standard-compliant: accessing through either member of the union will
use an lvalue with compatible type to the same underlying object, which
is one of the allowed aliasing situations listed in §6.5.7 of N1548.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Various fields were stored in the instance data despite being initialized
at compile-time to a constant value.
Move these fields to the instance configuration instead.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The raw "12" constant was used in a place where the "CAL_RES" define should
have been used instead.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
When no trigger was chosen case statement fell through to
default which causes the return code to -ENOTSUPP
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Local variables are initialized but always overwritten before being
read or return.
Drop the redundant initialization.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
litex_clk_dts_clkouts_read() never reports errors and always returns
0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This new API handles if the MAC address should be fetched from NVMEM,
is static or be randomly generated. Use it so that the driver can
fetch the MAC address from the OTP fuses, when possible.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Introduce the Boot and SECurity(BSEC) control driver. The BSEC
peripheral manages the accesses to an embedded one time
programmable(OTP) array of fuses. Those fuses are used to store
on-chip, non-volatile data like boot and security parameters (e.g:
secret keys, non-volatile counters, etc...).
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Remove the NPU power domain enabling inside ethos_u code due to it
has already been done by soc_reset_hooks()
Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Remove power domain on for GLCDC controller inside driver code
due to it has already been done by soc_reset_hooks()
Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Remove the root clock control early initialization because it has
already been done in the soc_reset_hooks()
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
The DSA tag protocol driver should be native for packet
tagging and untagging. There is possibility other vendors/IPs
use it. So, just defined DSA tag structures in header file
instead of using hal header file.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Renamed DSA_NXP_NETC_GCL_LEN to DSA_NXP_IMX_NETC_GCL_LEN for
naming consistency, and wrapped it in DSA_DRIVERS condition.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ierb_init() never reports an error and cannot fail in practice.
Returning an int led to a dead error.
Convert ierb_init() to a void function, drop the unused return value
checks, and provide a no-op implementation for SoCs that do not
require IERB initialization.
This simplifies the control flow and removes an unnecessary error
condition.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Handle the return value of am_hal_adc_power_control() during ADC
initialization.
The previous code overwrote the return value before it was checked,
which could silently ignore failures when powering on the ADC.
Fix this by validating the return code and propagating an error if
the operation fails.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Add support for the Infineon PSoC4 family to the infineon watchdog driver.
PSoC4 specific ILO frequency and tick period definitions.
Initialization and configuration logic specific to PSoC4.
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Currently, I2C transfer implementation does not have a mutex to
prevent multiple users from sending data at the same time, this could
lead to devices malfunction due to mixing I2C transaction data.
This patch adds mutex into transfer implementation to allow only one
user to send data at the time.
Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
Add device Self Test procedure. It is required to enable the
per device self-test DT property as well as the LSM6DSV16X_SELF_TEST
configuration.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
INA3221 performs measurements sequentially for all enabled channels (see
datasheet chapter 7.3.1), but the driver was not accounting for this
when calculating the wait time. Additionally, when measuring both bus
and shunt voltages, conversion times should be summed rather than taking
greater value.
Fix by counting enabled channels and multiplying them with per-channel
conversion time. For combined measurement, sum both conversion times
instead of using MAX().
Signed-off-by: Karol Werner <karol@ppkt.eu>
Added a `supported` flag to battery status query so if the
charger does not support the query (returns -ENOTSUP) the
command still returns any other supported queries and
doesn't error out without reporting anything. Any other
errors than -ENOTSUP still cause the request to return
immediately, as was the case before the changes. Tested
on nordic npm 13xx.
Signed-off-by: Jimmy Johnson <catch22@fastmail.net>
Add clock configuration step before UART initialization to ensure
proper clock setup. The clock is first disabled, then configured
if supported by the clock controller.
If clock configuration is not supported (ENOTSUP/ENOSYS), the driver
continues with default settings. Other errors are treated as failures
and propagated to the caller.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
When frame_clk_freq is set to 0, the I2S API specifies that the
stream should transition to NOT_READY state (i.e., unconfigure).
In this case, other config fields like mem_slab and block_size
are not used by the driver.
Skip the mem_slab and block_size validation in the syscall handler
when frame_clk_freq is 0 to match the driver behavior and avoid
rejecting valid unconfigure requests due to uninitialized fields.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add clock_control_configure() call during initialization to properly
configure the LPSPI clock. The implementation gracefully handles
platforms that don't support clock configuration by checking for
-ENOTSUP and -ENOSYS return codes and continuing with default
settings. Real configuration errors are logged and propagated.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
The ina2xx channel get helpers assume that channel descriptors are
valid when the driver exposes a given sensor channel.
Checking for NULL channel pointers after they are already
dereferenced does not provide any real safety and can hide
configuration errors.
Drop the late NULL checks and rely on the driver contract that
supported channels must be properly defined.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The INA2xx fetch path assumes valid channel descriptors for all
supported sensor channels.
NULL checks performed after channel data is accessed are ineffective
and misleading, as invalid channel definitions indicate a
configuration error rather than a runtime condition.
Remove the redundant checks and keep the channel handling consistent
with the driver expectations.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Change to use DT_HAS_NXP_SIM_UUID_ENABLED/DT_HAS_NXP_RCM_HWINFO_ENABLED
as the dependency condition for HWINFO_MCUX_SIM/HWINFO_MCUX_RCM to
enable the driver when the nxp,sim-uuid/nxp,rcm-hwinfo compatible
is present in the devicetree.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
Warning as error was:
.../drivers/display/display_rm67162.c: In function ‘rm67162_write_fb’:
.../drivers/display/display_rm67162.c:383:9: error: ‘wlen’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
383 | return wlen;
| ^~~~
cc1: all warnings being treated as errors
Signed-off-by: Stephan Linz <linz@li-pro.net>
Propagate the HAL error otherwise it may return success even
when it fails causing invalid entropy and compromising security.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Sometimes, the size of a message coming from a target is not known in
advance. In those cases, we must rely on the T-bit to get the end of
message, which is signaled as the `COMPLETE` bit of `MSTATUS`.
This patch verifies the COMPLETE bit before starting to wait for data,
and if set, simply returns what was read so far.
As a bonus, this simplifies the handling of IBI bytes: no need to rely
on timeouts, if it's reading from IBI, etc.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Return value for `mcux_i3c_do_one_xfer` was being lost due reuse
of `ret` variable. Use another variable for timeout check.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>