drivers: adc: Update drivers to use devicetree Kconfig symbol

Update adc drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-21 06:43:43 -05:00 committed by Kumar Gala
parent 885087b328
commit d734f273ba
17 changed files with 46 additions and 29 deletions

View file

@ -3,6 +3,8 @@
config ADC_EMUL
bool "ADC emulator"
default y
depends on DT_HAS_ZEPHYR_ADC_EMUL_ENABLED
help
Enable the ADC emulator driver. This is a fake driver in that it
does not talk to real hardware. It pretends to be actual ADC. It

View file

@ -3,12 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0
# Workaround for not being able to have commas in macro arguments
DT_COMPAT_TI_ADS1119_ADC := ti,ads1119
config ADC_ADS1119
bool "Texas instruments ADS1119 I2C"
default $(dt_compat_enabled,$(DT_COMPAT_TI_ADS1119_ADC))
default y
depends on DT_HAS_TI_ADS1119_ENABLED
depends on I2C
select ADC_CONFIGURABLE_INPUTS
help

View file

@ -5,6 +5,12 @@
config ADC_ADS1X1X
bool "ADS1X1X driver"
default y
depends on DT_HAS_TI_ADS1013_ENABLED || DT_HAS_TI_ADS1014_ENABLED || \
DT_HAS_TI_ADS1015_ENABLED || DT_HAS_TI_ADS1113_ENABLED || \
DT_HAS_TI_ADS1114_ENABLED || DT_HAS_TI_ADS1115_ENABLED || \
DT_HAS_TI_ADS1119_ENABLED
depends on I2C
select ADC_CONFIGURABLE_INPUTS
help

View file

@ -3,7 +3,8 @@
config ADC_TELINK_B91
bool "Telink Semiconductor B91 ADC driver"
depends on SOC_RISCV_TELINK_B91
default y
depends on DT_HAS_TELINK_B91_ADC_ENABLED
select ADC_CONFIGURABLE_INPUTS
help
Enables Telink B91 ADC driver.

View file

@ -1,11 +1,9 @@
# Copyright (c) 2021 Pavlo Hamov <pasha.gamov@gmail.com>
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_TI_CC32XX_ADC := ti,cc32xx-adc
config ADC_CC32XX
bool "CC32XX ADC driver"
depends on SOC_SERIES_CC32XX && SOC_FAMILY_TISIMPLELINK
default $(dt_compat_enabled,$(DT_COMPAT_TI_CC32XX_ADC))
default y
depends on DT_HAS_TI_CC32XX_ADC_ENABLED
help
This option enables the CC32XX ADC driver.

View file

@ -3,11 +3,9 @@
# Copyright (c) 2021 BrainCo Inc.
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_GD_GD32_ADC := gd,gd32-adc
config ADC_GD32
bool "GD32 ADC driver"
depends on (SOC_FAMILY_GD32 || SOC_SERIES_GD32VF103)
default $(dt_compat_enabled,$(DT_COMPAT_GD_GD32_ADC))
default y
depends on DT_HAS_GD_GD32_ADC_ENABLED
help
Enable GigaDevice GD32 ADC driver

View file

@ -5,7 +5,8 @@
config ADC_ITE_IT8XXX2
bool "ITE IT8XXX2 ADC driver"
depends on SOC_FAMILY_RISCV_ITE
default y
depends on DT_HAS_ITE_IT8XXX2_ADC_ENABLED
help
This option enables the ADC driver for IT8XXX2
family of processors.

View file

@ -5,6 +5,11 @@
config ADC_LMP90XXX
bool "LMP90xxx driver"
default y
depends on DT_HAS_TI_LMP90077_ENABLED || DT_HAS_TI_LMP90078_ENABLED || \
DT_HAS_TI_LMP90079_ENABLED || DT_HAS_TI_LMP90080_ENABLED || \
DT_HAS_TI_LMP90097_ENABLED || DT_HAS_TI_LMP90098_ENABLED || \
DT_HAS_TI_LMP90099_ENABLED || DT_HAS_TI_LMP90100_ENABLED
depends on SPI
select ADC_CONFIGURABLE_INPUTS
help

View file

@ -5,6 +5,8 @@
config ADC_MCP320X
bool "MCP3204/MCP3208 driver"
default y
depends on DT_HAS_MICROCHIP_MCP3204_ENABLED || DT_HAS_MICROCHIP_MCP3208_ENABLED
depends on SPI
help
Enable MCP3204/MCP3208 ADC driver.

View file

@ -5,27 +5,31 @@
config ADC_MCUX_ADC12
bool "MCUX ADC12 driver"
depends on HAS_MCUX_ADC12
default y
depends on DT_HAS_NXP_KINETIS_ADC12_ENABLED
select PINCTRL
help
Enable the MCUX ADC12 driver.
config ADC_MCUX_ADC16
bool "MCUX ADC16 driver"
depends on HAS_MCUX_ADC16
default y
depends on DT_HAS_NXP_KINETIS_ADC16_ENABLED
select PINCTRL
help
Enable the MCUX ADC16 driver.
config ADC_MCUX_12B1MSPS_SAR
bool "MCUX 12B1MSPS SAR ADC driver"
depends on HAS_MCUX_12B1MSPS_SAR
default y
depends on DT_HAS_NXP_MCUX_12B1MSPS_SAR_ENABLED
help
Enable the MCUX 12B1MSPS SAR ADC driver.
config ADC_MCUX_LPADC
bool "MCUX LPADC driver"
depends on HAS_MCUX_LPADC
default y
depends on DT_HAS_NXP_LPC_LPADC_ENABLED
help
Enable the MCUX LPADC driver.

View file

@ -5,7 +5,8 @@
config ADC_NPCX
bool "Nuvoton NPCX embedded controller (EC) ADC driver"
depends on SOC_FAMILY_NPCX
default y
depends on DT_HAS_NUVOTON_NPCX_ADC_ENABLED
help
This option enables the ADC driver for NPCX family of
processors.

View file

@ -5,8 +5,8 @@
config ADC_NRFX_ADC
bool "nRF ADC nrfx driver"
depends on HAS_HW_NRF_ADC
default y
depends on DT_HAS_NORDIC_NRF_ADC_ENABLED
select NRFX_ADC
select ADC_CONFIGURABLE_INPUTS
help
@ -24,8 +24,8 @@ config ADC_NRFX_ADC_CHANNEL_COUNT
config ADC_NRFX_SAADC
bool "nRF SAADC nrfx driver"
depends on HAS_HW_NRF_SAADC
default y
depends on DT_HAS_NORDIC_NRF_SAADC_ENABLED
select ADC_CONFIGURABLE_INPUTS
help
Enable support for nrfx SAADC driver.

View file

@ -4,7 +4,7 @@
config ADC_SAM0
bool "Atmel SAM0 series ADC Driver"
default y
depends on SOC_FAMILY_SAM0
depends on DT_HAS_ATMEL_SAM0_ADC_ENABLED
select ADC_CONFIGURABLE_INPUTS
help
Enable Atmel SAM0 MCU Family Analog-to-Digital Converter (ADC) driver.

View file

@ -5,7 +5,8 @@
config ADC_SAM_AFEC
bool "SAM ADC Driver"
depends on SOC_FAMILY_SAM
default y
depends on DT_HAS_ATMEL_SAM_AFEC_ENABLED
help
Enable Atmel SAM MCU Family Analog-to-Digital Converter (ADC) driver
based on AFEC module.

View file

@ -8,7 +8,8 @@
config ADC_STM32
bool "STM32 ADC driver"
depends on SOC_FAMILY_STM32
default y
depends on DT_HAS_ST_STM32_ADC_ENABLED
help
Enable the driver implementation for the stm32xx ADC

View file

@ -2,9 +2,8 @@
# Organisation (CSIRO) ABN 41 687 119 230.
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_VND_ADC := vnd,adc
# Hidden option for turning on the dummy driver for vnd,adc devices
# used in testing.
config ADC_TEST
def_bool $(dt_compat_enabled,$(DT_COMPAT_VND_ADC))
def_bool DT_HAS_VND_ADC_ENABLED
depends on DT_HAS_VND_ADC_ENABLED

View file

@ -6,14 +6,14 @@
config ADC_XEC
bool "Microchip XEC series ADC driver"
depends on SOC_SERIES_MEC1501X
default y
depends on DT_HAS_MICROCHIP_XEC_ADC_ENABLED
help
Enable ADC driver for Microchip XEC MCU series.
config ADC_XEC_V2
bool "Microchip XEC series ADC V2 driver"
depends on SOC_SERIES_MEC172X
default y
depends on DT_HAS_MICROCHIP_XEC_ADC_V2_ENABLED
help
Enable ADC driver for Microchip XEC MEC172x MCU series.