drivers: dac: update drivers to use devicetree Kconfig symbol

Update dac 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: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2022-07-28 13:04:19 +02:00 committed by Carles Cufí
parent e1e366c912
commit c40ec11ab4
9 changed files with 21 additions and 17 deletions

View file

@ -6,7 +6,10 @@
config DAC_DACX0508 config DAC_DACX0508
bool "TI DACx0508 DAC driver" bool "TI DACx0508 DAC driver"
default y
depends on SPI depends on SPI
depends on DT_HAS_TI_DAC60508_ENABLED || DT_HAS_TI_DAC70508_ENABLED || \
DT_HAS_TI_DAC80508_ENABLED
help help
Enable the driver for the TI DACx0508. Enable the driver for the TI DACx0508.

View file

@ -6,7 +6,9 @@
config DAC_DACX3608 config DAC_DACX3608
bool "TI DACX3608 DAC driver" bool "TI DACX3608 DAC driver"
default y
depends on I2C depends on I2C
depends on DT_HAS_TI_DAC43608_ENABLED || DT_HAS_TI_DAC53608_ENABLED
help help
Enable the driver for the TI DACX3608. Enable the driver for the TI DACX3608.

View file

@ -4,12 +4,9 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Workaround for not being able to have commas in macro arguments
DT_COMPAT_GD_GD32_DAC := gd,gd32-dac
config DAC_GD32 config DAC_GD32
bool "GD32 DAC driver" bool "GD32 DAC driver"
depends on (SOC_FAMILY_GD32 || SOC_SERIES_GD32VF103) default y
default $(dt_compat_enabled,$(DT_COMPAT_GD_GD32_DAC)) depends on DT_HAS_GD_GD32_DAC_ENABLED
help help
Enable GigaDevice GD32 DAC driver Enable GigaDevice GD32 DAC driver

View file

@ -6,7 +6,9 @@
config DAC_MCP4725 config DAC_MCP4725
bool "Microchip MCP4725 DAC driver" bool "Microchip MCP4725 DAC driver"
default y
depends on I2C depends on I2C
depends on DT_HAS_MICROCHIP_MCP4725_ENABLED
help help
Enable the driver for the Microchip MCP4725. Enable the driver for the Microchip MCP4725.

View file

@ -4,7 +4,9 @@
config DAC_MCP4728 config DAC_MCP4728
bool "Microchip MCP4728 DAC driver" bool "Microchip MCP4728 DAC driver"
default y
depends on I2C depends on I2C
depends on DT_HAS_MICROCHIP_MCP4728_ENABLED
help help
Enable driver for the Microchip MCP4728. Enable driver for the Microchip MCP4728.

View file

@ -6,13 +6,15 @@
config DAC_MCUX_DAC config DAC_MCUX_DAC
bool "NXP Kinetis MCUX DAC driver" bool "NXP Kinetis MCUX DAC driver"
depends on HAS_MCUX_DAC default y
depends on DT_HAS_NXP_KINETIS_DAC_ENABLED
help help
Enable the driver for the NXP Kinetis MCUX DAC. Enable the driver for the NXP Kinetis MCUX DAC.
config DAC_MCUX_DAC32 config DAC_MCUX_DAC32
bool "NXP Kinetis MCUX DAC32 driver" bool "NXP Kinetis MCUX DAC32 driver"
depends on HAS_MCUX_DAC32 default y
depends on DT_HAS_NXP_KINETIS_DAC32_ENABLED
select PINCTRL select PINCTRL
help help
Enable the driver for the NXP Kinetis MCUX DAC32. Enable the driver for the NXP Kinetis MCUX DAC32.

View file

@ -2,12 +2,9 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
# Workaround for not being able to have commas in macro arguments
DT_COMPAT_ATMEL_SAM_DAC := atmel,sam-dac
config DAC_SAM config DAC_SAM
bool "Atmel SAM DAC driver" bool "Atmel SAM DAC driver"
default $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_DAC)) default y
depends on SOC_FAMILY_SAM depends on DT_HAS_ATMEL_SAM_DAC_ENABLED
help help
Enable Atmel SAM MCU Family Digital Audio Converter (DAC) driver. Enable Atmel SAM MCU Family Digital Audio Converter (DAC) driver.

View file

@ -3,6 +3,7 @@
config DAC_SAM0 config DAC_SAM0
bool "Atmel SAM0 series DAC Driver" bool "Atmel SAM0 series DAC Driver"
depends on SOC_SERIES_SAMD20 || SOC_SERIES_SAMD21 default y
depends on DT_HAS_ATMEL_SAM0_DAC_ENABLED
help help
Enables the Atmel SAM0 MCU Family Digital-to-Analog (DAC) driver. Enables the Atmel SAM0 MCU Family Digital-to-Analog (DAC) driver.

View file

@ -4,11 +4,9 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Workaround for not being able to have commas in macro arguments
DT_COMPAT_ST_STM32_DAC := st,stm32-dac
config DAC_STM32 config DAC_STM32
bool "STM32 DAC driver" bool "STM32 DAC driver"
default $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_DAC)) default y
depends on DT_HAS_ST_STM32_DAC_ENABLED
help help
Enable the driver implementation for the stm32xx DAC Enable the driver implementation for the stm32xx DAC