Skip to content

Commit

Permalink
drivers: w1: Update drivers to use devicetree Kconfig symbol
Browse files Browse the repository at this point in the history
Update w1 drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

Signed-off-by: Kumar Gala <[email protected]>
  • Loading branch information
galak authored and carlescufi committed Jul 29, 2022
1 parent 5b9e0b6 commit 0779a93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions drivers/w1/Kconfig.test
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions drivers/w1/Kconfig.zephyr_serial
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 0779a93

Please sign in to comment.