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>
Instead of performing a linear search to determine if a given
thread is running on another CPU, or if it is marked as being
preempted by a metaIRQ on any CPU do this in O(1) time.
On SMP systems, Zephyr already tracks the CPU on which a thread
executes (or lasted executed). This information is leveraged to
do the search in O(1) time.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
BIT_MASK(32) cannot do (1 << 32) - 1 without causing integer overflow.
Hence, for these macros BIT64_MASK(32) is required.
Additionally, remove the unnecessary (and presently unused) macros for the
register space. All of these can be reliably derived from the present
register masks.
Signed-off-by: Amneesh Singh <amneesh@ti.com>
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>
IAR compiler may emit Error[Go004]: Could not inline function
when handling functions marked as always_inline or inline=forced,
especially in complex kernel code
Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
Now that the STM32 ADC resolution property do not use special macros
anymore, these include files can be removed.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Adds bindings for communicating with the MCTP protocol over I3C with IBI
for signaling.
Notably I3C currently requires devices on the bus be struct device's the
way the Nuvoton driver is written and the API is written. So we create a
little glue driver (mctp_i3c_endpoint) to allow us to later bind a aptly
named mctp_i3c_controller MCTP binding.
On the target side the only usable driver for target mode is Nuvoton's.
Nuvoton's driver only implements the optional buffer read/write
callbacks rather than the read/write byte at a time callbacks. This is
actually probably for the better but it does mean this binding requires
those optional target mode functions.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Add clock source definitions for the Infineon PSoC4 series.
This introduces the \`ifx_clock_source_psoc4xx.h\` header with
HFCLK divider macros and integrates it into the board clock
source selection.
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.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>
Without removing this line, I would get a warning (promoted to error) that
the symbol was being redefined in either `net_ip.h` or
`posix/net/if_arp.h`. Actually, `posix/net/if_arp.h` probably should not
exist, but that is part of a separate PR.
Signed-off-by: Chris Friedt <chris@fr4.co>
GPIO hardware in Microchip MEC parts is the same except for the MUX
field (number of alternate functions). We modify the old XEC PINCTRL
driver to work on all MEC parts and also be independent of HAL and
CMSIS register structures. During development we found a DT issue
with DT_ENUM_IDX_OR always inserting the default value. Worked around
by converting slew rate and drive strength to YAML integer type and
created defines for the values in the dt-bindings header.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
csr_write(), csr_set(), and csr_clear() use GNU C statement expressions,
which triggers SonarQube/clang warnings like:
use of GNU statement expression extension from macro expansion
Rewrite these write-only macros as do { ... } while (0) statement macros.
No functional change expected.
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
This commit replaces in the documentation of uart_tx_abort()
function, the generated event type `UART_TX_DONE` with the
correct one: `UART_TX_ABORTED`.
Signed-off-by: Sebastian Panceac <spanceac@gmail.com>
Add reset bindings for I3C peripherals for the STM32MP2 series.
Co-authored-by: Charles Wenger <charles.wenger@savoirfairelinux.com>
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Add clock bindings for I3C peripherals for the STM32MP2 series.
Co-authored-by: Charles Wenger <charles.wenger@savoirfairelinux.com>
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Implement eeprom_target_program() using eeprom_target_write_data() and
eeprom_target_read() using eeprom_target_read_data() to limit redundant
code.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The current functions to access the EEPROM data are not ideal, E.G.:
- eeprom_target_program() is hard coded to write to the beginning of the
EEPROM data
- eeprom_target_read() reads a single byte, so large overhead to read all
data
So as an alternative, add an interface similar to what is provided by
zephyr/drivers/eeprom.h, E.G. functions taking an offset and and length.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
For some use cases it can be interesting to know when the eeprom has been
written to by the I2C host (E.G. once a stop has been received after a
write transaction), so add a "changed" callback.
Multiple EEPROM instances are supported, so pass the device and user data
as arguments to the callback.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The debug/stack.h header uses k_thread types and APIs such as
struct k_thread, k_thread_stack_space_get(), and k_thread_name_get(),
but does not include <zephyr/kernel.h>.
This makes the header rely on transitive includes, which can lead to
build failures depending on include order.
Add an explicit include of <zephyr/kernel.h> to make the header
self-contained.
Signed-off-by: Michele Sardo <msmttchr@gmail.com>
Change at_get_string() return type to 'const char *'. Correspondingly,
change string parameters in HFP HF callbacks and related functions
from 'char *' to 'const char *' to reflect that these strings are
read-only data returned from AT command parsing.
- Update bt_hfp_hf_cb callback signatures for clip, operator,
call_waiting, and textual_representation
- Update at_get_string() return type to 'const char *'
- Update local variables in hfp_hf.c handlers to use 'const char *'
- Update shell callback implementations to match new signatures
- Change NULL check style from '!text' to 'text == NULL' for consistency
- Remove unnecessary initialization of 'number' variable in clcc_handle
This improves const-correctness and prevents accidental modification
of AT command response strings.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a new function, bt_bap_ep_get_conn, which returns
the ACL connection for the endpoint. This works because
endpoints are specific to an ACL in BAP. The function
returns a pointer with a new reference similar to the
lookup functions from conn.h
The conn pointer was not added to the bt_bap_ep_info
struct, as doing so would be more likely to cause
reference leaks if the caller did not care about the
conn pointer when using bt_bap_ep_get_info. It can be
added later if that is requested.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for getting the UCI.
For now the UCI will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the UCI exists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
CS40L5x is a family (CS40L50/51/52/53) of haptics drivers designed
for trackpads, tablets, and automotive applications.
This PR provides basic functionality for ROM features and serves
as a starting point for the upstream driver. Notably, RAM firmware,
SPI, and certain CS40L51/52 features (e.g., diagnostics,
closed-loop algorithms) are excluded from this PR.
Tested with internal/external boost configurations. Tested I2C.
Tested all ROM features with each device variant (50/51/52/53),
including ROM playback, "buzz" playback and configuration, custom
haptics playback and configuration, trigger playback and configuration,
runtime haptics logging, and gain configuration.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Changed the parameter description for _observers in ZBUS_CHAN_DEFINE and
ZBUS_CHAN_DEFINE_WITH_ID. The original description was hard to interpret
and appeared to be split by "@see struct zbus_channel".
Fixed several spelling and grammar issues.
Signed-off-by: Christoffer Gjedsted Brask <cgb@develco.dk>
Similar to how it's done for other driver classes, create a new doxygen
group to put all device-specific DAC API extensions under.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add minimal DT binding headers and matching YAML files for the
Elan em32f967 SoC. The new definitions are required to build the
sample board and follow the upstream style.
Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
Add adxl345_attr_set_range() to allow runtime config.
of the accelerometer's measurement range via the
SENSOR_ATTR_FULL_SCALE attribute.
The function maps the requested range to the nearest supported
ADXL345 range (±2g, ±4g, ±8g, or ±16g) and updates the device
configuration accordingly.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Enable clock for tempsense module in NXP MC CGM driver to
support temperature sensing functionality.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
If api->trylock(dev, id) fails (typically because a cross-core
HW lock is held by another core and returns -EBUSY, or returns
-EINVAL, etc.), the function will immediately return the error
code, but the local ctx->lock is not released, and interrupts
also remain in the locked state from the trylock. This may cause
IRQ lock state leakage. If there's no opportunity in the call path
to reach k_spin_unlock(), the system may exhibit unpredictable
"freeze-like" behavior.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The macro names sys_port_trace_k_fifo_put_slist_enter/exit in
tracing.h were incorrectly named and did not match the corresponding
definitions in backend implementations.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Adds doxygen documentation for the extended API of the Texas Instruments
TLC5971 LED strip controller driver.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Similar to how it's done for other driver classes, create a new doxygen
group to put all device-specific LED strip API extensions under.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This patch introduces a new header file regarding ADC binding with
SiWx91x SoC. It allows a more friendly definition of ADC channel input.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
This adds support for clock_control_get_rate/clock_control_set_rate
API, so that module clock rate can fetch or modify via them in Hz.
Note only CANFD support is added as an reference example and other
module support will be added as-needed.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Previously, the pinctrl macro definitions on the sf32lb platform relied on
manual maintenance, which led to some errors.
We will now use scripts to
generate the metadata, ensuring accuracy
Signed-off-by: Haoran Jiang <halfsweet@halfsweet.cn>