From da3af62988bf94a4584e7f4011fb09754268c8e1 Mon Sep 17 00:00:00 2001 From: Philip Edelbrock Date: Sun, 28 Feb 1999 21:24:16 +0000 Subject: [PATCH] (Phil) Altered LM75 detection slightly to find my LM75. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@284 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/detect.pl | 8 ++++---- prog/detect/sensors-detect | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/prog/detect/detect.pl b/prog/detect/detect.pl index 1ba15481..1ce76c67 100755 --- a/prog/detect/detect.pl +++ b/prog/detect/detect.pl @@ -1080,10 +1080,10 @@ sub lm75_detect my $conf = i2c_smbus_read_byte_data($file,0x01); my $hyst = i2c_smbus_read_word_data($file,0x02); my $os = i2c_smbus_read_word_data($file,0x03); - for ($i = 0x00; $i <= 0xff; $i += 4) { - return if i2c_smbus_read_byte_data($file,$i + 0x01) != $conf; - return if i2c_smbus_read_word_data($file,$i + 0x02) != $hyst; - return if i2c_smbus_read_word_data($file,$i + 0x03) != $os; + for ($i = 0x00; $i <= 0xF; $i += 1) { + return if i2c_smbus_read_byte_data($file,($i * 0x10) + 0x01) != $conf; + return if i2c_smbus_read_word_data($file,($i * 0x10) + 0x02) != $hyst; + return if i2c_smbus_read_word_data($file,($i * 0x10) + 0x03) != $os; } return (3); } diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 1ba15481..1ce76c67 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1080,10 +1080,10 @@ sub lm75_detect my $conf = i2c_smbus_read_byte_data($file,0x01); my $hyst = i2c_smbus_read_word_data($file,0x02); my $os = i2c_smbus_read_word_data($file,0x03); - for ($i = 0x00; $i <= 0xff; $i += 4) { - return if i2c_smbus_read_byte_data($file,$i + 0x01) != $conf; - return if i2c_smbus_read_word_data($file,$i + 0x02) != $hyst; - return if i2c_smbus_read_word_data($file,$i + 0x03) != $os; + for ($i = 0x00; $i <= 0xF; $i += 1) { + return if i2c_smbus_read_byte_data($file,($i * 0x10) + 0x01) != $conf; + return if i2c_smbus_read_word_data($file,($i * 0x10) + 0x02) != $hyst; + return if i2c_smbus_read_word_data($file,($i * 0x10) + 0x03) != $os; } return (3); }