Commit graph

947 commits

Author SHA1 Message Date
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Zhaoxiang Jin
74f6827c32 drivers: adc: mcux_lpadc: Add device PM Action suppport
Add device PM Action suppport for lpadc driver.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-13 07:09:22 +01:00
Zhaoxiang Jin
af3bfc6084 drivers: adc: mcux_lpadc: Add support for PM policy device constraints
Add support for PM policy device constraints to the MCUX LPADC driver.
This allows the driver to specify that certain power states should be
disabled when the device is active, which can help ensure proper operation
and reduce power consumption.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-13 07:09:22 +01:00
Zhaoxiang Jin
d6168d4d3e drivers: adc: add shell commands for ADC emulator
Add shell commands for the ADC emulator driver (zephyr,adc-emul) to
allow runtime configuration of emulated ADC values during testing and
development.

The new shell commands support:
- Setting constant raw ADC codes for a channel
- Setting constant input voltage in millivolts for a channel

Commands are dynamically populated with available ADC emulator devices
from the devicetree. This enables interactive testing of ADC-dependent
code without requiring physical hardware or signal generators.

Example usage:
  adc_emul <device> raw <channel> <value>
  adc_emul <device> mv <channel> <millivolts>

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-09 11:05:50 +01:00
Zhaoxiang Jin
8f1dfd5fb3 drivers: adc: emul: allow differential mode with warning
Change the ADC emulator driver to accept differential mode configuration
instead of rejecting it with -ENOTSUP. When differential mode is requested,
the driver now logs a warning that samples are provided as raw codes and
continues operation.

This allows testing of ADC configurations that use differential mode
without requiring the emulator to implement full differential conversion
logic. The raw code values can still be set via shell commands or API
calls for testing purposes.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-09 11:05:50 +01:00
Albort Xue
d40e921228 drivers: add: mcux_lpadc: Add clock configuration and enable
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>
2026-03-05 04:38:52 +01:00
Noah Stephens
eb68e58579 drivers: adc: ad7124: added support for pd-switch-enable
Added support for the low side power switch pin used for switching
DUTs attached to the ADC. The switch is configured though the
drivers device tree.

Signed-off-by: Noah Stephens <nstephens78@gmail.com>
2026-02-24 16:01:43 -06:00
Camille BAUD
e1bf32d7d1 drivers: adc: fix Infineon SAR PR removing bflb adc
Please check your rebases
Fixes deletion of driver unrelated to PR.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-02-20 21:54:38 -08:00
Braeden Lane
2d650bbf54 drivers: adc: Add Infineon SAR ADC driver
Add driver for the Infineon SAR ADC peripheral with device tree
binding. The driver uses a generic compatible (infineon,sar-adc)
with an infineon,version property to differentiate IP block
revisions (v2, v3). Features include:

- Single-ended and differential channel configuration
- Configurable resolution (8-12 bits)
- Multiple voltage reference sources (internal, VDDA, VDDA/2, external)
- Channel reference validation against block-level vref-src
- Hardware compensation for SAR v2/v3 single-ended channel limitation
- Interrupt-driven conversion completion
- Integration with peripheral clock control

The driver includes a compile-time per-instance API structure to
correctly report reference voltage to the ADC framework for accurate
raw-to-millivolts conversion.

Tested on CY8CKIT-041S-MAX (SAR v2) and CY8CPROTO-041TP (SAR v3) boards.

Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
Co-authored-by: Deepika R <deepika@aerlync.com>
Co-authored-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-20 07:08:02 +01:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Fin Maaß
772aa8da66 adc: ads1x1x: only use configurable inputs when needed
only use configurable inputs when needed for that device.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-12 20:03:53 +01:00
Farsin Nasar V A
bf76eddd6f drivers: adc: microchip: Update ADC G1 driver for PIC32CX_SG
Update ADC G1 driver implementation to support PIC32CX_SG

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-02-12 14:29:09 +00:00
Pieter De Gendt
fa719f5aa7 drivers: adc: infineon_autanlog_sar: Put API into iterable section
Use the DEVICE_API wrapper to put the driver API into the correct linker
section.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-10 22:19:45 +01:00
Fin Maaß
517bffdb84 adc: ads1x1x: remove DT_HAS_TI_ADS1119_ENABLED
the ads1119 has its own driver connected to CONFIG_ADC_ADS1119,
so remove it from CONFIG_ADC_ADS1X1X. Also the driver under
CONFIG_ADC_ADS1X1X doesn't support it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-09 16:13:53 -06:00
Martin Martincek
798d02e4ba drivers: adc: mcux_lpadc: Invalid Adc 12-bit resolution measurement
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>
2026-02-05 16:55:45 +01:00
Benjamin Cabé
3cdf9f1846 drivers: adc: use proper essential type in boolean variables assignments
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>
2026-02-05 10:20:22 +00:00
Hoang Nguyen
89ad77fc52 drivers: adc: renesas: Initialize p_reg in extended configuration
Initialize p_reg with the register base address from devicetree.

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-02-03 09:29:36 +01:00
James Walmsley
069141e487 drivers: adc: ads79xx: implement adc driver for ti-ads79xx
Initial implementation of an adc driver for the ads79xx series of
spi-adc chips.

This driver sets the device in auto-1 mode, and supports devices
in the series, with different resolutions (12/10/8-bit),
and number of channels.

Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
2026-02-02 12:56:29 +01:00
Zhaoxiang Jin
f3fc221f35 drivers: adc: mcux_lpadc: fix offset calibration and type casting
Fix offset calibration handling and improve type safety in the
LPADC driver:
- Change offset_a and offset_b from uint32_t to int16_t to match HAL API.
- Add explicit int16_t casts when initializing offset values from DT.
- Add conditional logic to handle platforms with single offset trim.
- Use LPADC_SetOffsetValue() with appropriate parameters based on
  FSL_FEATURE_LPADC_OFSTRIM_COUNT when auto-calibration is disabled.

This ensures proper offset calibration on all supported platforms and
prevents potential type mismatch issues.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-29 17:19:38 +01:00
Zhaoxiang Jin
6b18307011 drivers: adc: mcux_lpadc: fix code formatting and indentation
Fix inconsistent formatting in the LPADC driver by:
- Consolidating multi-line preprocessor conditionals onto single lines
- Aligning macro continuation backslashes consistently
- Fixing indentation in structure initialization and macro definitions
- Removing unnecessary line breaks in function calls

No functional changes, formatting cleanup only.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-29 17:19:38 +01:00
Amneesh Singh
138d2bdc31 drivers: adc: adc_ti_am335x: fix register MMIO mapping
Bind registers to the local variable in the ti_adc_init() function
after mapping the address space via DEVICE_MMIO_MAP.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Amneesh Singh
8134b3b4e8 drivers: adc: adc_ti_am335x: add support for pinctrl
Support configuration of pins for ADC channels in the driver.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Amneesh Singh
267e3f39fc drivers: adc: ti_am335x: make internal reference optional
Allow using other references by removing the hard requirement on it being
internal. To be able to use internal voltage, the DT property ti,vrefp can
be used, otherwise it is ignored.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-29 13:44:20 +01:00
Gaetan Perrot
f12de94f3e drivers: adc: adc_npcx: fix typos in log and comments
Fix spelling and wording issues in log and comments.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-29 13:40:41 +01:00
Phuc Pham
957929d634 drivers: adc: Add ADC support for Renesas RZ V2H, V2N
Add ADC driver support for Renesas RZ V2H, V2N

Signed-off-by: Phuc Pham <phuc.pham.xr@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2026-01-29 09:04:01 +01:00
Jérôme Pouiller
a78cd3464e drivers: adc: siwx91x: Fix use of RSI_ADC_ClkDivfactor()
RSI_ADC_ClkDivfactor() is called from system clock_control. But in fact, it
controls the internal division factor of the ADC hardware block.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-01-26 14:16:31 +01:00
Jérôme Pouiller
e2f4fc15af drivers: adc: siwx91x: Fix use of ADC_CONTEXT_USES_KERNEL_TIMER
ADC_CONTEXT_USES_KERNEL_TIMER is required for ADC_CONTEXT_INIT_TIMER().
However, it should be defined in the Zephry driver, not in the Wiseconnect
integration.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-01-26 14:16:31 +01:00
Camille BAUD
bddaa08afd drivers: adc: add bflb adc driver
Adds a driver for the GPADC

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-01-22 14:01:57 +00:00
Gaetan Perrot
0f046ac0de drivers: adc: adc_ambiq: check return value of adc power control
Handle the return value of am_hal_adc_power_control() during ADC
initialization.

The previous code overwrote the return value before it was checked,
which could silently ignore failures when powering on the ADC.

Fix this by validating the return code and propagating an error if
the operation fails.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-22 08:40:37 +00:00
Henrik Lindblom
79e9b72534 drivers: adc: ads1x4s0x: configure reference buffers
Configure the reference buffers when using external reference voltage for a
channel. For the internal reference the datasheet[1] recommends that the
buffers are disabled and for external references they should be disabled if
REFPx/REFNx is close to AVDD/AVSS. After reset the positive reference
buffer is enabled and the negative is disabled. The default values
correspond to the example circuit for a two-wire and four-wire PT100 RTD
measurement with low-side reference.[2][3]

The values configured by the driver are maybe a little opinionated, but the
current behaviour is kept to avoid surprises for people that are happy with
the drivers defaults.

The change applies to both ads11xs0x and ads124xs0x series.

Link: [1]: https://www.ti.com/lit/ds/symlink/ads124s08.pdf
Link: [2]: https://www.ti.com/lit/an/sbaa329b/sbaa329b.pdf
Link: [3]: https://www.ti.com/lit/an/sbaa336b/sbaa336b.pdf

Signed-off-by: Henrik Lindblom <henrik.lindblom@vaisala.com>
2026-01-18 10:30:42 +01:00
Zhaoxiang Jin
ab16cca665 drivers: adc: nxp_sar_adc: Add compatibility for SoCs without ADCLKSEL
Some NXP SAR ADC variants don't implement the MCR[ADCLKSEL] field.
Add conditional compilation guards to define compatibility macros
that evaluate to 0 when ADCLKSEL is not available, allowing the
driver to compile across different NXP SoCs.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-16 11:41:16 +00:00
Benedek Kupper
12cd3703eb drivers: adc: stm32: only set CR2/DMA bit once on STM32F1
As reported in #101190, running adc_sequence sample on stm32f103c8 with 8
ADC channels causes all subsequent conversions after the first to be one
channel shifted. This is because writing to CR2 with ADON=1 and no other
changes triggers a conversion (which is why the bug happens on all
but the first sequence). Adding this check will ensure that CR2 is only
written when the DMA bit changes.

Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>
2026-01-13 15:21:05 +01:00
Phuc Pham
1eec5dae9f drivers: adc: Add ADC support for Renesas RZ/A2M
Add ADC driver support for Renesas RZ/A2M

Signed-off-by: Phuc Pham <phuc.pham.xr@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2026-01-12 11:53:36 +01:00
Guillaume Gautier
c81e2f70fe drivers: adc: stm32: clean up concat macros
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>
2026-01-08 11:55:35 +00:00
Guillaume Gautier
717d7e8ee0 drivers: adc: stm32: resolution rework
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>
2026-01-08 11:55:35 +00:00
Qingsong Gou
f0099a0d49 drivers: adc: sf32lb: fix adc sequence
Fix adc sequence for for sf32lb

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-07 12:31:36 +01:00
Qingsong Gou
5acd482724 drivers: adc: sf32lb: fix adc_async build warnings
Fix adc_async build warnings

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-07 12:31:36 +01:00
Qingsong Gou
dac3f66622 drivers: adc: sf32lb: fix coding style
Fix coding style for sf32lb

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-07 12:31:36 +01:00
Qingsong Gou
2da9089ae4 drivers: adc: sf32lb: fix adc value not correct
Fix adc value not correct

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-07 12:31:36 +01:00
Zhaoxiang Jin
8e92b5b851 drivers: adc: nxp_sar_adc: implement async read function
Enabled async read function for NXP SAR ADC driver by implementing
nxp_sar_adc_read_async() and modifying nxp_sar_adc_read() to call it
with a NULL signal for synchronous operation.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-07 07:49:49 +01:00
Zhaoxiang Jin
096dbbf8d2 drivers: adc: Adding DMA transfer capability to LPADC
Adding DMA transfer capability to LPADC

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-07 07:49:16 +01:00
Gaetan Perrot
4bec0387c8 drivers: adc: adc_stm32: make set_sequencer void
set_sequencer() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-07 07:45:01 +01:00
Abderrahmane JARMOUNI
6d9ded6651 drivers: adc: silabs IADC: replace 'depends on DMA' with 'select'
When a driver requires the usage of a low level driver subsystem
(like SPI, I2C, DMA...), it shall enable it instead of depending on it.
Also, make DMA usage depend on its DT properties being defined.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2026-01-02 16:01:31 +00:00
Ha Duong Quang
63c052c4cf drivers: adc: add support for s32k5
Add two new definitions, ADC_SAR_IP_HW_REG_SIZE and
ADC_SAR_IP_CHAN_2_BIT, to eliminate the inclusion of
Adc_Sar_Ip_HwAccess.h, since this header file does not
exist for the S32K5 platform.

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2026-01-01 21:28:46 +01:00
Zhaoxiang Jin
e7d24c8088 drivers: adc: add clock frequency selection for SAR ADC
This commit enhances the SAR ADC driver by adding
support for clock frequency selection. The clock
frequency can now be configured via the devicetree,
allowing for better optimization of ADC performance
based on application requirements.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-31 10:58:50 +00:00
Arunprasath P
e767aa498a drivers: adc: microchip: Introduce G1 ADC Driver
Add a Zephyr ADC driver for the Microchip G1 ADC peripheral
with support for differential mode, multi-channel sequencing,
oversampling, and NVM-based factory calibration.

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2025-12-26 10:13:30 -06:00
Zhaoxiang Jin
ea8e8b7d53 drivers: adc: refactor mcux_sar_adc to nxp_sar_adc
Zephyr's current ADC API only supports 32 logical channels,
which is inadequate for SAR ADCs on certain SoCs. For instance,
the ADC on the MCXE31B has 64 hardware channels. The previous
implementation used a one-to-one mapping between logical and
hardware channels. In the new SAR ADC driver version, we bind
hardware channels to logical channels via the zephyr,input-positive
property, enabling us to access any channel.

Currently, only imx93 uses this ADC. To maintain the bisectability
of Zephyr commits, in this commit we will also modify the imx93-related
files, inlcuding:
1. Update the clock_control_mcux_ccm_rev2.c to use the new Kconfig
option 'CONFIG_ADC_NXP_SAR_ADC'.
2. Add properties to the imx93_evk_mimx9352_m33.overlay of the adc_api
testcase.

Now the sar adc is native driver, so, remove
CONFIG_MCUX_COMPONENT_driver.sar_adc from the glue cmake.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-24 12:48:46 -05:00
Qingsong Gou
ccdc0c3007 drivers: adc: sf32lb: add adc read_async support
Add adc read_async support for sf32lb

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-12-18 12:06:33 +01:00
Sreeram Tatapudi
0a06f5b91a dts: bindings: Drop cat1 from the infineon binding files
Drop cat1 from the binding files to enable reuse by other
category devices as well.

Fixes #99174

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-17 13:58:09 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00