From b9c125f64c945629bf6d0de7bd98a275a9ff7eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 19 Oct 2018 14:05:26 +0200 Subject: [PATCH] kconfig: Hide the DesignWare I2C driver on unsupported platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When users are configuring nRF applications they are given the option to enable the DesignWare I2C driver. But they should not be given this option because nRF SoCs do not have DesignWare I2C HW. This commit hides the driver by default by introducing the config option HAS_I2C_DW. Signed-off-by: Sebastian Bøe --- drivers/i2c/Kconfig.dw | 8 +++++++- soc/arc/snps_emsk/Kconfig.soc | 1 + soc/x86/apollo_lake/Kconfig.soc | 1 + soc/x86/intel_quark/quark_x1000/Kconfig.series | 1 + soc/x86/intel_quark/quark_x1000/Kconfig.soc | 1 + soc/xtensa/intel_s1000/Kconfig.soc | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/Kconfig.dw b/drivers/i2c/Kconfig.dw index 0c7b4c74023..0337fb98a70 100644 --- a/drivers/i2c/Kconfig.dw +++ b/drivers/i2c/Kconfig.dw @@ -4,11 +4,17 @@ # SPDX-License-Identifier: Apache-2.0 # +# This option signifies whether DesignWare I2C compatible HW is +# available +config HAS_I2C_DW + bool + menuconfig I2C_DW bool "Design Ware I2C support" select HAS_DTS_I2C + depends on HAS_I2C_DW help - Enable Design Ware I2C support on the selected board + Enable the Design Ware I2C driver if I2C_DW diff --git a/soc/arc/snps_emsk/Kconfig.soc b/soc/arc/snps_emsk/Kconfig.soc index 4e1bf8f9018..d1b89ff5dba 100644 --- a/soc/arc/snps_emsk/Kconfig.soc +++ b/soc/arc/snps_emsk/Kconfig.soc @@ -7,3 +7,4 @@ config SOC_EMSK bool "Synopsys ARC EM Starter Kit SoC" + select HAS_I2C_DW diff --git a/soc/x86/apollo_lake/Kconfig.soc b/soc/x86/apollo_lake/Kconfig.soc index 9b7bf0691dd..dd0bf25c41e 100644 --- a/soc/x86/apollo_lake/Kconfig.soc +++ b/soc/x86/apollo_lake/Kconfig.soc @@ -8,3 +8,4 @@ config SOC_APOLLO_LAKE bool "Intel Apollo Lake Soc" select CPU_APOLLO_LAKE select BOOTLOADER_UNKNOWN + select HAS_I2C_DW diff --git a/soc/x86/intel_quark/quark_x1000/Kconfig.series b/soc/x86/intel_quark/quark_x1000/Kconfig.series index 66524b767c5..0fb7add8407 100644 --- a/soc/x86/intel_quark/quark_x1000/Kconfig.series +++ b/soc/x86/intel_quark/quark_x1000/Kconfig.series @@ -9,5 +9,6 @@ config SOC_SERIES_QUARK_X1000 select SYS_POWER_LOW_POWER_STATE_SUPPORTED select SYS_POWER_DEEP_SLEEP_SUPPORTED select SOC_FAMILY_QUARK + select HAS_I2C_DW help Intel Quark X1000 SoC. diff --git a/soc/x86/intel_quark/quark_x1000/Kconfig.soc b/soc/x86/intel_quark/quark_x1000/Kconfig.soc index 1c044cc2863..295628945e8 100644 --- a/soc/x86/intel_quark/quark_x1000/Kconfig.soc +++ b/soc/x86/intel_quark/quark_x1000/Kconfig.soc @@ -8,6 +8,7 @@ config SOC_QUARK_X1000 select PCI select SYS_POWER_LOW_POWER_STATE_SUPPORTED select SYS_POWER_DEEP_SLEEP_SUPPORTED + select HAS_I2C_DW depends on SOC_SERIES_QUARK_X1000 help Intel Quark X1000 SoC. diff --git a/soc/xtensa/intel_s1000/Kconfig.soc b/soc/xtensa/intel_s1000/Kconfig.soc index 574645f277f..aa90f0d593c 100644 --- a/soc/xtensa/intel_s1000/Kconfig.soc +++ b/soc/xtensa/intel_s1000/Kconfig.soc @@ -3,4 +3,5 @@ config SOC_INTEL_S1000 bool "intel_s1000" + select HAS_I2C_DW