diff --git a/TODO b/TODO index e7dc3681..c2a460de 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ Many, many things. Most notably: * kmalloc with GFP_KERNEL can cause a context switch! Check whether this is safe everywhere it is used. -* Write doc/lm78, as well as some other docs * Support 10-bit addresses. At this moment, they are supported nowhere, except in Simon Vogl's i2c modules. * Change the i2c modules to keep the namespace clean (EXPORT_SYMBOL does not diff --git a/doc/modules b/doc/modules index 21a2601b..23782ea7 100644 --- a/doc/modules +++ b/doc/modules @@ -37,32 +37,62 @@ With the above, the managing of all those modules is suddenly no problem at all! -i2c-core: +(i2c) i2c-core: The core i2c module (surprise!). Almost everything else depends on this one. Module parameters: i2c_debug (i) Set debug level -i2c-proc: i2c-core +(src) i2c-proc: i2c-core Creates /proc/bus/i2c* files. -smbus: i2c-core +(src) smbus: i2c-core SMBus emulation on i2c busses. Base algorithm, on which SMBus-only adapters rely. -piix4: smbus i2c-core +(src) piix4: smbus i2c-core PIIX4 SMBus access. -isa: i2c-core +(src) isa: i2c-core Defines the ISA bus as being a I2C adapter. It isn't, of course; but this is often used by sensor client modules, to keep the code small and simple. -sensors: i2c-core +(src) sensors: i2c-core General purpose routines for sensor client modules -lm78: sensors smbus i2c-core +(src) lm78: sensors smbus i2c-core LM78, LM78-J and LM79 chip driver -lm75: sensors smbus i2c-core +(src) lm75: sensors smbus i2c-core LM75 chip driver -(To do: i2c modules) +(i2c) algo-bit: i2c-core + The 'bit' algorithm, used by many i2c adapters + Module parameters: + bit_test (i) Test the lines of the bus to see if it is stuck + bit_scan (i) Scan for active chips on the bus + i2c_debug (i) debug level - 0 off; 1 normal; 2,3 more verbose; + 9 bit-protocol + +(i2c) bit-mb: algo-bit i2c-core + VIA VT82C586B bus access. This is often used instead of the PIIX4 as SMBus + +(i2c) bit-lp: algo-bit i2c-core + I2C bus through the parallel port, Philips interface + Module parameters: + base (i) Base address of parallel port + +(i2c) bit-velle: algo-bit i2c-core + I2C bus through the parallel port, Vellemann K9000 interface + Module parameters: + base (i) Base address of parallel port + +(i2c) i2c-dev: i2c-core + /dev interface for I2C adapters. This will be superseded by a module which + will also implement SMBus access. + +(i2c) hw-monitor: ??? + Old skeleton driver for GL518SM. Will be superseded by a module which + interfaces with the sensors module. + +Several other modules are not yet ported by Simon Vogl. They are mostly in +i2c/old-code. diff --git a/doc/piix4 b/doc/piix4 new file mode 100644 index 00000000..80909e3d --- /dev/null +++ b/doc/piix4 @@ -0,0 +1,25 @@ +The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of +functionality. Among other things, it implements the PCI bus. One of its +minor functions is implementing a System Management MBus. This is a true +SMBus - you can not access it on I2C levels. The good news is that it +natively understands SMBus commands and you do not have to worry about +timing problems. The bad news is that non-SMBus devices connected to it +can confuse it mightily. Yes, this is known to happen... + +Cat /proc/pci, and see whether it contains an entry like this: + + Bus 0, device 1, function 3: + Bridge: Intel 82371AB PIIX4 ACPI (rev 1). + Medium devsel. Fast back-to-back capable. + +Bus and device numbers may differ, but the function number must be identical +(like many PCI devices, the PIIX4 incorporates a number of different +'functions', which can be considered as separate devices). If you find such +an entry, you have a PIIX4 SMBus controller. + +On some computers (most notably, some Dells), the SMBus is disabled by +default. If you compile the piix4 module with '-DFORCE_PIIX4_ENABLE', +it will try to enable it. THIS IS VERY DANGEROUS! If the BIOS did not +set up a correct address for this module, you could get in big trouble +(read: crashes, data corruption, etc.). Try this only as a last resort +(try BIOS updates first, for example), and backup first! diff --git a/i2c/Module.mk b/i2c/Module.mk index fc9abb77..b28ab028 100644 --- a/i2c/Module.mk +++ b/i2c/Module.mk @@ -26,6 +26,8 @@ I2CTARGETS := $(MODULE_DIR)/i2c-core.o $(MODULE_DIR)/algo-bit.o \ $(MODULE_DIR)/i2c-dev.o $(MODULE_DIR)/bit-lp.o \ $(MODULE_DIR)/bit-velle.o $(MODULE_DIR)/bit-mb.o +I2CHEADERFILES := $(MODULE_DIR)/i2c.h + # Include all dependency files INCLUDEFILES += $(I2CTARGETS:.o=.d) @@ -35,6 +37,7 @@ all :: all-i2c install-i2c: $(MKDIR) $(MODDIR) install -o root -g root -m 644 $(I2CTARGETS) $(MODDIR) + install -o root -g root -m 644 $(I2CHEADERFILES) $(INCLUDEDIR) install :: install-i2c clean-i2c: diff --git a/kernel/Module.mk b/kernel/Module.mk index 5d653080..5563647f 100644 --- a/kernel/Module.mk +++ b/kernel/Module.mk @@ -26,7 +26,7 @@ SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o \ $(MODULE_DIR)/lm78.o $(MODULE_DIR)/sensors.o \ $(MODULE_DIR)/i2c-proc.o $(MODULE_DIR)/lm75.o -HEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \ +SRCHEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \ $(MODULE_DIR)/smbus.h # Include all dependency files @@ -38,7 +38,7 @@ all :: all-src install-src: $(MKDIR) $(MODDIR) install -o root -g root -m 644 $(SRCTARGETS) $(MODDIR) - install -o root -g root -m 644 $(HEADERFILES) $(INCLUDEDIR) + install -o root -g root -m 644 $(SRCHEADERFILES) $(INCLUDEDIR) install :: install-src clean-src: diff --git a/src/Module.mk b/src/Module.mk index 5d653080..5563647f 100644 --- a/src/Module.mk +++ b/src/Module.mk @@ -26,7 +26,7 @@ SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o $(MODULE_DIR)/isa.o \ $(MODULE_DIR)/lm78.o $(MODULE_DIR)/sensors.o \ $(MODULE_DIR)/i2c-proc.o $(MODULE_DIR)/lm75.o -HEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \ +SRCHEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \ $(MODULE_DIR)/smbus.h # Include all dependency files @@ -38,7 +38,7 @@ all :: all-src install-src: $(MKDIR) $(MODDIR) install -o root -g root -m 644 $(SRCTARGETS) $(MODDIR) - install -o root -g root -m 644 $(HEADERFILES) $(INCLUDEDIR) + install -o root -g root -m 644 $(SRCHEADERFILES) $(INCLUDEDIR) install :: install-src clean-src: