1 ======== 2 i2c-stub 3 ======== 4 5 Description 6 =========== 7 8 This module is a very simple fake I2C/SMBus dr 9 types of SMBus commands: write quick, (r/w) by 10 word data, (r/w) I2C block data, and (r/w) SMB 11 12 You need to provide chip addresses as a module 13 driver, which will then only react to SMBus co 14 15 No hardware is needed nor associated with this 16 quick commands to the specified addresses; it 17 commands (also to the specified addresses) by 18 arrays in memory. It will also spam the kerne 19 handles. 20 21 A pointer register with auto-increment is impl 22 operations. This allows for continuous byte r 23 EEPROMs, among others. 24 25 SMBus block command support is disabled by def 26 explicitly by setting the respective bits (0x0 27 module parameter. 28 29 SMBus block commands must be written to config 30 SMBus block operations. Writes can be partial. 31 return the number of bytes selected with the l 32 33 The typical use-case is like this: 34 35 1. load this module 36 2. use i2cset (from the i2c-tools proj 37 3. load the target chip driver module 38 4. observe its behavior in the kernel 39 40 There's a script named i2c-stub-from-dump in t 41 can load register values automatically from a 42 43 Parameters 44 ========== 45 46 int chip_addr[10]: 47 The SMBus addresses to emulate chips a 48 49 unsigned long functionality: 50 Functionality override, to disable som 51 constants in <linux/i2c.h> for the sui 52 value 0x1f0000 would only enable the q 53 commands. 54 55 u8 bank_reg[10], u8 bank_mask[10], u8 bank_sta 56 Optional bank settings. They tell whic 57 select the active bank, as well as the 58 59 Caveats 60 ======= 61 62 If your target driver polls some byte or word 63 stub could lock it up. Use i2cset to unlock i 64 65 If you spam it hard enough, printk can be loss 66 something like relayfs.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.