From c40ec11ab440ff3ad931e220389a9ea4f57faf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Thu, 28 Jul 2022 13:04:19 +0200 Subject: [PATCH] drivers: dac: update drivers to use devicetree Kconfig symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update dac drivers to use DT_HAS__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 --- drivers/dac/Kconfig.dacx0508 | 3 +++ drivers/dac/Kconfig.dacx3608 | 2 ++ drivers/dac/Kconfig.gd32 | 7 ++----- drivers/dac/Kconfig.mcp4725 | 2 ++ drivers/dac/Kconfig.mcp4728 | 2 ++ drivers/dac/Kconfig.mcux | 6 ++++-- drivers/dac/Kconfig.sam | 7 ++----- drivers/dac/Kconfig.sam0 | 3 ++- drivers/dac/Kconfig.stm32 | 6 ++---- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/dac/Kconfig.dacx0508 b/drivers/dac/Kconfig.dacx0508 index 060e4f4ae62..7e9cb8698ec 100644 --- a/drivers/dac/Kconfig.dacx0508 +++ b/drivers/dac/Kconfig.dacx0508 @@ -6,7 +6,10 @@ config DAC_DACX0508 bool "TI DACx0508 DAC driver" + default y depends on SPI + depends on DT_HAS_TI_DAC60508_ENABLED || DT_HAS_TI_DAC70508_ENABLED || \ + DT_HAS_TI_DAC80508_ENABLED help Enable the driver for the TI DACx0508. diff --git a/drivers/dac/Kconfig.dacx3608 b/drivers/dac/Kconfig.dacx3608 index 1595cdbeaec..3ed3801207b 100644 --- a/drivers/dac/Kconfig.dacx3608 +++ b/drivers/dac/Kconfig.dacx3608 @@ -6,7 +6,9 @@ config DAC_DACX3608 bool "TI DACX3608 DAC driver" + default y depends on I2C + depends on DT_HAS_TI_DAC43608_ENABLED || DT_HAS_TI_DAC53608_ENABLED help Enable the driver for the TI DACX3608. diff --git a/drivers/dac/Kconfig.gd32 b/drivers/dac/Kconfig.gd32 index 62b6574b115..260ecce2849 100644 --- a/drivers/dac/Kconfig.gd32 +++ b/drivers/dac/Kconfig.gd32 @@ -4,12 +4,9 @@ # # 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 bool "GD32 DAC driver" - depends on (SOC_FAMILY_GD32 || SOC_SERIES_GD32VF103) - default $(dt_compat_enabled,$(DT_COMPAT_GD_GD32_DAC)) + default y + depends on DT_HAS_GD_GD32_DAC_ENABLED help Enable GigaDevice GD32 DAC driver diff --git a/drivers/dac/Kconfig.mcp4725 b/drivers/dac/Kconfig.mcp4725 index 87bfdab0507..91b65ae9f3b 100644 --- a/drivers/dac/Kconfig.mcp4725 +++ b/drivers/dac/Kconfig.mcp4725 @@ -6,7 +6,9 @@ config DAC_MCP4725 bool "Microchip MCP4725 DAC driver" + default y depends on I2C + depends on DT_HAS_MICROCHIP_MCP4725_ENABLED help Enable the driver for the Microchip MCP4725. diff --git a/drivers/dac/Kconfig.mcp4728 b/drivers/dac/Kconfig.mcp4728 index 7a796617f18..619bd11461c 100644 --- a/drivers/dac/Kconfig.mcp4728 +++ b/drivers/dac/Kconfig.mcp4728 @@ -4,7 +4,9 @@ config DAC_MCP4728 bool "Microchip MCP4728 DAC driver" + default y depends on I2C + depends on DT_HAS_MICROCHIP_MCP4728_ENABLED help Enable driver for the Microchip MCP4728. diff --git a/drivers/dac/Kconfig.mcux b/drivers/dac/Kconfig.mcux index 21269c717fe..e02d498f505 100644 --- a/drivers/dac/Kconfig.mcux +++ b/drivers/dac/Kconfig.mcux @@ -6,13 +6,15 @@ config DAC_MCUX_DAC bool "NXP Kinetis MCUX DAC driver" - depends on HAS_MCUX_DAC + default y + depends on DT_HAS_NXP_KINETIS_DAC_ENABLED help Enable the driver for the NXP Kinetis MCUX DAC. config DAC_MCUX_DAC32 bool "NXP Kinetis MCUX DAC32 driver" - depends on HAS_MCUX_DAC32 + default y + depends on DT_HAS_NXP_KINETIS_DAC32_ENABLED select PINCTRL help Enable the driver for the NXP Kinetis MCUX DAC32. diff --git a/drivers/dac/Kconfig.sam b/drivers/dac/Kconfig.sam index 562b8760dc5..e3328af8d15 100644 --- a/drivers/dac/Kconfig.sam +++ b/drivers/dac/Kconfig.sam @@ -2,12 +2,9 @@ # 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 bool "Atmel SAM DAC driver" - default $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_DAC)) - depends on SOC_FAMILY_SAM + default y + depends on DT_HAS_ATMEL_SAM_DAC_ENABLED help Enable Atmel SAM MCU Family Digital Audio Converter (DAC) driver. diff --git a/drivers/dac/Kconfig.sam0 b/drivers/dac/Kconfig.sam0 index 579f987a8b5..1f018ab5821 100644 --- a/drivers/dac/Kconfig.sam0 +++ b/drivers/dac/Kconfig.sam0 @@ -3,6 +3,7 @@ config DAC_SAM0 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 Enables the Atmel SAM0 MCU Family Digital-to-Analog (DAC) driver. diff --git a/drivers/dac/Kconfig.stm32 b/drivers/dac/Kconfig.stm32 index f718bb9e96c..d045dc95308 100644 --- a/drivers/dac/Kconfig.stm32 +++ b/drivers/dac/Kconfig.stm32 @@ -4,11 +4,9 @@ # # 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 bool "STM32 DAC driver" - default $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_DAC)) + default y + depends on DT_HAS_ST_STM32_DAC_ENABLED help Enable the driver implementation for the stm32xx DAC