From f185d7acabb735d531a1bdf4e25731883ee20e4f Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 2 Mar 2022 14:03:58 +0100 Subject: [PATCH] drivers/si114x: Update kconfig model --- drivers/si114x/Kconfig | 68 +++++++++++++++++++---------- tests/driver_si114x/app.config.test | 1 + 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/drivers/si114x/Kconfig b/drivers/si114x/Kconfig index 099f545860..9c77c81919 100644 --- a/drivers/si114x/Kconfig +++ b/drivers/si114x/Kconfig @@ -5,33 +5,53 @@ # directory for more details. # -if TEST_KCONFIG - -choice - bool "Si1145/6/7 UV/Ambient light/Proximity sensors" - optional - depends on HAS_PERIPH_I2C - depends on TEST_KCONFIG - -config MODULE_SI1145 - bool "SI1145" - select MODULE_SI114X - -config MODULE_SI1146 - bool "SI1146" - select MODULE_SI114X - -config MODULE_SI1147 - bool "SI1147" - select MODULE_SI114X - -endchoice - -config MODULE_SI114X +menuconfig MODULE_SI114X bool + prompt "Si1145/6/7 UV/Ambient light/Proximity sensors" if !(MODULE_SAUL_DEFAULT && HAVE_SI114X) + default (MODULE_SAUL_DEFAULT && HAVE_SI114X) + depends on TEST_KCONFIG depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C select MODULE_ZTIMER select MODULE_ZTIMER_MSEC -endif # TEST_KCONFIG +choice SI114X_VARIANT + bool "variant" + depends on MODULE_SI114X + default MODULE_SI1145 if HAVE_SI1145 + default MODULE_SI1146 if HAVE_SI1146 + default MODULE_SI1147 if HAVE_SI1147 + +config MODULE_SI1145 + bool "SI1145" + +config MODULE_SI1146 + bool "SI1146" + +config MODULE_SI1147 + bool "SI1147" + +endchoice + +config HAVE_SI114X + bool + help + Indicates that a Si114X UV/Ambient light/Proximity sensor is present. + +config HAVE_SI1145 + bool + select HAVE_SI114X + help + Indicates that a Si1145 UV/Ambient light/Proximity sensor is present. + +config HAVE_SI1146 + bool + select HAVE_SI114X + help + Indicates that a Si1146 UV/Ambient light/Proximity sensor is present. + +config HAVE_SI1147 + bool + select HAVE_SI114X + help + Indicates that a Si1147 UV/Ambient light/Proximity sensor is present. diff --git a/tests/driver_si114x/app.config.test b/tests/driver_si114x/app.config.test index 810a7a6bdb..53cdfa9aff 100644 --- a/tests/driver_si114x/app.config.test +++ b/tests/driver_si114x/app.config.test @@ -4,5 +4,6 @@ CONFIG_MODULE_ZTIMER=y CONFIG_MODULE_ZTIMER_MSEC=y +CONFIG_MODULE_SI114X=y # This test should also work with Si1146 and Si1147 variants. CONFIG_MODULE_SI1145=y