€•1Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ /translations/zh_CN/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/zh_TW/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/it_IT/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/ja_JP/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/ko_KR/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ /translations/sp_SP/i2c/i2c-stub”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒi2c-stub”h]”hŒi2c-stub”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ:/var/lib/git/docbuild/linux/Documentation/i2c/i2c-stub.rst”h Kubh¢)”}”(hhh]”(h§)”}”(hŒ Description”h]”hŒ Description”…””}”(hhºhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh·hžhhŸh¶h KubhŒ paragraph”“”)”}”(hŒÌThis module is a very simple fake I2C/SMBus driver. It implements six types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) word data, (r/w) I2C block data, and (r/w) SMBus block data.”h]”hŒÌThis module is a very simple fake I2C/SMBus driver. It implements six types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) word data, (r/w) I2C block data, and (r/w) SMBus block data.”…””}”(hhÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubhÉ)”}”(hŒ“You need to provide chip addresses as a module parameter when loading this driver, which will then only react to SMBus commands to these addresses.”h]”hŒ“You need to provide chip addresses as a module parameter when loading this driver, which will then only react to SMBus commands to these addresses.”…””}”(hhØhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K hh·hžhubhÉ)”}”(hX0No hardware is needed nor associated with this module. It will accept write quick commands to the specified addresses; it will respond to the other commands (also to the specified addresses) by reading from or writing to arrays in memory. It will also spam the kernel logs for every command it handles.”h]”hX0No hardware is needed nor associated with this module. It will accept write quick commands to the specified addresses; it will respond to the other commands (also to the specified addresses) by reading from or writing to arrays in memory. It will also spam the kernel logs for every command it handles.”…””}”(hhæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubhÉ)”}”(hŒ¤A pointer register with auto-increment is implemented for all byte operations. This allows for continuous byte reads like those supported by EEPROMs, among others.”h]”hŒ¤A pointer register with auto-increment is implemented for all byte operations. This allows for continuous byte reads like those supported by EEPROMs, among others.”…””}”(hhôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubhÉ)”}”(hŒ¥SMBus block command support is disabled by default, and must be enabled explicitly by setting the respective bits (0x03000000) in the functionality module parameter.”h]”hŒ¥SMBus block command support is disabled by default, and must be enabled explicitly by setting the respective bits (0x03000000) in the functionality module parameter.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubhÉ)”}”(hŒÓSMBus block commands must be written to configure an SMBus command for SMBus block operations. Writes can be partial. Block read commands always return the number of bytes selected with the largest write so far.”h]”hŒÓSMBus block commands must be written to configure an SMBus command for SMBus block operations. Writes can be partial. Block read commands always return the number of bytes selected with the largest write so far.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubhÉ)”}”(hŒ"The typical use-case is like this:”h]”hŒ"The typical use-case is like this:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K!hh·hžhubhŒ block_quote”“”)”}”(hŒ¥1. load this module 2. use i2cset (from the i2c-tools project) to pre-load some data 3. load the target chip driver module 4. observe its behavior in the kernel log ”h]”hŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒload this module”h]”hÉ)”}”(hj;h]”hŒload this module”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K#hj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1j7hj4ubj8)”}”(hŒ=use i2cset (from the i2c-tools project) to pre-load some data”h]”hÉ)”}”(hjRh]”hŒ=use i2cset (from the i2c-tools project) to pre-load some data”…””}”(hjThžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K$hjPubah}”(h]”h ]”h"]”h$]”h&]”uh1j7hj4ubj8)”}”(hŒ"load the target chip driver module”h]”hÉ)”}”(hjih]”hŒ"load the target chip driver module”…””}”(hjkhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K%hjgubah}”(h]”h ]”h"]”h$]”h&]”uh1j7hj4ubj8)”}”(hŒ'observe its behavior in the kernel log ”h]”hÉ)”}”(hŒ&observe its behavior in the kernel log”h]”hŒ&observe its behavior in the kernel log”…””}”(hj‚hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K&hj~ubah}”(h]”h ]”h"]”h$]”h&]”uh1j7hj4ubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1j2hj.ubah}”(h]”h ]”h"]”h$]”h&]”uh1j,hŸh¶h K#hh·hžhubhÉ)”}”(hŒThere's a script named i2c-stub-from-dump in the i2c-tools package which can load register values automatically from a chip dump.”h]”hŒƒThere’s a script named i2c-stub-from-dump in the i2c-tools package which can load register values automatically from a chip dump.”…””}”(hj§hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K(hh·hžhubeh}”(h]”Œ description”ah ]”h"]”Œ description”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ Parameters”h]”hŒ Parameters”…””}”(hjÀhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj½hžhhŸh¶h K,ubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ for the suitable values. For example, value 0x1f0000 would only enable the quick, byte and byte data commands. ”h]”(jÚ)”}”(hŒunsigned long functionality:”h]”hŒunsigned long functionality:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÙhŸh¶h K5hjubjê)”}”(hhh]”hÉ)”}”(hŒÊFunctionality override, to disable some commands. See I2C_FUNC_* constants in for the suitable values. For example, value 0x1f0000 would only enable the quick, byte and byte data commands.”h]”hŒÊFunctionality override, to disable some commands. See I2C_FUNC_* constants in for the suitable values. For example, value 0x1f0000 would only enable the quick, byte and byte data commands.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K2hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jéhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÓhŸh¶h K5hjÐhžhubjÔ)”}”(hŒÈu8 bank_reg[10], u8 bank_mask[10], u8 bank_start[10], u8 bank_end[10]: Optional bank settings. They tell which bits in which register select the active bank, as well as the range of banked registers. ”h]”(jÚ)”}”(hŒFu8 bank_reg[10], u8 bank_mask[10], u8 bank_start[10], u8 bank_end[10]:”h]”hŒFu8 bank_reg[10], u8 bank_mask[10], u8 bank_start[10], u8 bank_end[10]:”…””}”(hj;hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÙhŸh¶h K9hj7ubjê)”}”(hhh]”hÉ)”}”(hŒ€Optional bank settings. They tell which bits in which register select the active bank, as well as the range of banked registers.”h]”hŒ€Optional bank settings. They tell which bits in which register select the active bank, as well as the range of banked registers.”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K8hjIubah}”(h]”h ]”h"]”h$]”h&]”uh1jéhj7ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÓhŸh¶h K9hjÐhžhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj½hžhhŸh¶h Nubeh}”(h]”Œ parameters”ah ]”h"]”Œ parameters”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K,ubh¢)”}”(hhh]”(h§)”}”(hŒCaveats”h]”hŒCaveats”…””}”(hjwhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjthžhhŸh¶h KhjthžhubhÉ)”}”(hŒbIf you spam it hard enough, printk can be lossy. This module really wants something like relayfs.”h]”hŒbIf you spam it hard enough, printk can be lossy. This module really wants something like relayfs.”…””}”(hj“hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KAhjthžhubeh}”(h]”Œcaveats”ah ]”h"]”Œcaveats”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K