€•<Œ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Œ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.”…””}”(hhýhž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.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒ Terminology”h]”hŒ Terminology”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhž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"hjhž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”}”Œ*”jRsuh1jChj@hŸh¶h KubhŒcaption”“”)”}”(hŒSimple I2C bus”h]”hŒSimple I2C bus”…””}”(hjXhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jVhŸh¶h K'hj@ubeh}”(h]”Œid1”ah ]”h"]”h$]”h&]”uh1j>hj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1j9hjhž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 ”…””}”(hjshžhhŸNh NubhŒstrong”“”)”}”(hŒ**controller**”h]”hŒ controller”…””}”(hj}hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjsubhŒ³ 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 ”…””}”(hjshžhhŸNh NubhŒliteral”“”)”}”(hŒ``drivers/i2c/busses/``”h]”hŒdrivers/i2c/busses/”…””}”(hj‘hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjsubhŒ subdirectory.”…””}”(hjshžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K)hjhž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&]”uh1j{hj©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&]”uh1jhj©ubhŒ2 subdirectory, or includes its own implementation.”…””}”(hj©hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K-hjhž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&]”uh1j{hjÛ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&]”uh1j{hjÛ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&]”uh1j{hjÛubhŒ.”…””}”(hjÛhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K2hjhž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 ”…””}”(hjhžhhŸNh Nubj)”}”(hŒ``drivers/gpio/``”h]”hŒ drivers/gpio/”…””}”(hj'hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ for GPIO expanders and ”…””}”(hjhžhhŸNh Nubj)”}”(hŒ``drivers/media/i2c/``”h]”hŒdrivers/media/i2c/”…””}”(hj9hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ for video-related chips.”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K9hjhž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.”…””}”(hjQhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K=hjhžhubh¢)”}”(hhh]”(h§)”}”(hŒSynonyms”h]”hŒSynonyms”…””}”(hjbhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj_hž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.”…””}”(hjphžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KDhj_hžhubeh}”(h]”Œsynonyms”ah ]”h"]”Œsynonyms”ah$]”h&]”uh1h¡hjhžhhŸh¶h KBubh¢)”}”(hhh]”(h§)”}”(hŒOutdated terminology”h]”hŒOutdated terminology”…””}”(hj‰hž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¡hjhž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·hîhëj²j¯jƒj€jªj§uŒ nametypes”}”(jº‰hîˆj²‰jƒ‰jª‰uh}”(j·h£hëhåj¯jj€j_j§j†jhj@uŒ 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”“”}”jîKs…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.