diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig index a6adea8108b..2fabe874b6d 100644 --- a/drivers/w1/Kconfig +++ b/drivers/w1/Kconfig @@ -53,4 +53,17 @@ config W1_NET help Enable 1-wire network layer +config W1_NET_FORCE_MULTIDROP_ADDRESSING + bool "Force 1-Wire multidrop addressing" + depends on W1_NET + help + This option will ignore the number of 1-Wire + slave devices defined in the DTS. Specifically, + this option avoids the SKIP ROM command, + which is otherwise used in case of a single + 1-Wire slave on the bus. In most cases, enabling + this option is not needed, yet it is essential + if multiple 1-Wire devices unspecified in the + DTS are interfaced. + endif # W1 diff --git a/drivers/w1/w1_net.c b/drivers/w1/w1_net.c index be515c7d151..06ac4b19cba 100644 --- a/drivers/w1/w1_net.c +++ b/drivers/w1/w1_net.c @@ -346,7 +346,7 @@ int w1_skip_rom(const struct device *dev, const struct w1_slave_config *config) static int reset_select(const struct device *dev, const struct w1_slave_config *config) { - if (w1_get_slave_count(dev) > 1) { + if (IS_ENABLED(CONFIG_W1_NET_FORCE_MULTIDROP_ADDRESSING) || w1_get_slave_count(dev) > 1) { return match_rom(dev, config); }