The eswifi socket offload driver's setsockopt() handler returns success (0)
for TLS_HOSTNAME and TLS_PEER_VERIFY options without implementing them.
This causes applications to believe TLS hostname and peer certificate
verification is enabled when it may not be, potentially enabling
man-in-the-middle attacks.
The Inventek eS-WiFi module's default P9 setting (0=None) means no
certificate verification occurs unless explicitly configured out-of-band.
Return -ENOTSUP instead, making the limitation explicit so applications
can detect and handle unsupported TLS options appropriately.
Signed-off-by: Pavel Kohout <pavel.kohout@aisle.com>
When adc resolution is set to 12bit (lpadc provides 12bit or 16bit)
and the FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS is not enabled,
the function mcux_lpadc_isr saves the measured value to variable result
but this value is not used after that,
(unless the FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS is enabled).
This change fixed the issue.
Tested on FRDM-MCXA266 with adc_dt zephyr sample.
Signed-off-by: Martin Martincek <martin.martincek@nxp.com>
Add support for configuring SCL and SDA spike suppression based on
the I2C controller input clock.
The DesignWare I2C spike suppression registers are programmed using
values expressed in ic_clk cycles, in line with the I2C-bus
specification.
Signed-off-by: Shreehari HK <shreehari.hk@alifsemi.com>
Move all PHY configuration code to dedicated drivers called using a custom
API (we can't instantiate proper devices because some of these "PHYs" are
really used to initialize an interface to a device NOT owned by the SoC,
such as when an ULPI PHY is in use).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Refactor utility macros in the STM32 UDC driver, and move some of them to
the STM32 common USB header as they can be useful in other places.
While at it, add new helper macro USB_STM32_NODE_PHY_IS_EMBEDDED_FS.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add full power‑management support to the LPS2XDF sensor family
(LPS22DF, LPS28DFW, ILPS22QS). This integrates the drivers with the
Zephyr PM subsystem and allows deferred initialization through
power domains.
Introduce a power_on() callback in lps2xdf_chip_api and track the
current ODR in lps2xdf_data for suspend/resume handling. Implement
a PM control callback that:
- powers on the chip on PM_DEVICE_ACTION_TURN_ON
- enters power‑down mode by setting ODR=0 on SUSPEND
- restores the previous ODR on RESUME
- performs no action on TURN_OFF
Convert initialization to use pm_device_driver_init() and update
the instantiation macros to use PM_DEVICE_DT_INST_DEFINE.
Update each chip driver (lps22df, lps28dfw, ilps22qs) to provide a
.power_on implementation and store the initial ODR in the driver
data.
This enables proper power‑domain control and low‑power operation for
all LPS2XDF‑based pressure sensors.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add power management (PM) support to the LIS2DW12
accelerometer driver, enabling integration with Zephyr's
PM subsystem and power domains.
Changes:
-Implement lis2dw12_pm_control() callback to handle PM actions:
PM_DEVICE_ACTION_TURN_ON: Performs full chip initialization
PM_DEVICE_ACTION_SUSPEND: Puts device into power-down mode (ODR off)
PM_DEVICE_ACTION_RESUME: Restores previous output data rate
PM_DEVICE_ACTION_TURN_OFF: Supported (no-op)
- Refactor driver initialization:
Extract hardware init sequence into lis2dw12_power_up()
Add lis2dw12_bus_check() for bus readiness verification
Use pm_device_driver_init() for PM lifecycle management
Add PM_DEVICE_DT_INST_DEFINE to device instantiation macro
This enables the LIS2DW12 to be controlled via power domains,
allowing deferred initialization until the device is explicitly turned on,
and proper suspend/resume for power savings.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Recent changes (6e65fbe585) deprecated Kconfig configuration for
TIMER that is used for bytes counting. In one place code was not
cleared correctly which results in compilation failure when
deprecated symbol is used.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add additional business check to waiting SUSPF to be set so
that the loop cannot be executed forever when the dma stream
is idle.
When the stream is not busy, then there is nothing to suspend.
However, if suspend was attempted for an idle stream, then the
changed loop waited forever SUSPF to be set. This could have
happened at least when serial api tx_abort() is called with
stm32u5 and tx dma transfer becoming ready about the same time
the tx_abort() API is called.
Fixes#103042
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
1. Rename the queue structure from i2s_txq_entry to
i2s_mcux_q_entry
2. Renamed NUM_RX_DMA_BLOCKS to NUM_DMA_BLOCKS
3. Changed config_dma_blocks function to take
struct i2s_mcux_q_entry * as an argument.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Currently, the driver does not acknowledge error interrupts from
the device, resulting in the IRQ being continuously set in certain
cases. Add writes to acknowledge these interrupts.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Add support for display orientation to the SDL display driver by
implementing the set_orientation API.
It will rotate around the center point.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Combine register address and data in one buffer and use i2c_write_dt()
instead of i2c_burst_write_dt() so the transfer is a single I2C
transaction. Some I2C controllers (e.g. Infineon) split burst write
into two transactions with a STOP in between, which causes failure.
Signed-off-by: Oleksandr Skopets <skopets.sasha@gmail.com>
Doing this increases the QSPI peripheral clock from 40 MHz to 80 MHz.
This improves flash access throughput and overall performance
on siwx91x devices, as QSPI is used for external flash operations.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
The Siwx91x GSPI controller requires the FIFO reset bits to be
held high for a minimum of one GSPI bus clock cycle.
Currently, the driver asserts and deasserts the reset back-to-back,
which may result in an insufficient reset pulse width at higher
frequencies.
Add a small, frequency-based delay after asserting the FIFO reset
bits to guarantee the minimum reset duration, ensuring reliable
FIFO reset behavior.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
Update the GSPI DMA configuration to conditionally register the DMA
callback based on transfer direction and RX buffer presence. The
callback is enabled for TX-only transfers when the RX buffer is NULL
and for RX transfers when a valid RX buffer is provided.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
On Cortex-M with NVIC, if a peripheral sets its interrupt
flag again while the current handler is executing, the NVIC
pending bit is set. Even after the current handler clears
the flags, the pending bit still remain set. The current
implementation manually clears the pending bit to avoid
unneccesary extra handler calls when no additional
processing is required.
On other Arm GIC-based platforms like Cortex-R52, the GIC
automatically clears the pending bit when the peripheral
flag is cleared since these interrupts are level-sensitive.
Therefore, manually clearing the pending bit is unneccesary.
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
The current stm32 drivers will only enable soft NSS support if
the device is using a Zephyr managed GPIO for CS, or if the
CONFIG_SPI_STM32_USE_HW_SS flag is set. Neither of these are
actually appropriate for a peripheral, which doesn't control CS.
With this change, it is possible for the SPI interface to be
configured as a peripheral but still use soft NSS -- otherwise,
short of creating a "fake" GPIO configuration, the peripheral
will always use hard NSS, and for some boards/configurations,
that is unworkable. In the case of a board where the CS
is not hooked up, we can use soft NSS to allow the peripheral
to assume CS and be driven by the SPI clock signal alone.
Our board has only three signals (clock, COPI, POCI) enabled
on one of the SPI interfaces (it is communicating with another
MCU on the same board), and works with this change. Without
the change, we must enable a "fake" GPIO driver configuration
(which is never used for anything, and really makes little
sense for a peripheral, but it just happens to force the
driver to go down that code path). We cannot disable the
CONFIG_SPI_STM32_USE_HW_SS mechanism, as that impacts ALL
interfaces, and we have a second interface in controller
mode that speaks to flash and requires the NSS_HARD codepath.
Signed-off-by: Rob Newberry <rob@zenomoto.com>
The gpio_pca_series driver may stop responding if the gpio_int is
asserted between reading the interrupt status and clearing it.
If the interrupt gpio_int is not deasserted by the time the handler
finishes, the interrupt work should be rescheduled.
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
This change makes the driver rely on DT_INST_FOREACH_STATUS_OKAY(...)
rather than copy-paste the same code several time.
This also has the advantage of allowing more that 5 instances of this
uart driver.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Drop `counter_stm32_reset_timer`, introduced in PR #94189 (01a00d5),
as it duplicates the existing `counter_stm32_reset` functionality.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Calling net_if_set_link_addr() is needed to update the link address
information of the interface.
Signed-off-by: Jeremy Truttmann <jetstreeam.code@outlook.com>
Add explicit clock configuration and enable calls during driver
initialization.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Add explicit clock configuration and enable calls during driver
initialization.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Fix incorrect diff calculation for relative alarms that caused alarm
callbacks to never fire. The original code calculated diff as
(alarm_cfg->ticks - now), which caused unsigned underflow when
now > alarm_cfg->ticks, resulting in a huge diff value that
incorrectly triggered the late alarm path and set callback to NULL.
For relative alarms, the diff should simply be the ticks value since
it already represents the delay from the current time.
Also add channel validation to return -ENOTSUP for chan_id > 0 since
ESP32 timer hardware only supports one alarm comparator per timer.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Remove the negative value check on bss_max_idle_period, which is
defined as an unsigned type and can never be less than zero.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Refactor scan_done_handler to retrieve Access Point (AP) records one
by one rather than pre-allocating a large buffer for the entire list.
Previously, the driver attempted to k_malloc space for all detected APs
simultaneously. In environments with high AP density or under system
memory pressure, this allocation would often fail, resulting in no
scan results being reported.
Improvements:
- Switched to stack-allocated wifi_ap_record_t to process entries.
- Replaced esp_wifi_scan_get_ap_records with a while-loop using
esp_wifi_scan_get_ap_record to reduce peak heap usage.
- Added esp_wifi_clear_ap_list() to ensure hardware resources are
freed after the loop completes.
- Added warning log on unexpected scan fetch failures.
This makes Wi-Fi scanning significantly more robust in memory-constrained
scenarios.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>