From 0779a932f467837ba6496fcf63a93c38b109769f Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 22 Jul 2022 07:22:15 -0500 Subject: [PATCH] drivers: w1: Update drivers to use devicetree Kconfig symbol Update w1 drivers to use DT_HAS__ENABLED Kconfig symbol to expose the driver and enable it by default based on devicetree. Signed-off-by: Kumar Gala --- drivers/w1/Kconfig.test | 5 ++--- drivers/w1/Kconfig.zephyr_serial | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/w1/Kconfig.test b/drivers/w1/Kconfig.test index 654f4d2dcd6..9e3ae44ed20 100644 --- a/drivers/w1/Kconfig.test +++ b/drivers/w1/Kconfig.test @@ -1,8 +1,7 @@ # Copyright (c) 2022, Thomas Stranger # SPDX-License-Identifier: Apache-2.0 -DT_COMPAT_VND_W1 := vnd,w1 - # Hidden option to enable the vnd,w1 1-Wire host driver used in testing. config W1_TEST - def_bool $(dt_compat_enabled,$(DT_COMPAT_VND_W1)) + def_bool DT_HAS_VND_W1_ENABLED + depends on DT_HAS_VND_W1_ENABLED diff --git a/drivers/w1/Kconfig.zephyr_serial b/drivers/w1/Kconfig.zephyr_serial index a34a42f1275..aff65bd3b0b 100644 --- a/drivers/w1/Kconfig.zephyr_serial +++ b/drivers/w1/Kconfig.zephyr_serial @@ -3,11 +3,10 @@ # Copyright (c) 2022 Thomas Stranger # SPDX-License-Identifier: Apache-2.0 -DT_COMPAT_ZEPHYR_SERIAL := zephyr,w1-serial - config W1_ZEPHYR_SERIAL bool "1-wire Serial" - default y if $(dt_compat_enabled,$(DT_COMPAT_ZEPHYR_SERIAL)) + default y + depends on DT_HAS_ZEPHYR_W1_SERIAL_ENABLED help This option enables the Zephyr serial 1-Wire master driver.