The vconn_en and vconn_discharge callbacks were invoked with the TCPC
device as the first argument. Application callbacks then called
usbc_get_dpm_data(dev) with the TCPC device, causing dev->data (which
is struct tcpc_data *) to be misinterpreted as struct usbc_port_data *.
This resulted in dpm_data->vconn_pol being written to an incorrect
memory offset, silently corrupting TCPC driver state.
Fix by adding a const struct device *usbc_dev parameter to
tcpc_vconn_control_cb_t and tcpc_vconn_discharge_cb_t, and propagating
it through set_vconn_cb and set_vconn_discharge_cb in the driver API.
Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
All trigger related variables will be defined only if pinctrl has name
`trigger`. This can save some RAM when having multiple hx711 configured
but only using trigger for some of them.
Signed-off-by: Terry Geng <terry@terriex.com>
HX711 pulls DOUT low when data is ready. This commit enabled pin config
to switch from SPI to GPIO and set up GPIIO interrupts for the falling
edge.
The implementation is similar to the `infineon,airoc-wifi` driver, by
using pinctrl.
Signed-off-by: Terry Geng <terry@terriex.com>
HX711 is a specialized 24-bit ADC for load cell and strain gauge sensors.
It uses a two-wire (PD_SCK and DOUT) serial protocol that
- first 24 clock cycles reads out the sample
- last 1 to 3 clock cycles set the PGA gain for the next sample
The requirement of control the exact number of clock cycles makes the
SCK for SPI unsuitable for clocking HX711. Instead, in this commit, the
clock is implemented as a series of 0xAA on the MOSI.
Signed-off-by: Terry Geng <terry@terriex.com>
Function udc_buf_get_all() was intended to be a helper to remove all
requests from endpoint FIFO. While for just freeing all queue the
it may be argued that there may be some doubtful simplicity argument,
merging multiple submitted transfers into one is just enforcing
unnecessary complexity on class implementations.
At general level, every submitted (enqueued) request should get
corresponding completion (request callback) call. UDC drivers were
violating this sensible behavior when dequeuing (cancelling) requests by
merging all submitted requests into one.
Remove udc_buf_get_all() and replace all uses with simple loops. For
most classes (that submit just one request for an endpoint at a time)
this has no functional difference. For classes that implement double
buffering this simplifies completion handling.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Update gpio_set_drive_capability() to new gpio_ll_set_drive_capability()
as part of the hal_espressif updates.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Extend the STM32 VREFBUF regulator driver to support STM32WB devices.
Update the st,stm32-vrefbuf devicetree binding and add the VREFBUF
node to the STM32WB SoC dtsi so that applications can enable the
internal reference buffer on STM32WB.
Signed-off-by: Lubos Koudelka <lubos.koudelka@st.com>
Implement a MAX32 mbox driver with the semaphore peripheral.
Tweak the mbox test to allow testing with only one TX/RX channel pair
available.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Add a USB 2.0 Full-Speed device controller driver (udc_bflb) for the
Bouffalo Lab BL70x SoC family. The driver supports up to 8 bidirectional
endpoints with interrupt-driven operation.
Signed-off-by: William Markezana <william.markezana@gmail.com>
- replace legacy Kconfigs with corresponding PSA_WANT ones.
- extend Mbed TLS' CMake file in order to include these legacy ecdh module
that was removed from TF-PSA-Crypto when ESP32 BT and WiFi drivers are
built.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Add Power Management Subsystem to ADT7420 driver for
suspending and resuming device operations.
Signed-off-by: Jan Carlo Roleda <jancarlo.roleda@analog.com>
Extended ADT7420 driver to support:
- extend dtbindings for comprehensive configuration control
- Support 13-bit and 16-bit ADC resolution
- extend Sensor API support
- extend interrupt support to include CT pin
Signed-off-by: Jan Carlo Roleda <jancarlo.roleda@analog.com>
Fix I2C transaction len using the correct size of the data to be sent
and not the returned length of the allocated buffer. This change is
applied to iis3dwb, lis2dux12 and lsm6dsv16x drivers, and mimic what
is also done for lsm6dsvxxx driver.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Perform iosync configuration in the common stm32_gpioport_configure_pin()
function instead of doing it from the pinctrl driver. This simplifies the
pinctrl driver and also opens the door to iosync configuration using the
GPIO API (via vendor-specific extensions) in the future.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add parameter checking of in functions video_closest_frmival
and video_closest_frmival_stepwise and return an error in
case of invalid parameter.
Previously ASSERT were used, but thoses are not always enabled,
leading to possibility to have invalid parameter being used.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
ASSERT are not always enabled, leading to not catching
invalid arguments in situation where it is not enabled.
Replace all ASSERT statement with argument check, properly
returning error instead of accessing invalid addresses.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
ASSERT aren't always enabled hence add return value in
video_auto_cluster_ctrl and video_cluster_ctrl functions
in order to avoid accessing invalid parameter and return
an error.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Nordic's nPM10 Series PMIC Sensor Devicetree bindings and minimal driver
supporting only battery current, voltage and temperature measurements.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Adds CAN driver for Infineon devices using the Bosch M_CAN IP core. The
driver is structured using a parent-child architecture to match the
Infineon hardware implementation:
- Parent (infineon,canfd-controller): Manages Shared MRAM
initialization, enables controller level timestamp-counter and ECC.
- Child (infineon,can): Individual CAN channel initialization.
Configures pinctrl, peripheral clock assignment, MRAM configuration,
and interrupts. Remaining initialization is handled by can_mcan.
This driver was originally written by Karthikeyan Krishnasamy
<karthikeyan@linumiz.com> in PR#101930. Clocking updates and CAN
controller wrapper were added by John Batch.
Co-authored-by: John Batch <john.batch@infineon.com>
Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
Signed-off-by: John Batch <john.batch@infineon.com>
Remove the duplicated ifx_cat1_get_hfclk_for_peri_group() function and
replace with the version from the clock_control header.
Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: John Batch <john.batch@infineon.com>
Remove the duplicated ifx_cat1_get_hfclk_for_peri_group() function and
use version from shared header file.
Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: John Batch <john.batch@infineon.com>
Add a regulator driver for the internal general-purpose LDO channels
found in some Espressif SoCs. These LDO channels can supply power to
internal and external peripherals such as SPI flash and PSRAM.
The driver supports:
- Enable/disable LDO output channels
- Continuously adjustable voltage from 500mV to 2700mV
- Rail bypass mode at 3300mV
- Standard regulator device tree properties (boot-on, always-on, etc.)
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
start rx and link status thread in iface init,
as only then the iface pointer in the data
struct is set.
ALso simplify link status update logic.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Implement a device driver for XSPI manager.
This allows to define the xspi controllers configuration that should
be applied towards the xspi IO ports:
- Muxed
- Swapped
- ...
Since its configuration has impact on final application location and
implies the deactivation of xspi clocks, it should be run only at fsbl
stage and not later.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
There is no such thing as XSPIM1/XSPIM2 and not all XSPIM compatible
devices declare HAL_XSPIM_IOPORT_1/2.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
If user selects a band, then we should restrict scanning channels to
that band. This can be used to speed up scanning by limiting scans
to specific channels when the network is known to not use all possible
channels.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
The low RX FIFO threshold of 1 could lead to issues during higher baud
rates, thus the threshold is increased and the RX Timeout feature on the
MSPM0 is introduced.
Signed-off-by: Jackson Farley <j-farley@ti.com>
The isr implementation would clear pending interrupts that had fired
since the first check for pending interrupts, leading to missed events.
This PR amends that issue and fixes typos in comparing IIDX types rather
than bitmasks to explicit comparisons
Signed-off-by: Jackson Farley <j-farley@ti.com>
Currently, PINCTRL_IMX_SCMI depends on the SCMI stack being enabled and
the existence of the pinctrl protocol node. This, by itself, is not enough
since this condition can be met by any vendor wanting to use the pinctrl
protocol. Thus, the IMX SCMI pinctrl driver will end up being selected for
other vendors as well, which is not correct.
Fix this by adding a dependency on the IMX-specific pinctrl child being
present. By doing this, the driver will remain auto-selected.
Fixes#105673.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The driver implements the QEMU ramfb as a framebuffer-based display.
It only implements the basic capabilities necessary (ARGB8888) with
resolution configurable via DTS. For initialization it uses the fwcfg
driver.
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
Fixes the no-mt test at tests/arch/riscv/pmp/isr-stack-guard
by making the driver work without MULTITHREADING primitives
if they are disabled.
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
Add video_import_buffer() API and necessary changes to support buffers
allocated from outside, not from the video heap.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Currently, the video_enqueue() API enqueues the whole external video
buffer container structure from the application and the driver stores
this container in its FIFO queue.
While it works in simple applications where the enqueued video_buffer
container persists for the whole program lifecycle, it does not work in
situations where we cannot keep this container, e.g. enqueuing a buffer
inside a function, the local variable will be destroyed when the function
returns and hence the buffer is no longer valid.
Video buffers can be tracked via their indices in the buffer pool.
Set the index field when buffers are allocated and enqueue the internal
buffer rather than the external one to fix the issue.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
PM suspend operation cannot be performed for UART using asynchronous
API is there are any active operations. Instead of asserting return
error.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
1. Keep drivers/timer/cortex_m_systick.h as a compatibility
shim for legacy Cortex-M-specific names.
2. Switch to use the generic low-power companion timer API
for the Cortex-M SysTick driver.
3. Mark the global CORTEX_M_SYSTICK_LPM_* kconfig options
as 'DEPRECATED' and replace them with SYSTEM_TIMER_LPM_*
4. Rename 'zephyr,cortex-m-idle-timer' to
'zephyr,system-timer-companion'
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The supported pixel formats are the most important thing in
get_capabilities() but not reported. Fix it.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>