Add a guard clause in flash_esp32_read() to return 0 when the
requested length is zero. This avoids unnecessary operations
and aligns with expected flash API behavior, where reading
zero bytes is treated as a no-op.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
At this moment, DMA for SPI 3-wire half-duplex operation is not supported
by the pio driver. A check was implemented there to prevent user from
enabling DMA, but wasn't bypassed when CONFIG_SPI_RPI_PICO_PIO_DMA is
not enabled at all, under which the `dma_config` structure isn't defined
at all.
Fixed#94897.
Signed-off-by: Terry Geng <terry@terriex.com>
Duty value in the driver is calculated from timer cycles, which
can introduce precision loss when converting from pwm_set() to
pwm_set_cycles(). To avoid truncating values with a fractional
part ≥ 0.5 and further drifting the effective duty, round the
computed duty to the nearest integer.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Currently, if a SV is tracked, we try to store:
flags & BIT(3) -> 0b1000 -> least significant bit 0 is stored.
Same is valid for the is_corrected field.
Use double negation to treat any non-zero value as true.
Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
Series 2 EUSART and SiWx91x GSPI drivers were missing the
`iodev_submit` member from their API structs, leading to
null pointer dereference if CONFIG_SPI_RTIO was used.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Exclude STM32F7 SoC series from PM support since that SoC doees not
yet manage power management in Zephyr and HAL API functions
LL_I2C_EnableWakeUpFromStop() and LL_I2C_DisableWakeUpFromStop()
are not implemented in the H7 HAL/LL drivers.
This change ports into the STM32 RTIO driver the change made in the
non-RTIO driver through commit 1804eb7bc3 ("drivers: i2c: stm32:
exclude stm32f7 family for PM").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Drop few CONFIG_PM_DEVICE_RUNTIME guards, the pm_device_runtime
functions they are masking are no-op automatically when the
corresponding config option is not selected.
This change is related to the change made in the STM32 non-RTIO driver
trough commit 4f3523d9af ("i2c: stm32: drop few redundant guards").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Always call pm_device_runtime_get() when registering a target
even if the device is not wakeup capable to prevent I2C target not being
function if the device goes into a SoC Stop mode.
This change ports into the STM32 v2 RTIO driver the change made in the
non-RTIO driver through commit 67f80e35b8 ("i2c: stm32: always call
runtime_get when registering targets").
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Build time configuration option to set TWT setup duration.
If AP does not respond to TWT setup request for this period,
STA will timeout and report setup failure.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
Added support for retrieving the regulatory domain information from
the siwx91x driver. Since the SDK does not provide a GET API for
region details, the driver now stores the country code and reuse
the configuration `sli_si91x_set_region_ap_request_t` to get the
channel information. This stored data is returned when a GET
operation is requested.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Moved the `siwx91x_map_country_code_to_region()` function
from the Wi-Fi driver source file to nwp.c.
This change prepares the codebase for upcoming enhancements
related to the regulatory domain GET operation.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Add support for configuring the regulatory domain (region code) to
ensure the device operates in compliance with local RF regulations.
The region must be set before the Wi-Fi interface becomes active
i.e., before scan or connection in STA mode, or before starting in
AP mode.
Since the SDK does not support setting the country code directly,
the driver maps country codes to region codes
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Move disks directory to disk to match with the naming of the driver
class. This only affects the recently introduced header for STM32 disk
drivers so it should be very low impact.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
remove `select MDIO` from the
ethernet drivers, that don't directly use mdio
and only use the ethernet phy api, now that the
phys select MDIO
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
devices on a bus are recomended to
select its needed drivers, apply this to the eth phys
that need gpios, so that they just work by
enableing the device in the dts.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
devices on a bus are recomended to
select its protocol, apply this to the eth phys
on the mdio bus, so that they just work by
enableing the device in the dts.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
z_nxp_os_timer_ignore_timer_wakeup() was only added
when Standby mode was enabled. Move this function
out of the conditional section.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
As it's not being used anywhere in the driver. Moreover, the extra
unref would trigger a double-free assert (#94311); which is what
motivated this cleanup.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
In order to allow the linker to place certain objects into external RAM,
e.g. heaps, adjust the memc initialization level to PRE_KERNEL_1, allowing
clock control and memc to come up before priority objects like heaps are
initialized.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Determine event discardability after parsing the HCI header and require
at least one byte before reading the LE subevent. This removes a possible
OOB read on malformed/short LE Meta events. Also mark LE Extended
Advertising Report as discardable, matching legacy Advertising Report to
reduce RX pool pressure during heavy scanning.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The TX flow control semaphore was initialized with a count of 1 and
released again after every bt_esp32_send() call. This broke the VHCI
flow control contract and could allow sending more packets than the
controller advertised.
This prevents host/controller overruns and ensures proper synchronization
with the ESP32 VHCI interface.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Fix a bug where if CONFIG_UART_ASYNC_API was enabled in the config, the
interrupt flags would get cleared after the interrupt driven API callback
finished executing, causing data loss if data happened to arrive after the
callback but before the flags were cleared.
Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
This commit adds specific DMA configuration for STM32N6xx.
STM32N6xx uses GPDMA for SAI as STM32U5xx/U3xx/H5xx/H7RS etc.
In constrast to these series, STM32N6xx DMA requires a secure
and privileged channel.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Add a workaround for `NRF53_ERRATA_159_ENABLE_WORKAROUND`
instead of simply printing an error and failing the transaction.
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
Add device deinit function. Support is optional as it is not widely
used and it enables pinctrl sleep state so it impacts memory footprint.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When PM or PM_DEVICE is enabled pinctrl sleep state is using for
device suspension. However, there are cases where power management is
not used but we still want to be able to put pins to sleep state, e.g.
device deinit.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Fix two issues with the SAI TX Stream.
1. Drain command does not release the last memory buffer
2. TX Stream status does not change to READY after STOPPING
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Issue: the alarm 1 do not generate interrupt
There are three compare registers in a SAM TC channel:
RA --> alarm 0
RB --> alarm 1
RC --> top_value
By default the RB/TOIB was configured as an input and no longer
generates interrupt.
Set the direction of TIOB to output for alarm 1 interrupt.
Fixeszephyrproject-rtos/zephyr#85018
Signed-off-by: CHEN Xing <xing.chen@microchip.com>
GPIO interrupts do not work on MCXA, MCXA has ICR register but feature
FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT value is 0, can't only use
this feature to support ICR. So adjust feature judgment.
Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
We can both optimize and clean up the code by using short circuit logic
and static variables instead of stack variables.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>