~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/i2c/i2c-stub.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/i2c/i2c-stub.rst (Version linux-6.12-rc7) and /Documentation/i2c/i2c-stub.rst (Version linux-6.3.13)


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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php