From 96ac13566f4f1b2ebc715c6b03cd5a33496b3ba9 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Thu, 18 Mar 1999 15:12:01 +0000 Subject: [PATCH] Finished renaming of detect.pl * Either Phil had not done a 'cvs update', or I forgot a 'cvs commit'; anyway, the last changes to detect.pl have been ported to sensors-detect. * Added a rule to the Makefile fragment to install it in $(SBINDIR). * Added SBINDIR to the main Makefile. * Deleted detect.pl git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@323 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 5 ++++- prog/detect/Module.mk | 6 ++++++ prog/detect/sensors-detect | 7 ++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1cc719c7..cc39ee93 100644 --- a/Makefile +++ b/Makefile @@ -70,11 +70,14 @@ ETCDIR := /etc LIBDIR := $(PREFIX)/lib # You should not need to change this. It is the directory into which the -# executable program files will be installed. +# executable program files will be installed. BINDIR for programs that are +# also useful for normal users, SBINDIR for programs that can only be run +# by the superuser. # Note that not all programs in this package are really installed; # some are just examples. You can always install them by hand, of # course. BINDIR := $(PREFIX)/bin +SBINDIR := $(PREFIX)/sbin # You should not need to change this. It is the basic directory into which # include files will be installed. The actual directory will be diff --git a/prog/detect/Module.mk b/prog/detect/Module.mk index 7d9a4e05..29c6dbd3 100644 --- a/prog/detect/Module.mk +++ b/prog/detect/Module.mk @@ -24,6 +24,7 @@ MODULE_DIR := prog/detect # defined value verbatim into the command-list of rules... PROGDETECTTARGETS := $(MODULE_DIR)/i2cdetect PROGDETECTSOURCES := $(MODULE_DIR)/i2cdetect.c +PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect # Include all dependency files. We use '.rd' to indicate this will create # executables. @@ -32,6 +33,11 @@ INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd) all-prog-detect: $(PROGDETECTTARGETS) all :: all-prog-detect +install-prog-detect: all-prog-detect + mkdir -p $(SBINDIR) + $(INSTALL) -o root -g root -m 755 $(PROGDETECTSBININSTALL) $(SBINDIR) +install :: install-prog-detect + clean-prog-detect: $(RM) $(PROGDETECTSOURCES:.c=.rd) $(PROGDETECTSOURCES:.c=.ro) \ $(PROGDETECTTARGETS) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 7f0027b8..0cf46f77 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -158,9 +158,6 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect driver => "w83781d", i2c_addrs => [0x00..0x7f], i2c_detect => sub { w83781d_detect 1, @_}, - isa_addrs => [0x290], - isa_detect => sub { w83781d_isa_detect 1, @_ }, - alias_detect => sub { w83781d_alias_detect 1, @_ }, } , { name => "Winbond W83783S", @@ -1149,8 +1146,8 @@ sub w83781d_detect return unless (($reg1 & 0x80) == 0x00 and $reg2 == 0xa3) or (($reg1 & 0x80) == 0x80 and $reg2 == 0x5c); return unless ($reg1 & 0x07) == 0x00; - $reg1 = i2c_smbus_read_byte_data($file,0x58); - return if $chip == 0 and ($reg1 & 0xfe) != 0x10; + $reg1 = i2c_smbus_read_byte_data($file,0x58) &0xfe; + return if $chip == 0 and $reg1 != 0x10; return if $chip == 1 and $reg1 != 0x30; return if $chip == 2 and $reg1 != 0x40; $reg1 = i2c_smbus_read_byte_data($file,0x4a);