gpio_max14916_config_diag() writes ow_on_en to wrong register
(OW_OFF_EN_REG instead of OW_ON_EN_REG).
Fixed by writing to correct register.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
MAX14906/916 diagnostic helpers handle error propagation differently
across diag_chan_get(), pars_spi_diag(), and reg_trans_spi_diag(). This
creates asymmetry in parser/wrapper flows.
Additionally, the parser overwrites transport errors, obfuscating their
source.
Fixed by aligning helpers to standard errno-style return semantics and
failing fast consistently, propagating nested transport errors.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
Both MAX14906/916 diag_chan_get paths keep previously cached channel fault
values when the corresponding interrupt bits are not set in later calls.
This leaves stale fault data such that diag_chan_get keeps reporting faults
after they have cleared.
Fixed by clearing fault caches before updating them from current interrupt
status.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
Both MAX14906/916 pars_spi_diag paths can lose an captured FAULT1 error
when diag_chan_get() returns 0.
Fixed by only updating the parser return status when diag_chan_get()
returns nonzero.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
max14906_ch_func(), gpio_max14906_config(), and gpio_max14916_config()
ignore return values from lower level register update/write helpers.
This leads to reports of successful pin configuration even when SPI
transactions fail.
Fixed by propagating the first error (effectively forwarding SPI errors)
to the caller, with no behaviour change in success path.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
Several MAX14906/916/915 SPI write paths ignore MAX149xx_REG_WRITE()
return values and proceed silently after SPI write failures.
Fixed by propagating SPI write errors in the affected paths.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
Several MAX14906/916/915 Read/ReadModifyWrite update paths use
MAX149xx_REG_READ() return values directly without validating SPI read
errors first. This leaves SPI read errors unnoticed and corrupts registers
by writing return values unconditionally.
Fixed by early returning on SPI read errors.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
When max149x6_reg_transceive is called with rw=WRITE and rx_diag_buff=NULL,
the SPI diagnostic response byte is returned instead of 0, even though the
write was proper and successful.
Fixed by restricting the offending branch to READ only.
Signed-off-by: Stan Verschuuren <stverschuuren@gmail.com>
This field is not used anywhere and was probably added in error.
Callback registration is done via tcpc_set_alert_handler_cb().
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
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>