€•Ù<Œ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/summary”Œ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/summary”Œ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/summary”Œ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/summary”Œ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/summary”Œ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/summary”Œ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/summary”Œ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ŒIntroduction to I2C and SMBus”h]”hŒIntroduction to I2C and SMBus”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ9/var/lib/git/docbuild/linux/Documentation/i2c/summary.rst”h´KubhŒ paragraph”“”)”}”(hX%I²C (pronounce: I squared C and written I2C in the kernel documentation) is a protocol developed by Philips. It is a two-wire protocol with variable speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides an inexpensive bus for connecting many types of devices with infrequent or low bandwidth communications needs. I2C is widely used with embedded systems. Some systems use variants that don't meet branding requirements, and so are not advertised as being I2C but come under different names, e.g. TWI (Two Wire Interface), IIC.”h]”hX'I²C (pronounce: I squared C and written I2C in the kernel documentation) is a protocol developed by Philips. It is a two-wire protocol with variable speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides an inexpensive bus for connecting many types of devices with infrequent or low bandwidth communications needs. I2C is widely used with embedded systems. Some systems use variants that don’t meet branding requirements, and so are not advertised as being I2C but come under different names, e.g. TWI (Two Wire Interface), IIC.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒÖThe latest official I2C specification is the `"I²C-bus specification and user manual" (UM10204) `_ published by NXP Semiconductors, version 7 as of this writing.”h]”(hŒ-The latest official I2C specification is the ”…””}”(hhÛh²hh³Nh´NubhŒ reference”“”)”}”(hŒj`"I²C-bus specification and user manual" (UM10204) `_”h]”hŒ6“I²C-bus specification and user manual†(UM10204)”…””}”(hhåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ2"I²C-bus specification and user manual" (UM10204)”Œrefuri”Œ2https://www.nxp.com/docs/en/user-guide/UM10204.pdf”uh1hãhhÛubhŒtarget”“”)”}”(hŒ5 ”h]”h}”(h]”Œ-i2c-bus-specification-and-user-manual-um10204”ah ]”h"]”Œ2"i²c-bus specification and user manual" (um10204)”ah$]”h&]”Œrefuri”höuh1h÷Œ referenced”KhhÛubhŒ? published by NXP Semiconductors, version 7 as of this writing.”…””}”(hhÛh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hX“SMBus (System Management Bus) is based on the I2C protocol, and is mostly a subset of I2C protocols and signaling. Many I2C devices will work on an SMBus, but some SMBus protocols add semantics beyond what is required to achieve I2C branding. Modern PC mainboards rely on SMBus. The most common devices connected through SMBus are RAM modules configured using I2C EEPROMs, and hardware monitoring chips.”h]”hX“SMBus (System Management Bus) is based on the I2C protocol, and is mostly a subset of I2C protocols and signaling. Many I2C devices will work on an SMBus, but some SMBus protocols add semantics beyond what is required to achieve I2C branding. Modern PC mainboards rely on SMBus. The most common devices connected through SMBus are RAM modules configured using I2C EEPROMs, and hardware monitoring chips.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hXBecause the SMBus is mostly a subset of the generalized I2C bus, we can use its protocols on many I2C systems. However, there are systems that don't meet both SMBus and I2C electrical constraints; and others which can't implement all the common SMBus protocol semantics or messages.”h]”hXBecause the SMBus is mostly a subset of the generalized I2C bus, we can use its protocols on many I2C systems. However, there are systems that don’t meet both SMBus and I2C electrical constraints; and others which can’t implement all the common SMBus protocol semantics or messages.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ Terminology”h]”hŒ Terminology”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj-h²hh³hÊh´K ubhÌ)”}”(hŒOThe I2C bus connects one or more controller chips and one or more target chips.”h]”hŒOThe I2C bus connects one or more controller chips and one or more target chips.”…””}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K"hj-h²hubŒkfigure”Œ kernel_figure”“”)”}”(hhh]”hŒfigure”“”)”}”(hhh]”(hŒimage”“”)”}”(hŒp.. kernel-figure:: i2c_bus.svg :alt: Simple I2C bus with one controller and 3 targets Simple I2C bus ”h]”h}”(h]”h ]”h"]”h$]”h&]”Œalt”Œ0Simple I2C bus with one controller and 3 targets”Œuri”Œi2c/i2c_bus.svg”Œ candidates”}”Œ*”jfsuh1jWhjTh³hÊh´KubhŒcaption”“”)”}”(hŒSimple I2C bus”h]”hŒSimple I2C bus”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÊh´K'hjTubeh}”(h]”Œid1”ah ]”h"]”h$]”h&]”uh1jRhjOubah}”(h]”h ]”h"]”h$]”h&]”uh1jMhj-h²hh³hÊh´NubhÌ)”}”(hŒàA **controller** chip is a node that starts communications with targets. In the Linux kernel implementation it is also called an "adapter" or "bus". Controller drivers are usually in the ``drivers/i2c/busses/`` subdirectory.”h]”(hŒA ”…””}”(hj‡h²hh³Nh´NubhŒstrong”“”)”}”(hŒ**controller**”h]”hŒ controller”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‡ubhŒ³ chip is a node that starts communications with targets. In the Linux kernel implementation it is also called an “adapter†or “busâ€. Controller drivers are usually in the ”…””}”(hj‡h²hh³Nh´NubhŒliteral”“”)”}”(hŒ``drivers/i2c/busses/``”h]”hŒdrivers/i2c/busses/”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j£hj‡ubhŒ subdirectory.”…””}”(hj‡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K)hj-h²hubhÌ)”}”(hŒüAn **algorithm** contains general code that can be used to implement a whole class of I2C controllers. Each specific controller driver either depends on an algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes its own implementation.”h]”(hŒAn ”…””}”(hj½h²hh³Nh´Nubj)”}”(hŒ **algorithm**”h]”hŒ algorithm”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj½ubhŒ¤ contains general code that can be used to implement a whole class of I2C controllers. Each specific controller driver either depends on an algorithm driver in the ”…””}”(hj½h²hh³Nh´Nubj¤)”}”(hŒ``drivers/i2c/algos/``”h]”hŒdrivers/i2c/algos/”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j£hj½ubhŒ2 subdirectory, or includes its own implementation.”…””}”(hj½h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K-hj-h²hubhÌ)”}”(hXšA **target** chip is a node that responds to communications when addressed by a controller. In the Linux kernel implementation it is also called a "client". While targets are usually separate external chips, Linux can also act as a target (needs hardware support) and respond to another controller on the bus. This is then called a **local target**. In contrast, an external chip is called a **remote target**.”h]”(hŒA ”…””}”(hjïh²hh³Nh´Nubj)”}”(hŒ **target**”h]”hŒtarget”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjïubhXD chip is a node that responds to communications when addressed by a controller. In the Linux kernel implementation it is also called a “clientâ€. While targets are usually separate external chips, Linux can also act as a target (needs hardware support) and respond to another controller on the bus. This is then called a ”…””}”(hjïh²hh³Nh´Nubj)”}”(hŒ**local target**”h]”hŒ local target”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjïubhŒ,. In contrast, an external chip is called a ”…””}”(hjïh²hh³Nh´Nubj)”}”(hŒ**remote target**”h]”hŒ remote target”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjïubhŒ.”…””}”(hjïh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K2hj-h²hubhÌ)”}”(hŒ±Target drivers are kept in a directory specific to the feature they provide, for example ``drivers/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for video-related chips.”h]”(hŒYTarget drivers are kept in a directory specific to the feature they provide, for example ”…””}”(hj3h²hh³Nh´Nubj¤)”}”(hŒ``drivers/gpio/``”h]”hŒ drivers/gpio/”…””}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j£hj3ubhŒ for GPIO expanders and ”…””}”(hj3h²hh³Nh´Nubj¤)”}”(hŒ``drivers/media/i2c/``”h]”hŒdrivers/media/i2c/”…””}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j£hj3ubhŒ for video-related chips.”…””}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hj-h²hubhÌ)”}”(hŒ©For the example configuration in the figure above, you will need one driver for the I2C controller, and drivers for your I2C targets. Usually one driver for each target.”h]”hŒ©For the example configuration in the figure above, you will need one driver for the I2C controller, and drivers for your I2C targets. Usually one driver for each target.”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K=hj-h²hubh¶)”}”(hhh]”(h»)”}”(hŒSynonyms”h]”hŒSynonyms”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjsh²hh³hÊh´KBubhÌ)”}”(hX@As mentioned above, the Linux I2C implementation historically uses the terms "adapter" for controller and "client" for target. A number of data structures have these synonyms in their name. So, when discussing implementation details, you should be aware of these terms as well. The official wording is preferred, though.”h]”hXHAs mentioned above, the Linux I2C implementation historically uses the terms “adapter†for controller and “client†for target. A number of data structures have these synonyms in their name. So, when discussing implementation details, you should be aware of these terms as well. The official wording is preferred, though.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KDhjsh²hubeh}”(h]”Œsynonyms”ah ]”h"]”Œsynonyms”ah$]”h&]”uh1hµhj-h²hh³hÊh´KBubh¶)”}”(hhh]”(h»)”}”(hŒOutdated terminology”h]”hŒOutdated terminology”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjšh²hh³hÊh´KKubhÌ)”}”(hXËIn earlier I2C specifications, controller was named "master" and target was named "slave". These terms have been obsoleted with v7 of the specification and their use is also discouraged by the Linux Kernel Code of Conduct. You may still find them in references to documentation which has not been updated. The general attitude, however, is to use the inclusive terms: controller and target. Work to replace the old terminology in the Linux Kernel is on-going.”h]”hXÓIn earlier I2C specifications, controller was named “master†and target was named “slaveâ€. These terms have been obsoleted with v7 of the specification and their use is also discouraged by the Linux Kernel Code of Conduct. You may still find them in references to documentation which has not been updated. The general attitude, however, is to use the inclusive terms: controller and target. Work to replace the old terminology in the Linux Kernel is on-going.”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KMhjšh²hubeh}”(h]”Œoutdated-terminology”ah ]”h"]”Œoutdated terminology”ah$]”h&]”uh1hµhj-h²hh³hÊh´KKubeh}”(h]”Œ terminology”ah ]”h"]”Œ terminology”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubeh}”(h]”Œintroduction-to-i2c-and-smbus”ah ]”h"]”Œintroduction to i2c and smbus”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”Œentry”Œ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ËjhÿjÆjÃj—j”j¾j»uŒ nametypes”}”(jΉjˆjƉj—‰j¾‰uh}”(jËh·hÿhùjÃj-j”jsj»jšj|jTuŒ 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”“”}”jKs…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.