This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / Documentation / i2c / i2c-stub
1 MODULE: i2c-stub
2
3 DESCRIPTION:
4
5 This module is a very simple fake I2C/SMBus driver.  It implements three
6 types of SMBus commands: write quick, (r/w) byte data, and (r/w) word data.
7
8 No hardware is needed nor associated with this module.  It will accept write
9 quick commands to all addresses; it will respond to the other commands (also
10 to all addresses) by reading from or writing to an array in memory.  It will
11 also spam the kernel logs for every command it handles.
12
13 The typical use-case is like this:
14         1. load this module
15         2. use i2cset (from lm_sensors project) to pre-load some data
16         3. load the target sensors chip driver module
17         4. observe its behavior in the kernel log
18
19 CAVEATS:
20
21 There are independent arrays for byte/data and word/data commands.  Depending
22 on if/how a target driver mixes them, you'll need to be careful.
23
24 If your target driver polls some byte or word waiting for it to change, the
25 stub could lock it up.  Use i2cset to unlock it.
26
27 If the hardware for your driver has banked registers (e.g. Winbond sensors
28 chips) this module will not work well - although it could be extended to
29 support that pretty easily.
30
31 If you spam it hard enough, printk can be lossy.  This module really wants
32 something like relayfs.
33