The pointer to the clock device can be const, as it does never change at
runtime. This moves the const struct device *clock from data to config
struct and initializes it inside the init macro. The __uart_stm32_get_clock
function is no longer needed and removed.
Signed-off-by: Thomas Decker <decker@jb-lighting.de>
The dt binding file requires the reset pin to be configured
as `GPIO_ACTIVE_LOW`, but the driver uses the
logic of `GPIO_ACTIVE_HIGH`.
Therefore, modify the logic in the driver and add a
migration guide.
Signed-off-by: Yunjie Ye <yun_small@163.com>
The error code returned when nrfx_pdm_start() fails is supposed to
be propagated to the caller.
This was broken by commit 16b9f60, which overwrote the original
error with the result of release_clock(), potentially returning
success even though the PDM start failed.
Restore the correct error propagation.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This adds an optional auto-baudrate mechanism that improves robustness
when the modem boots with an unknown or changed UART speed.
Key additions:
* New Kconfig option MODEM_HL78XX_AUTO_BAUDRATE and related settings:
- selectable target baud rate
- detection baudrate list
- detection timeout and retry count
- option to persist AT+IPR updates
- option to start diagnostics or boot directly with auto-baud logic
* UART status tracking added to hl78xx_data, including current and target
baud rates
* New HL78XX_MODEM_INFO_CURRENT_BAUD_RATE info field
* New MODEM_HL78XX_STATE_SET_BAUDRATE state with detection and switching
logic
* Chat, init, and diagnostic handlers updated to route failures into the
auto-baudrate logic when enabled
* New helpers: hl78xx_get_uart_config(), hl78xx_try_baudrate(),
hl78xx_detect_current_baudrate(), hl78xx_switch_baudrate()
* Startup delay increased when auto-baudrate-at-boot is enabled
These changes allow the driver to recover from unexpected modem UART rate
changes and keep the UART configuration synchronized with the modem.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add MODEM_HL78XX_EVENT_AT_CMD_TIMEOUT event to distinguish chat scripts
timeouts from other script failures. The chat callback now maps
MODEM_CHAT_SCRIPT_RESULT_TIMEOUT to this new event.
Update state handlers so AT command timeouts trigger the init fail
diagnostic script during startup, and fall back to the power-on pulse in
the init-fail state, similar to existing timeout handling.
This improves error classification and enables more accurate recovery
logic for long-running or stalled AT command exchanges.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Extend modem_dynamic_cmd_send() with a response_timeout parameter to allow
callers to specify the overall script timeout per command. The previously
hardcoded 1000 ms timeout is removed (set to 0 in params) and the script
timeout is now driven by the passed-in value.
Update all internal call sites to provide MDM_CMD_TIMEOUT (in seconds) and
increase the default command timeout from 10 s to 40 s. Several chat
scripts and configuration paths are updated accordingly.
This improves reliability for long-running HL78xx operations and ensures
consistent timeout handling across sockets, RAT/band configuration, APN
setup, PDP activation, AirVantage DM session control, and TLS/TCP/UDP
socket management.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Extend socket-related chat match tables to handle generic "ERROR" responses
for both CONNECT and +KUDP_IND URCs, improving detection of failed socket
creation and connection attempts.
While updating match handling, unify all modem commands to use the standard
OK match set by adding hl78xx_get_ok_match_size(). All remaining users of
the former sockets-specific OK match are switched to the unified helpers.
Additionally, all dynamic command send paths now provide an explicit match
count and use MDM_CMD_TIMEOUT instead of the previous hard-coded `1` for
script timeout, improving consistency and reliability across:
* RAT configuration
* band configuration
* APN setup
* GSM PDP activation
* AirVantage DM session control
* socket send and TLS configuration paths
This brings all command execution onto the same match/timeout model and
ensures ERROR responses are handled correctly during socket operations.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Avoid overwriting cached input state while ISR-deferred work is pending.
Previously, port_get_raw() updated pins_state.input via
update_input_regs(), which could corrupt previous_state used for
transition detection.
Fix by reading input registers directly without updating the global cache.
Signed-off-by: Woobin Song <woobin.song@assaabloy.com>
Disable all interrupts when the VIM interrupt controller is initialized so
that it doesn't encounter any stray interrupts that were not enabled on
Zephyr.
Signed-off-by: Amneesh Singh <amneesh@ti.com>
Fix macro parameter typo (##inst → ##index) in CAN_RENESAS_RA_INIT
to ensure unique IRQ configure function names per instance.
Signed-off-by: Khai Cao <khai.cao.xk@renesas.com>
Enable support for configuring and enabling the external timestamp counter
of the NXP LPC MCAN.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add support for configuring and enabling the internal timestamp counter of
the Bosch M_CAN IP core.
Frontend drivers can overwrite this configuration for using a SoC-specific,
external timestamp counter.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Clear the hold flag during the final data interrupt; otherwise the
Transfer Complete interrupt is never asserted.
Signed-off-by: Simon Maurer <mail@maurer.systems>
Switch the Cadence I2C device driver over to the use of the
DEVICE_MMIO_... macros instead of just using the physical base
address from the device tree.
Signed-off-by: Simon Maurer <mail@maurer.systems>
The device is not able to place the entropy into stack or heap allocated
buffers. This uses a bounce buffer to be able to use any buffer with
virtio entropy.
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
The commit c42c8a4da4 (do not invalidate bet at end of loop")
correctly restored the best erase type (bet) selection logic
based on SFDP/JESD216 erase types.
However, this caused a regression
in Octal OPI mode: when bet != NULL, the driver started using bet->cmd
(a standard SPI 1-byte opcode) directly, which is not valid in OPI mode
where the controller expects OPI opcodes (2-byte OCMD).
When bet != NULL:
- In OPI mode, ignore bet->cmd and use the OPI sector erase
opcode SPI_NOR_OCMD_SE.
- In SPI/QPI modes, keep using bet->cmd as intended.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
eswifi_off_enable_dhcp() ignored the return value of eswifi_at_cmd()
and always reported success, making the error check at the call site
always false.
Return the command result to properly propagate failures.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Some internal _CONCAT* macros were used throughout the file. Replace them
with the simple CONCAT macro.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Rework the way to set the STM32 ADC resolution.
Instead of using special macros in device tree, supported resolutions are
now simply listed as an array.
From this array, the driver defines two tables. The first contains the same
values as the array, the second contains the LL macros for each resolution.
When setting the resolution, the driver checks the value with the first
table, then sets it with the second table.
The two tables are defined for each enabled ADC instance so there are no
conflicts if different ADC have different resolutions.
For STM32H7, this changes the internal values used for 14 and 12-bit
resolutions, from 0b101/110 to 0b001/010 respectively, i.e. it uses the
so-called "legacy" resolutions instead of the "power-optimized" ones.
Note that AN5354 indicates: "The optimized modes have better power
consumption figures. The standard modes have better parameters, but
power consumption is not optimized and is comparable to 16-bit mode."
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The esp_data pointer is no longer used after removing the premature
_sock_connect() call. Drop the unused variable.
_sock_connect() call was removed by c368c33.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Add the config to support that warning message time
interval can be set.
We also find that printing all the warning messages
takes about 50ms on Chromebook. Therefore, we increase
the default time to 100ms to leave some time for EC to run
non-print instructions.
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
__eswifi_listen() ignored errors from eswifi_at_cmd() and always
reported success, leaving the local error variable unused.
Return an error when setting the listen backlog fails and avoid
marking the socket as a server in that case.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
so that time-consuming I/O takes place in the background. This is
especially important when writing to multiple long LED strips.
This commit mostly mirrors what was done in the pl022 driver and the
rpi_pico_pio_spi driver, including the needed DT configuration. DMA will be
used if `CONFIG_DMA` is enabled and proper `tx` channel is defined in the
DT.
The DT overlay I used when testing:
```
&pio0 {
status = "okay";
pio-ws2812 {
compatible = "worldsemi,ws2812-rpi_pico-pio";
status = "okay";
pinctrl-0 = <&ws2812_pio0_default>;
pinctrl-names = "default";
bit-waveform = <3>, <3>, <4>;
/* This device has no tx channel configured so DMA will NOT
* be used. */
ws2812_1: ws2812_1 {
status = "okay";
gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
};
/* This device has proper tx channel configured so DMA will
* be used. */
ws2812_2: ws2812_2 {
status = "okay";
gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
chain-length = <64>;
color-mapping = <LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
dmas = <&dma 1 0 0>;
/* DMA slot will be
* determined by the driver so what's in here
* doesn't matter. */
dma-names = "tx";
};
};
};
&dma {
status = "okay";
};
```
Signed-off-by: Terry Geng <terry@terriex.com>
to guarantee two updates to ws2812 happen not faster than the required
reset time of ws2812. Using `k_usleep` forces a context switching, which
might be unnecessary if two time between update calls are not as frequent
as the reset time (which should be the most of the case anyways).
Signed-off-by: Terry Geng <terry@terriex.com>
DWMAC driver was no longer selectable for stm32h7
series because of CONFIG_ETH_DWMAC dependency on
DT_HAS_SNPS_DESIGNWARE_ETHERNET_MMU_ENABLED, which
is only used for MMU based platforms.
Restructure Kconfig to have user-selectable options
for the platform-specific DWMAC drivers and select
the common DWMAC driver accordingly. This way
platform-specific dependencies can be tracked on
these options, simplifying the logic.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Introduces a GPIO driver that provides generic interfaces
for both interrupt-driven inputs and controllable outputs.
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Update the Infineon clock control drivers to support PSoC4 and
enhance error handling.
- Add support for ILO, WCO, and EXT clocks in fixed clock driver.
- Update fixed factor clock driver to handle PSoC4 specific HF
clock source setting and add error checking.
- Update peripheral clock driver to support fractional dividers
- Improve error handling across all updated drivers.
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Reintroduce the assert on put_idx being within the limit in can_mcan_send()
but move it to just after the value was determined and add a comment on its
purpose.
With the current code, this will never get triggered due to the tx_sem
being acquired before (meaning a free TX slot was acquired).
Avoid assigning a signed initial literal to an unassigned type.
Fixes: 8dc4dea112
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
RSR handling is already implemented in pl011_err_check(), which is the
appropriate place to detect, and report receive error conditions.
This also aligns poll_in() behavior with pl011_fifo_read(), which reads
and delivers characters without returning RSR status to the caller.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Add input validation to single-pin GPIO APIs (e.g., gpio_pin_configure)
and emulator-specific helpers to return -EINVAL for invalid pins. This
ensures tests correctly fail when targeting non-existent pins.
For standard port-wide APIs (e.g., gpio_port_set_bits_raw), align behavior
with hardware drivers by masking out invalid pins instead of returning an
error. This mimics hardware behavior where writing to unimplemented bits
is ignored, and ensures compatibility with generic tests that use full
32-bit masks (e.g., 0xFFFFFFFF).
Signed-off-by: Jayvik Desai <jayvik@google.com>
i3c_bus_mode() is duplicated across several drivers. Move it into
i3c_common.c to eliminate that.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Take PLL fractional part into account when computing PLL output rate
for stm32h7xx and stm32h7rs based targets.
Co-authored-by: Tim Pambor <tim.pambor@codewrights.de>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
i2c_burst_write is not portable,
as it is not supported by some drivers,
replace its use with i2c_write.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>