add devfs /dev/i2c/x support

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1054 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker committed 2001-03-31 19:07:09 +00:00
1 parent 0709b19497
commit 030053643c
2 files changed
+18 -14

No files matched your search

+3 -2
View File
@@ -52,8 +52,9 @@ ask CVS about it:
Program sensors: Change reported version from 1.3 to the lm_sensors version;
Fix swapped limit and hysteresis on 9240, 5595, 686a;
Change mtp008 temps from max/min to limit/hyst.
Program sensors-detect: Recognize lm78 with chipid=0x20
Recognize SMSC Victory66 South Bridge
Program sensors-detect: Recognize lm78 with chipid=0x20;
Recognize SMSC Victory66 South Bridge;
Add devfs /dev/i2c/x support
Program tellerstats: new
2.5.5 (20010115)
+15 -12
View File
@@ -1276,12 +1276,13 @@ sub add_isa_to_chips_detected
$new_misdetected_ref->[$i]->{chipname} eq $datahash->{chipname}) {
open FILE,"/dev/i2c-$new_misdetected_ref->[$i]->{i2c_devnr}" or
open FILE,"/dev/i2c$new_misdetected_ref->[$i]->{i2c_devnr}" or
print("Can't open ",
"/dev/i2c[-]$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
open FILE,"/dev/i2c/$new_misdetected_ref->[$i]->{i2c_devnr}" or
print("Can't open ",
"/dev/i2c[-/]$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
i2c_set_slave_addr \*FILE,$new_misdetected_ref->[$i]->{i2c_addr} or
print("Can't set I2C address for ",
"/dev/i2c[-]$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"),
"/dev/i2c[-/]$new_misdetected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
if (&$alias_detect ($datahash->{isa_addr},\*FILE,
$new_misdetected_ref->[$i]->{i2c_addr})) {
@@ -1303,12 +1304,13 @@ sub add_isa_to_chips_detected
$new_detected_ref->[$i]->{chipname} eq $datahash->{chipname}) {
open FILE,"/dev/i2c-$new_detected_ref->[$i]->{i2c_devnr}" or
open FILE,"/dev/i2c$new_detected_ref->[$i]->{i2c_devnr}" or
print("Can't open ",
"/dev/i2c[-]$new_detected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
open FILE,"/dev/i2c/$new_detected_ref->[$i]->{i2c_devnr}" or
print("Can't open ",
"/dev/i2c[-/]$new_detected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
i2c_set_slave_addr \*FILE,$new_detected_ref->[$i]->{i2c_addr} or
print("Can't set I2C address for ",
"/dev/i2c[-]$new_detected_ref->[$i]->{i2c_devnr}?!?\n"),
"/dev/i2c[-/]$new_detected_ref->[$i]->{i2c_devnr}?!?\n"),
next;
if (&$alias_detect ($datahash->{isa_addr},\*FILE,
$new_detected_ref->[$i]->{i2c_addr})) {
@@ -1374,7 +1376,8 @@ sub scan_adapter
open FILE,"/dev/i2c-$adapter_nr" or
open FILE,"/dev/i2c$adapter_nr" or
(print "Can't open /dev/i2c[-]$adapter_nr\n"), return;
open FILE,"/dev/i2c/$adapter_nr" or
(print "Can't open /dev/i2c[-/]$adapter_nr\n"), return;
# Now scan each address in turn
foreach $addr (0..0x7f) {
@@ -2293,7 +2296,7 @@ sub main
"Read\n",
" doc/modules for more information.\n";
print " Also, you need to be `root', or at least have access to the ",
"/dev/i2c[-]* files\n",
"/dev/i2c[-/]* files\n",
" for some things. You can use prog/mkdev/mkdev.sh to create these ",
"/dev files\n",
" if you do not have them already.\n";
@@ -2375,7 +2378,7 @@ sub main
"you edited\n",
" `/etc/conf.modules' (or `/etc/modules.conf') for automatic ",
"loading of\n",
" this module. If not, you won't be able to open any /dev/i2c[-]* ",
" this module. If not, you won't be able to open any /dev/i2c[-/]* ",
"file.\n";
} else {
print " i2c-dev is not loaded. Do you want to load it now? (YES/no): ";
@@ -2384,7 +2387,7 @@ sub main
"`/etc/conf.modules'\n",
" (or `/etc/modules.conf') for automatic loading of this ",
"module. If not,\n",
" you won't be able to open any /dev/i2c[-]* file (unless you",
" you won't be able to open any /dev/i2c[-/]* file (unless you",
"have it built-in\n",
" into your kernel)\n";
} elsif (system "modprobe","i2c-dev") {