From bda645523410597a020ba24ffcf5ce9b94f9ee07 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Thu, 21 Jul 2022 11:07:28 +0200 Subject: [PATCH] drivers: eeprom: Update drivers to use devicetree Kconfig symbol Update EEPROM drivers to use DT_HAS__ENABLED Kconfig symbol to expose the driver and enable it by default based on devicetree. Signed-off-by: Henrik Brix Andersen --- drivers/eeprom/Kconfig | 6 ++++++ drivers/eeprom/Kconfig.eeprom_emu | 2 ++ drivers/eeprom/Kconfig.lpc11u6x | 2 +- drivers/eeprom/Kconfig.stm32 | 2 +- drivers/eeprom/Kconfig.tmp116 | 3 ++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/eeprom/Kconfig b/drivers/eeprom/Kconfig index cfa648886c..3114f254c8 100644 --- a/drivers/eeprom/Kconfig +++ b/drivers/eeprom/Kconfig @@ -43,6 +43,8 @@ config EEPROM_AT2X config EEPROM_AT24 bool "Atmel AT24 (and compatible) I2C EEPROM support" + default y + depends on DT_HAS_ATMEL_AT24_ENABLED depends on I2C select EEPROM_AT2X help @@ -50,6 +52,8 @@ config EEPROM_AT24 config EEPROM_AT25 bool "Atmel AT25 (and compatible) SPI EEPROM support" + default y + depends on DT_HAS_ATMEL_AT25_ENABLED depends on SPI select EEPROM_AT2X help @@ -62,6 +66,8 @@ source "drivers/eeprom/Kconfig.tmp116" config EEPROM_SIMULATOR bool "Simulated EEPROM driver" + default y + depends on DT_HAS_ZEPHYR_SIM_EEPROM_ENABLED select STATS select STATS_NAMES help diff --git a/drivers/eeprom/Kconfig.eeprom_emu b/drivers/eeprom/Kconfig.eeprom_emu index f956315e6a..f3f213b55e 100644 --- a/drivers/eeprom/Kconfig.eeprom_emu +++ b/drivers/eeprom/Kconfig.eeprom_emu @@ -3,6 +3,8 @@ config EEPROM_EMULATOR bool "Emulated EEPROM driver" + default y + depends on DT_HAS_ZEPHYR_EMU_EEPROM_ENABLED select FLASH help Enable emulated (on flash) EEPROM support. This mimics an external diff --git a/drivers/eeprom/Kconfig.lpc11u6x b/drivers/eeprom/Kconfig.lpc11u6x index 91fd848abf..16442253d3 100644 --- a/drivers/eeprom/Kconfig.lpc11u6x +++ b/drivers/eeprom/Kconfig.lpc11u6x @@ -3,7 +3,7 @@ config EEPROM_LPC11U6X bool "LPC11U6x EEPROM driver" - depends on SOC_SERIES_LPC11U6X default y + depends on DT_HAS_NXP_LPC11U6X_EEPROM_ENABLED help Enable support for the on-chip EEPROM found on NXP LPC11U6x MCUs. diff --git a/drivers/eeprom/Kconfig.stm32 b/drivers/eeprom/Kconfig.stm32 index 9b6159fa7a..2f778c92d7 100644 --- a/drivers/eeprom/Kconfig.stm32 +++ b/drivers/eeprom/Kconfig.stm32 @@ -3,8 +3,8 @@ config EEPROM_STM32 bool "STM32 EEPROM driver" - depends on SOC_SERIES_STM32L0X || SOC_SERIES_STM32L1X default y + depends on DT_HAS_ST_STM32_EEPROM_ENABLED select USE_STM32_HAL_FLASH select USE_STM32_HAL_FLASH_EX help diff --git a/drivers/eeprom/Kconfig.tmp116 b/drivers/eeprom/Kconfig.tmp116 index 231e2da029..86db689f26 100644 --- a/drivers/eeprom/Kconfig.tmp116 +++ b/drivers/eeprom/Kconfig.tmp116 @@ -3,8 +3,9 @@ config EEPROM_TMP116 bool "TMP116 EEPROM driver" - depends on TMP116 default y + depends on DT_HAS_TI_TMP116_EEPROM_ENABLED + depends on TMP116 help Enable support for the on-chip EEPROM found on Texas instrument TMP116 temperature sensor