2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-05 00:35:35 +00:00

LM78 insmod parameters and better detection

Supported insmod parameters:
  ignore, ignore_range
  probe, probe_range
  force, force_lm78, force_lm78j, force_lm79

force* overrules ignore* overrules probe*

The *_range parameters need three elements for each specification:
  bus,start_addr,end_addr
The address ranges are inclusive.
The other parameters need two elements for each specification:
  bus,addr
In each case, '-1' stands for 'any I2C bus', and 9191 stands for
'the ISA bus' (Bonus question: who can figure out why I choose 9191?)
In each case, just append if you want several specification, for example:
  insmod lm78 probe=9191,0x2a0,1,0x56

force_* does no detection, not even chip detection; it blindly assumes
you know what you are doing. plain force does the chip detection, but
nothing else; but it can still fail if the register read-out does not
match a chip type.

Detection is done in exactly the same way as sensors-detect, except that
only the range 0x20-0x2f is examined by default. This needs to be
synchronized somehow with the detect script. I would rather scan the whole
I2C address range, but with those clueless PIIX4 hangs when clock chips
are read, that would simply give too much trouble.

The detect script has slightly better ISA detection now, too.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@325 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard
1999-03-19 06:25:02 +00:00
parent 7e8c43e6b6
commit b4b1293b25
4 changed files with 293 additions and 288 deletions

View File

@@ -1043,6 +1043,13 @@ sub lm78_isa_detect
my $val = inb ($addr + 1);
return if inb ($addr + 2) != $val or inb ($addr + 3) != $val or
inb ($addr + 7) != $val;
$val = inb($addr + 5) & 0x7f;
outb($addr+5,~ $val);
if ((inb ($addr+5) & 0x7f) != (~ $val & 0x7f)) {
outb($addr+5,$val);
return;
}
my $readproc = sub { isa_read_byte $addr + 5, $addr + 6, @_ };
return unless (&$readproc(0x40) & 0x80) == 0x00;
my $reg = &$readproc(0x49);
@@ -1183,6 +1190,14 @@ sub w83781d_isa_detect
my $val = inb ($addr + 1);
return if inb ($addr + 2) != $val or inb ($addr + 3) != $val or
inb ($addr + 7) != $val;
$val = inb($addr + 5) & 0x7f;
outb($addr+5,~ $val);
if ((inb ($addr+5) & 0x7f) != (~ $val & 0x7f)) {
outb($addr+5,$val);
return;
}
my $read_proc = sub { isa_read_byte $addr + 5, $addr + 6, @_ };
$reg1 = &$read_proc(0x4e);
$reg2 = &$read_proc(0x4f);