From 8f952fb324a33c7bb35ec0a44cbea3025a7f3782 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Thu, 25 Feb 1999 08:37:29 +0000 Subject: [PATCH] Corrected alias detection I forgot to set the I2C address correctly, so it was always comparing with device 0x00 :-( git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@274 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/detect.pl | 8 ++++++++ prog/detect/sensors-detect | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/prog/detect/detect.pl b/prog/detect/detect.pl index 39fbb3cc..1d03d2dd 100755 --- a/prog/detect/detect.pl +++ b/prog/detect/detect.pl @@ -799,6 +799,10 @@ sub add_isa_to_chips_detected print("Can't open ", "/dev/i2c-$new_misdetected_ref->[$j]->{devnr}?!?\n"), next; + i2c_set_slave_addr \*FILE,$new_misdetected_ref->[$j]->{address} or + print("Can't set I2C address for ", + "/dev/i2c-$new_misdetected_ref->[$j]->{devnr}?!?\n"), + next; if (&$alias_detect ($datahash->{isa_addr},\*FILE, $new_misdetected_ref->[$j]->{address})) { $new_misdetected_ref->[$j]->{isa_addr} = $datahash->{isa_addr}; @@ -816,6 +820,10 @@ sub add_isa_to_chips_detected print("Can't open ", "/dev/i2c-$new_detected_ref->[$j]->{devnr}?!?\n"), next; + i2c_set_slave_addr \*FILE,$new_detected_ref->[$j]->{address} or + print("Can't set I2C address for ", + "/dev/i2c-$new_detected_ref->[$j]->{devnr}?!?\n"), + next; if (&$alias_detect ($datahash->{isa_addr},\*FILE, $new_detected_ref->[$j]->{address})) { $new_detected_ref->[$j]->{isa_addr} = $datahash->{isa_addr}; diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 39fbb3cc..1d03d2dd 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -799,6 +799,10 @@ sub add_isa_to_chips_detected print("Can't open ", "/dev/i2c-$new_misdetected_ref->[$j]->{devnr}?!?\n"), next; + i2c_set_slave_addr \*FILE,$new_misdetected_ref->[$j]->{address} or + print("Can't set I2C address for ", + "/dev/i2c-$new_misdetected_ref->[$j]->{devnr}?!?\n"), + next; if (&$alias_detect ($datahash->{isa_addr},\*FILE, $new_misdetected_ref->[$j]->{address})) { $new_misdetected_ref->[$j]->{isa_addr} = $datahash->{isa_addr}; @@ -816,6 +820,10 @@ sub add_isa_to_chips_detected print("Can't open ", "/dev/i2c-$new_detected_ref->[$j]->{devnr}?!?\n"), next; + i2c_set_slave_addr \*FILE,$new_detected_ref->[$j]->{address} or + print("Can't set I2C address for ", + "/dev/i2c-$new_detected_ref->[$j]->{devnr}?!?\n"), + next; if (&$alias_detect ($datahash->{isa_addr},\*FILE, $new_detected_ref->[$j]->{address})) { $new_detected_ref->[$j]->{isa_addr} = $datahash->{isa_addr};