Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: add fast search for single slave bus

This enables a much more efficient way of device searching. It uses the
1-wire read-rom operation which allows the direct reading of the slave
address. BUT this works only with exactly one slave on the bus.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>

index c374978..9761950 100644
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Evgeniy Polyakov and committed by
Greg Kroah-Hartman
c9cbf558 74099b18

+10
+10
drivers/w1/w1.c
··· 892 892 break; 893 893 } 894 894 895 + /* Do fast search on single slave bus */ 896 + if (dev->max_slave_count == 1) { 897 + w1_write_8(dev, W1_READ_ROM); 898 + 899 + if (w1_read_block(dev, (u8 *)&rn, 8) == 8 && rn) 900 + cb(dev, rn); 901 + 902 + break; 903 + } 904 + 895 905 /* Start the search */ 896 906 w1_write_8(dev, search_type); 897 907 for (i = 0; i < 64; ++i) {