€• tŒ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/functionality”Œ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/functionality”Œ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/functionality”Œ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/functionality”Œ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/functionality”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/i2c/functionality”Œ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/functionality”Œ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/SMBus Functionality”h]”hŒI2C/SMBus Functionality”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ?/var/lib/git/docbuild/linux/Documentation/i2c/functionality.rst”h´Kubh¶)”}”(hhh]”(h»)”}”(hŒ INTRODUCTION”h]”hŒ INTRODUCTION”…””}”(hhÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhËh²hh³hÊh´KubhŒ paragraph”“”)”}”(hXBecause not every I2C or SMBus adapter implements everything in the I2C specifications, a client can not trust that everything it needs is implemented when it is given the option to attach to an adapter: the client needs some way to check whether an adapter has the needed functionality.”h]”hXBecause not every I2C or SMBus adapter implements everything in the I2C specifications, a client can not trust that everything it needs is implemented when it is given the option to attach to an adapter: the client needs some way to check whether an adapter has the needed functionality.”…””}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒFUNCTIONALITY CONSTANTS”h]”hŒFUNCTIONALITY CONSTANTS”…””}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhôh²hh³hÊh´KubhÝ)”}”(hŒYFor the most up-to-date list of functionality constants, please check !”h]”hŒYFor the most up-to-date list of functionality constants, please check !”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khhôh²hubhŒ block_quote”“”)”}”(hXí=============================== ============================================== I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus adapters typically can not do these) I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, I2C_M_REV_DIR_ADDR and I2C_M_NO_RD_ACK flags (which modify the I2C protocol!) I2C_FUNC_NOSTART Can skip repeated start sequence I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command I2C_FUNC_SMBUS_READ_BYTE_DATA Handles the SMBus read_byte_data command I2C_FUNC_SMBUS_WRITE_BYTE_DATA Handles the SMBus write_byte_data command I2C_FUNC_SMBUS_READ_WORD_DATA Handles the SMBus read_word_data command I2C_FUNC_SMBUS_WRITE_WORD_DATA Handles the SMBus write_byte_data command I2C_FUNC_SMBUS_PROC_CALL Handles the SMBus process_call command I2C_FUNC_SMBUS_READ_BLOCK_DATA Handles the SMBus read_block_data command I2C_FUNC_SMBUS_WRITE_BLOCK_DATA Handles the SMBus write_block_data command I2C_FUNC_SMBUS_READ_I2C_BLOCK Handles the SMBus read_i2c_block_data command I2C_FUNC_SMBUS_WRITE_I2C_BLOCK Handles the SMBus write_i2c_block_data command =============================== ============================================== ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j#hj ubj$)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K.uh1j#hj ubhŒtbody”“”)”}”(hhh]”(hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”hÝ)”}”(hŒ I2C_FUNC_I2C”h]”hŒ I2C_FUNC_I2C”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhjEubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj@ubjD)”}”(hhh]”hÝ)”}”(hŒIPlain i2c-level commands (Pure SMBus adapters typically can not do these)”h]”hŒIPlain i2c-level commands (Pure SMBus adapters typically can not do these)”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj@ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_10BIT_ADDR”h]”hŒI2C_FUNC_10BIT_ADDR”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjyubjD)”}”(hhh]”hÝ)”}”(hŒ%Handles the 10-bit address extensions”h]”hŒ%Handles the 10-bit address extensions”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjyubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_PROTOCOL_MANGLING”h]”hŒI2C_FUNC_PROTOCOL_MANGLING”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj°ubjD)”}”(hhh]”hÝ)”}”(hŒoKnows about the I2C_M_IGNORE_NAK, I2C_M_REV_DIR_ADDR and I2C_M_NO_RD_ACK flags (which modify the I2C protocol!)”h]”hŒoKnows about the I2C_M_IGNORE_NAK, I2C_M_REV_DIR_ADDR and I2C_M_NO_RD_ACK flags (which modify the I2C protocol!)”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_NOSTART”h]”hŒI2C_FUNC_NOSTART”…””}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjçubjD)”}”(hhh]”hÝ)”}”(hŒ Can skip repeated start sequence”h]”hŒ Can skip repeated start sequence”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjçubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_QUICK”h]”hŒI2C_FUNC_SMBUS_QUICK”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjubjD)”}”(hhh]”hÝ)”}”(hŒ%Handles the SMBus write_quick command”h]”hŒ%Handles the SMBus write_quick command”…””}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_READ_BYTE”h]”hŒI2C_FUNC_SMBUS_READ_BYTE”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhjXubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjUubjD)”}”(hhh]”hÝ)”}”(hŒ#Handles the SMBus read_byte command”h]”hŒ#Handles the SMBus read_byte command”…””}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjUubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WRITE_BYTE”h]”hŒI2C_FUNC_SMBUS_WRITE_BYTE”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŒubjD)”}”(hhh]”hÝ)”}”(hŒ$Handles the SMBus write_byte command”h]”hŒ$Handles the SMBus write_byte command”…””}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj¦ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŒubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_READ_BYTE_DATA”h]”hŒI2C_FUNC_SMBUS_READ_BYTE_DATA”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hjÆubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÃubjD)”}”(hhh]”hÝ)”}”(hŒ(Handles the SMBus read_byte_data command”h]”hŒ(Handles the SMBus read_byte_data command”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÃubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WRITE_BYTE_DATA”h]”hŒI2C_FUNC_SMBUS_WRITE_BYTE_DATA”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K!hjýubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjúubjD)”}”(hhh]”hÝ)”}”(hŒ)Handles the SMBus write_byte_data command”h]”hŒ)Handles the SMBus write_byte_data command”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K!hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjúubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_READ_WORD_DATA”h]”hŒI2C_FUNC_SMBUS_READ_WORD_DATA”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K"hj4ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj1ubjD)”}”(hhh]”hÝ)”}”(hŒ(Handles the SMBus read_word_data command”h]”hŒ(Handles the SMBus read_word_data command”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K"hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj1ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WRITE_WORD_DATA”h]”hŒI2C_FUNC_SMBUS_WRITE_WORD_DATA”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K#hjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjhubjD)”}”(hhh]”hÝ)”}”(hŒ)Handles the SMBus write_byte_data command”h]”hŒ)Handles the SMBus write_byte_data command”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K#hj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjhubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_PROC_CALL”h]”hŒI2C_FUNC_SMBUS_PROC_CALL”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K$hj¢ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŸubjD)”}”(hhh]”hÝ)”}”(hŒ&Handles the SMBus process_call command”h]”hŒ&Handles the SMBus process_call command”…””}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K$hj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŸubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_READ_BLOCK_DATA”h]”hŒI2C_FUNC_SMBUS_READ_BLOCK_DATA”…””}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K%hjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÖubjD)”}”(hhh]”hÝ)”}”(hŒ)Handles the SMBus read_block_data command”h]”hŒ)Handles the SMBus read_block_data command”…””}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K%hjðubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÖubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WRITE_BLOCK_DATA”h]”hŒI2C_FUNC_SMBUS_WRITE_BLOCK_DATA”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K&hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj ubjD)”}”(hhh]”hÝ)”}”(hŒ*Handles the SMBus write_block_data command”h]”hŒ*Handles the SMBus write_block_data command”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K&hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_READ_I2C_BLOCK”h]”hŒI2C_FUNC_SMBUS_READ_I2C_BLOCK”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K'hjGubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjDubjD)”}”(hhh]”hÝ)”}”(hŒ-Handles the SMBus read_i2c_block_data command”h]”hŒ-Handles the SMBus read_i2c_block_data command”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K'hj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjDubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WRITE_I2C_BLOCK”h]”hŒI2C_FUNC_SMBUS_WRITE_I2C_BLOCK”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K(hj~ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj{ubjD)”}”(hhh]”hÝ)”}”(hŒ.Handles the SMBus write_i2c_block_data command”h]”hŒ.Handles the SMBus write_i2c_block_data command”…””}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K(hj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj{ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj;ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j9hj ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Khhôh²hubhÝ)”}”(hŒLA few combinations of the above flags are also defined for your convenience:”h]”hŒLA few combinations of the above flags are also defined for your convenience:”…””}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K+hhôh²hubj)”}”(hXÔ========================= ====================================== I2C_FUNC_SMBUS_BYTE Handles the SMBus read_byte and write_byte commands I2C_FUNC_SMBUS_BYTE_DATA Handles the SMBus read_byte_data and write_byte_data commands I2C_FUNC_SMBUS_WORD_DATA Handles the SMBus read_word_data and write_word_data commands I2C_FUNC_SMBUS_BLOCK_DATA Handles the SMBus read_block_data and write_block_data commands I2C_FUNC_SMBUS_I2C_BLOCK Handles the SMBus read_i2c_block_data and write_i2c_block_data commands I2C_FUNC_SMBUS_EMUL Handles all SMBus commands that can be emulated by a real I2C adapter (using the transparent emulation layer) ========================= ====================================== ”h]”j)”}”(hhh]”j)”}”(hhh]”(j$)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1j#hjàubj$)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K&uh1j#hjàubj:)”}”(hhh]”(j?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_BYTE”h]”hŒI2C_FUNC_SMBUS_BYTE”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K.hjýubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjúubjD)”}”(hhh]”hÝ)”}”(hŒ3Handles the SMBus read_byte and write_byte commands”h]”hŒ3Handles the SMBus read_byte and write_byte commands”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K.hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjúubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_BYTE_DATA”h]”hŒI2C_FUNC_SMBUS_BYTE_DATA”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K0hj4ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj1ubjD)”}”(hhh]”hÝ)”}”(hŒ=Handles the SMBus read_byte_data and write_byte_data commands”h]”hŒ=Handles the SMBus read_byte_data and write_byte_data commands”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K0hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj1ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_WORD_DATA”h]”hŒI2C_FUNC_SMBUS_WORD_DATA”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K2hjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjhubjD)”}”(hhh]”hÝ)”}”(hŒ=Handles the SMBus read_word_data and write_word_data commands”h]”hŒ=Handles the SMBus read_word_data and write_word_data commands”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K2hj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjhubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_BLOCK_DATA”h]”hŒI2C_FUNC_SMBUS_BLOCK_DATA”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K4hj¢ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŸubjD)”}”(hhh]”hÝ)”}”(hŒ?Handles the SMBus read_block_data and write_block_data commands”h]”hŒ?Handles the SMBus read_block_data and write_block_data commands”…””}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K4hj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjŸubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_I2C_BLOCK”h]”hŒI2C_FUNC_SMBUS_I2C_BLOCK”…””}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K6hjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÖubjD)”}”(hhh]”hÝ)”}”(hŒGHandles the SMBus read_i2c_block_data and write_i2c_block_data commands”h]”hŒGHandles the SMBus read_i2c_block_data and write_i2c_block_data commands”…””}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K6hjðubah}”(h]”h ]”h"]”h$]”h&]”uh1jChjÖubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubj?)”}”(hhh]”(jD)”}”(hhh]”hÝ)”}”(hŒI2C_FUNC_SMBUS_EMUL”h]”hŒI2C_FUNC_SMBUS_EMUL”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K8hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj ubjD)”}”(hhh]”hÝ)”}”(hŒmHandles all SMBus commands that can be emulated by a real I2C adapter (using the transparent emulation layer)”h]”hŒmHandles all SMBus commands that can be emulated by a real I2C adapter (using the transparent emulation layer)”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K8hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jChj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j>hj÷ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j9hjàubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jhjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K-hhôh²hubhÝ)”}”(hŒgIn kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as part of I2C_FUNC_PROTOCOL_MANGLING.”h]”hŒgIn kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as part of I2C_FUNC_PROTOCOL_MANGLING.”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K=hhôh²hubeh}”(h]”Œfunctionality-constants”ah ]”h"]”Œfunctionality constants”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒADAPTER IMPLEMENTATION”h]”hŒADAPTER IMPLEMENTATION”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjsh²hh³hÊh´KBubhÝ)”}”(hŒWhen you write a new adapter driver, you will have to implement a function callback ``functionality``. Typical implementations are given below.”h]”(hŒTWhen you write a new adapter driver, you will have to implement a function callback ”…””}”(hj„h²hh³Nh´NubhŒliteral”“”)”}”(hŒ``functionality``”h]”hŒ functionality”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŒhj„ubhŒ*. Typical implementations are given below.”…””}”(hj„h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KDhjsh²hubhÝ)”}”(hŒ~A typical SMBus-only adapter would list all the SMBus transactions it supports. This example comes from the i2c-piix4 driver::”h]”hŒ}A typical SMBus-only adapter would list all the SMBus transactions it supports. This example comes from the i2c-piix4 driver:”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KHhjsh²hubhŒ literal_block”“”)”}”(hŒÛstatic u32 piix4_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA; }”h]”hŒÛstatic u32 piix4_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA; }”…””}”hj¶sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j´h³hÊh´KKhjsh²hubhÝ)”}”(hŒNA typical full-I2C adapter would use the following (from the i2c-pxa driver)::”h]”hŒMA typical full-I2C adapter would use the following (from the i2c-pxa driver):”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KRhjsh²hubjµ)”}”(hŒostatic u32 i2c_pxa_functionality(struct i2c_adapter *adap) { return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; }”h]”hŒostatic u32 i2c_pxa_functionality(struct i2c_adapter *adap) { return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; }”…””}”hjÔsbah}”(h]”h ]”h"]”h$]”h&]”jÄjÅuh1j´h³hÊh´KUhjsh²hubhÝ)”}”(hX¨I2C_FUNC_SMBUS_EMUL includes all the SMBus transactions (with the addition of I2C block transactions) which i2c-core can emulate using I2C_FUNC_I2C without any help from the adapter driver. The idea is to let the client drivers check for the support of SMBus functions without having to care whether the said functions are implemented in hardware by the adapter, or emulated in software by i2c-core on top of an I2C adapter.”h]”hX¨I2C_FUNC_SMBUS_EMUL includes all the SMBus transactions (with the addition of I2C block transactions) which i2c-core can emulate using I2C_FUNC_I2C without any help from the adapter driver. The idea is to let the client drivers check for the support of SMBus functions without having to care whether the said functions are implemented in hardware by the adapter, or emulated in software by i2c-core on top of an I2C adapter.”…””}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KZhjsh²hubeh}”(h]”Œadapter-implementation”ah ]”h"]”Œadapter implementation”ah$]”h&]”uh1hµhh·h²hh³hÊh´KBubh¶)”}”(hhh]”(h»)”}”(hŒCLIENT CHECKING”h]”hŒCLIENT CHECKING”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjøh²hh³hÊh´KdubhÝ)”}”(hŒýBefore a client tries to attach to an adapter, or even do tests to check whether one of the devices it supports is present on an adapter, it should check whether the needed functionality is present. The typical way to do this is (from the lm75 driver)::”h]”hŒüBefore a client tries to attach to an adapter, or even do tests to check whether one of the devices it supports is present on an adapter, it should check whether the needed functionality is present. The typical way to do this is (from the lm75 driver):”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kfhjøh²hubjµ)”}”(hŒÕstatic int lm75_detect(...) { (...) if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) goto exit; (...) }”h]”hŒÕstatic int lm75_detect(...) { (...) if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) goto exit; (...) }”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jÄjÅuh1j´h³hÊh´Kkhjøh²hubhÝ)”}”(hX=Here, the lm75 driver checks if the adapter can do both SMBus byte data and SMBus word data transactions. If not, then the driver won't work on this adapter and there's no point in going on. If the check above is successful, then the driver knows that it can call the following functions: i2c_smbus_read_byte_data(), i2c_smbus_write_byte_data(), i2c_smbus_read_word_data() and i2c_smbus_write_word_data(). As a rule of thumb, the functionality constants you test for with i2c_check_functionality() should match exactly the i2c_smbus_* functions which you driver is calling.”h]”hXAHere, the lm75 driver checks if the adapter can do both SMBus byte data and SMBus word data transactions. If not, then the driver won’t work on this adapter and there’s no point in going on. If the check above is successful, then the driver knows that it can call the following functions: i2c_smbus_read_byte_data(), i2c_smbus_write_byte_data(), i2c_smbus_read_word_data() and i2c_smbus_write_word_data(). As a rule of thumb, the functionality constants you test for with i2c_check_functionality() should match exactly the i2c_smbus_* functions which you driver is calling.”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kthjøh²hubhÝ)”}”(hXNote that the check above doesn't tell whether the functionalities are implemented in hardware by the underlying adapter or emulated in software by i2c-core. Client drivers don't have to care about this, as i2c-core will transparently implement SMBus transactions on top of I2C adapters.”h]”hX#Note that the check above doesn’t tell whether the functionalities are implemented in hardware by the underlying adapter or emulated in software by i2c-core. Client drivers don’t have to care about this, as i2c-core will transparently implement SMBus transactions on top of I2C adapters.”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K~hjøh²hubeh}”(h]”Œclient-checking”ah ]”h"]”Œclient checking”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kdubh¶)”}”(hhh]”(h»)”}”(hŒCHECKING THROUGH /DEV”h]”hŒCHECKING THROUGH /DEV”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjIh²hh³hÊh´K†ubhÝ)”}”(hXIf you try to access an adapter from a userspace program, you will have to use the /dev interface. You will still have to check whether the functionality you need is supported, of course. This is done using the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is below::”h]”hXIf you try to access an adapter from a userspace program, you will have to use the /dev interface. You will still have to check whether the functionality you need is supported, of course. This is done using the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is below:”…””}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KˆhjIh²hubjµ)”}”(hX§int file; if (file = open("/dev/i2c-0", O_RDWR) < 0) { /* Some kind of error handling */ exit(1); } if (ioctl(file, I2C_FUNCS, &funcs) < 0) { /* Some kind of error handling */ exit(1); } if (!(funcs & I2C_FUNC_SMBUS_QUICK)) { /* Oops, the needed functionality (SMBus write_quick function) is not available! */ exit(1); } /* Now it is safe to use the SMBus write_quick command */”h]”hX§int file; if (file = open("/dev/i2c-0", O_RDWR) < 0) { /* Some kind of error handling */ exit(1); } if (ioctl(file, I2C_FUNCS, &funcs) < 0) { /* Some kind of error handling */ exit(1); } if (!(funcs & I2C_FUNC_SMBUS_QUICK)) { /* Oops, the needed functionality (SMBus write_quick function) is not available! */ exit(1); } /* Now it is safe to use the SMBus write_quick command */”…””}”hjhsbah}”(h]”h ]”h"]”h$]”h&]”jÄjÅuh1j´h³hÊh´KŽhjIh²hubeh}”(h]”Œchecking-through-dev”ah ]”h"]”Œchecking through /dev”ah$]”h&]”uh1hµhh·h²hh³hÊh´K†ubeh}”(h]”Œi2c-smbus-functionality”ah ]”h"]”Œi2c/smbus functionality”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”jCŒfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j¨Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jƒj€hñhîjpjmjõjòjFjCj{jxuŒ nametypes”}”(jƒ‰hñ‰jp‰jõ‰jF‰j{‰uh}”(j€h·hîhËjmhôjòjsjCjøjxjIuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.