rtio_cqe_consume() may return NULL so we need to check before
using any members of the returned struct.
Fixes#90473Fixes#90489Fixes#90497
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Coverity flagged that the return variable ret may not be
initialized when returning. So give it a default value.
Fixes#90509
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
espi: add espi peripheral channel HOST_CMD driver for rts5912
Unlike other chips using IO port 0x800-0x8ff, we utilize shared memory to
transfer host command parameters. The AP firmware must have corresponding
settings for this configuration.
Signed-off-by: jhan bo chao <jhan_bo_chao@realtek.com>
base on DesignWare I2C driver to implement RTS5912 I2C driver.
1. support customize bus recovery function.
2. fix isr timing issue by enable tx empty control.
3. support stuck at low handle by enable bus clear feature.
4. support custom stuck at low timeout set from dts
5. disable block mode in rts5912 i2c.
6. support I2C_ALLOW_NO_STOP_TRANSACTIONS
Signed-off-by: Titan Chen <titan.chen@realtek.com>
Separate out host(local) and FW(remote) statistics and in case of a
FW statistics timeout, return success with a magic value in the FW
statistics, this way atleast host statistics would be handy for
debugging instead of sending failure up.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
A write to the "ctrl_meas" register can cause the sensor to transition
from sleep to normal mode (which is default Kconfig settings). As per
BME280 datasheet, writes to the "config" register in normal mode may be
ignored. This can lead to use BME280_STANDBY_05MS and BME280_FILTER_OFF
instead of the values set by the application. To fix this, write to the
"config" register before "ctrl_meas" in the sensor init function.
Signed-off-by: Loic Domaigne <tech@domaigne.com>
The current I2C driver assumes that at least one byte will be read in CQ
(command queue) mode. However, when a 0-byte read is issued
(e.g., by cmd_i2c_scan),
The read handler uses (len - 1) to set the command queue length.
When len is 0, this underflows to 0xFF, leading to an incorrect transfer
length and possible crash.
To fix this, add a check in cq_mode_allowed() for reads with length 0:
-Fallback to PIO mode in such cases.
-Properly handle 0-byte reads by issuing STOP (E_FINISH) when the slave
address is acknowledged.
-Add appropriate handling for NACK conditions when the slave address is
not acknowledged.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Keep data instance inside of data structure.
Avoid accessing global data or using pointers to out of
data instance.
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
The following parameters are exposed through DTS bindings:
- ODR.
- Dual Frequency Mode.
- Measurement Mode.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Each time this sensor gets a reading, it contains a matrix of 4 x 32
pixels containing distance readings, from which the 1-D result is
calculated. The private channel would expose this array through
Sensor APIs.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
- Add AFBR module as a HAL.
- Platform layer to support running AFBR API using Zephyr.
- Ability to instantiate on device-tree.
- Samples in the module proving foundations works.
- Zephyr Sensor API support, by introducing:
- Read/Decode for SENSOR_CHAN_DISTANCE (1-D results).
- Streaming mode for DATA_READY (1-D results).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
DMA channel stats like pending_length or free is not protected
and can be modified in parallel by a consumer and a producer.
This can result in non-atomic updates which in turn will result
in using stale data.
Fix this by making regions of code accessing dma stats atomic.
Fixes: e94c86f395 ("drivers: dma: Add initial support for NXP SDMA")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Each time we configure an SDMA channel we also compute the total
allocated DMA buffer length but we assume is initialized with zero.
This is true each time a channel is requested. But if there are
multiple calls to configure without releasing the channel the buffer
length is not correctly computed.
So, we need to initialize it with zero each time we reconfigure the dma
channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Removed a logically dead else by doing sensor channel check
in a way that's more aligned with how other drivers do it.
Fixes: CID 505949
Fixes: zephyrproject-rtos/zephyr#90558
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
CLOCK_CONTROL_NRF_HFINT_CALIBRATION depended on the renamed
nordic,nrf-hfxo -> nordic,nrf54l-hfxo. Update config to depend on
DT_HAS_NORDIC_NRF54L_HFXO_ENABLED to match new compat name.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Implement vendor specific
z_nrf_clock_bt_ctlr_hf_get_startup_time_us() which gets the startup
time of the high frequency clock used for Bluetooth.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
DT_ENUM_HAS_VALUE_BY_IDX states, that the value
must be lowercase-and-underscores, this makes sure,
that they can match.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
some current sense amplifiers have a non zero offset voltage
that correlates to zero current. adding this offset voltage binding
allows the driver to be used with this type of circuitry.
Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
Add support for the simcom a76xx modem which is similar to the simcom 7080
but has a few key differences. Tested with a simcom A7672SA module but as
there is a single simcom A76XX AT commands manual, the driver should work
with other modems of the series.
Signed-off-by: Olivier Lalonde <o@syskall.com>
The Clock Security System (CSS) feature signals failure of an external
oscillator by triggering an NMI. As such, when this feature is enabled,
RUNTIME_NMI must also be enabled such that the NMI handler can be modified
to point to the appropriate function.
The STM32 clock control Kconfig checks whether the CSS has been enabled in
Device Tree, and forcefully selects RUNTIME_NMI if enabled since the driver
code will require it. However, the check has been implemented improperly:
"dt_nodelabel_has_prop" was used instead of "dt_nodelabel_bool_prop", an
error similar to using DT_NODE_HAS_PROP() instead of DT_PROP() in C code.
Since the property always exists, as long as the HSE is enabled, the
RUNTIME_NMI option is always select'ed, even if not actually required.
Use the correct Kconfig function to ensure RUNTIME_NMI is select'ed only
when it is required, instead of whenever HSE is enabled regardless of CSS.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Add initialization of `ret` to avoid reports of uninitialized variable
being returned. This variable normally gets initialized while the loop
iterates over channels, but potentially it could be left uninitialized
if the loop finished in its first iteration because of no channels to
be processed.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Correct the size of the channel_setup_cfg array, as it should contain
entries for all available channels (AD4130_MAX_CHANNELS), not for the
available configuration slots (AD4130_MAX_SETUPS).
Move also checking of the channel index to the very beginning of
adc_ad4130_channel_setup(), to avoid potential writes to .live_cfg
beyond the channel_setup_cfg array.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>