€•ÌŒ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-sysfs”Œ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-sysfs”Œ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-sysfs”Œ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-sysfs”Œ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-sysfs”Œ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/i2c-sysfs”Œ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-sysfs”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ;/var/lib/git/docbuild/linux/Documentation/i2c/i2c-sysfs.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒLinux I2C Sysfs”h]”hŒLinux I2C Sysfs”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒOverview”h]”hŒOverview”…”�”}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hX‡I2C topology can be complex because of the existence of I2C MUX (I2C Multiplexer). The Linux kernel abstracts the MUX channels into logical I2C bus numbers. However, there is a gap of knowledge to map from the I2C bus physical number and MUX topology to logical I2C bus number. This doc is aimed to fill in this gap, so the audience (hardware engineers and new software developers for example) can learn the concept of logical I2C buses in the kernel, by knowing the physical I2C topology and navigating through the I2C sysfs in Linux shell. This knowledge is useful and essential to use ``i2c-tools`` for the purpose of development and debugging.”h]”(hXLI2C topology can be complex because of the existence of I2C MUX (I2C Multiplexer). The Linux kernel abstracts the MUX channels into logical I2C bus numbers. However, there is a gap of knowledge to map from the I2C bus physical number and MUX topology to logical I2C bus number. This doc is aimed to fill in this gap, so the audience (hardware engineers and new software developers for example) can learn the concept of logical I2C buses in the kernel, by knowing the physical I2C topology and navigating through the I2C sysfs in Linux shell. This knowledge is useful and essential to use ”…”�”}”(hhðh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``i2c-tools``”h]”hŒ i2c-tools”…”�”}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhhðubhŒ. for the purpose of development and debugging.”…”�”}”(hhðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒTarget audience”h]”hŒTarget audience”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´Kubhï)�”}”(hŒlPeople who need to use Linux shell to interact with I2C subsystem on a system which the Linux is running on.”h]”hŒlPeople who need to use Linux shell to interact with I2C subsystem on a system which the Linux is running on.”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjh²hubeh}”(h]”Œtarget-audience”ah ]”h"]”Œtarget audience”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Prerequisites”h]”hŒ Prerequisites”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj9h²hh³hÇh´KubhŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒFKnowledge of general Linux shell file system commands and operations. ”h]”hï)�”}”(hŒEKnowledge of general Linux shell file system commands and operations.”h]”hŒEKnowledge of general Linux shell file system commands and operations.”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jOhjLh²hh³hÇh´NubjP)�”}”(hŒ4General knowledge of I2C, I2C MUX and I2C topology. ”h]”hï)�”}”(hŒ3General knowledge of I2C, I2C MUX and I2C topology.”h]”hŒ3General knowledge of I2C, I2C MUX and I2C topology.”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hjiubah}”(h]”h ]”h"]”h$]”h&]”uh1jOhjLh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jJhj9h²hh³hÇh´Kubeh}”(h]”Œ prerequisites”ah ]”h"]”Œ prerequisites”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´Kubeh}”(h]”Œoverview”ah ]”h"]”Œoverview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒLocation of I2C Sysfs”h]”hŒLocation of I2C Sysfs”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjœh²hh³hÇh´K#ubhï)�”}”(hXÞTypically, the Linux Sysfs filesystem is mounted at the ``/sys`` directory, so you can find the I2C Sysfs under ``/sys/bus/i2c/devices`` where you can directly ``cd`` to it. There is a list of symbolic links under that directory. The links that start with ``i2c-`` are I2C buses, which may be either physical or logical. The other links that begin with numbers and end with numbers are I2C devices, where the first number is I2C bus number, and the second number is I2C address.”h]”(hŒ8Typically, the Linux Sysfs filesystem is mounted at the ”…”�”}”(hj­h²hh³Nh´Nubhù)�”}”(hŒ``/sys``”h]”hŒ/sys”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj­ubhŒ0 directory, so you can find the I2C Sysfs under ”…”�”}”(hj­h²hh³Nh´Nubhù)�”}”(hŒ``/sys/bus/i2c/devices``”h]”hŒ/sys/bus/i2c/devices”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj­ubhŒ where you can directly ”…”�”}”(hj­h²hh³Nh´Nubhù)�”}”(hŒ``cd``”h]”hŒcd”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj­ubhŒZ to it. There is a list of symbolic links under that directory. The links that start with ”…”�”}”(hj­h²hh³Nh´Nubhù)�”}”(hŒ``i2c-``”h]”hŒi2c-”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj­ubhŒÖ are I2C buses, which may be either physical or logical. The other links that begin with numbers and end with numbers are I2C devices, where the first number is I2C bus number, and the second number is I2C address.”…”�”}”(hj­h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K%hjœh²hubhï)�”}”(hŒ"Google Pixel 3 phone for example::”h]”hŒ!Google Pixel 3 phone for example:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K-hjœh²hubhŒ literal_block”“”)�”}”(hŒœblueline:/sys/bus/i2c/devices $ ls 0-0008 0-0061 1-0028 3-0043 4-0036 4-0041 i2c-1 i2c-3 0-000c 0-0066 2-0049 4-000b 4-0040 i2c-0 i2c-2 i2c-4”h]”hŒœblueline:/sys/bus/i2c/devices $ ls 0-0008 0-0061 1-0028 3-0043 4-0036 4-0041 i2c-1 i2c-3 0-000c 0-0066 2-0049 4-000b 4-0040 i2c-0 i2c-2 i2c-4”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K/hjœh²hubhï)�”}”(hŒ|``i2c-2`` is an I2C bus whose number is 2, and ``2-0049`` is an I2C device on bus 2 address 0x49 bound with a kernel driver.”h]”(hù)�”}”(hŒ ``i2c-2``”h]”hŒi2c-2”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj!ubhŒ& is an I2C bus whose number is 2, and ”…”�”}”(hj!h²hh³Nh´Nubhù)�”}”(hŒ ``2-0049``”h]”hŒ2-0049”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj!ubhŒC is an I2C device on bus 2 address 0x49 bound with a kernel driver.”…”�”}”(hj!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K3hjœh²hubeh}”(h]”Œlocation-of-i2c-sysfs”ah ]”h"]”Œlocation of i2c sysfs”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K#ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Terminology”h]”hŒ Terminology”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjWh²hh³hÇh´K7ubhï)�”}”(hŒEFirst, let us define some terms to avoid confusion in later sections.”h]”hŒEFirst, let us define some terms to avoid confusion in later sections.”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K9hjWh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ(Physical) I2C Bus Controller”h]”hŒ(Physical) I2C Bus Controller”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjvh²hh³hÇh´Khjvh²hubeh}”(h]”Œphysical-i2c-bus-controller”ah ]”h"]”Œ(physical) i2c bus controller”ah$]”h&]”uh1hÈhjWh²hh³hÇh´K is a physical I2C bus, so it does not have the symbolic link ”…”�”}”(hj‰h²hh³Nh´Nubhù)�”}”(hŒ``mux_device``”h]”hŒ mux_device”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj‰ubhŒÁ under its directory. And if the kernel software developer follows the common practice by not renaming physical I2C buses, this should also mean the physical I2C bus controller 7 of the system.”…”�”}”(hj‰h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kœhjæh²hubhï)�”}”(hXeOn the other hand, if the symbolic link points to another I2C bus, the I2C bus presented by the current directory has to be a logical bus. The I2C bus pointed by the link is the parent bus which may be either a physical I2C bus or a logical one. In this case, the I2C bus presented by the current directory abstracts an I2C MUX channel under the parent bus.”h]”hXeOn the other hand, if the symbolic link points to another I2C bus, the I2C bus presented by the current directory has to be a logical bus. The I2C bus pointed by the link is the parent bus which may be either a physical I2C bus or a logical one. In this case, the I2C bus presented by the current directory abstracts an I2C MUX channel under the parent bus.”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¡hjæh²hubhï)�”}”(hŒ For example::”h]”hŒ For example:”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K§hjæh²hubj)�”}”(hŒu$ readlink /sys/bus/i2c/devices/i2c-73/device ../../i2c-7 $ readlink /sys/bus/i2c/devices/i2c-73/mux_device ../7-0071”h]”hŒu$ readlink /sys/bus/i2c/devices/i2c-73/device ../../i2c-7 $ readlink /sys/bus/i2c/devices/i2c-73/mux_device ../7-0071”…”�”}”hj×sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K©hjæh²hubhï)�”}”(hŒü``i2c-73`` is a logical bus fanout by an I2C MUX under ``i2c-7`` whose I2C address is 0x71. Whenever we access an I2C device with bus 73, the kernel will always switch the I2C MUX addressed 0x71 to the proper channel for you as part of the abstraction.”h]”(hù)�”}”(hŒ ``i2c-73``”h]”hŒi2c-73”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjåubhŒ- is a logical bus fanout by an I2C MUX under ”…”�”}”(hjåh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-7``”h]”hŒi2c-7”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjåubhŒ¼ whose I2C address is 0x71. Whenever we access an I2C device with bus 73, the kernel will always switch the I2C MUX addressed 0x71 to the proper channel for you as part of the abstraction.”…”�”}”(hjåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K®hjæh²hubeh}”(h]”Œ(distinguish-physical-and-logical-i2c-bus”ah ]”h"]”Œ(distinguish physical and logical i2c bus”ah$]”h&]”uh1hÈhj¹h²hh³hÇh´KˆubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ"Finding out Logical I2C Bus Number”h]”hŒ"Finding out Logical I2C Bus Number”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´Kµubhï)�”}”(hŒ¬In this section, we will describe how to find out the logical I2C bus number representing certain I2C MUX channels based on the knowledge of physical hardware I2C topology.”h]”hŒ¬In this section, we will describe how to find out the logical I2C bus number representing certain I2C MUX channels based on the knowledge of physical hardware I2C topology.”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K·hjh²hubhï)�”}”(hXKIn this example, we have a system which has a physical I2C bus 7 and not renamed in DTS. There is a 4-channel MUX at address 0x71 on that bus. There is another 8-channel MUX at address 0x72 behind the channel 1 of the 0x71 MUX. Let us navigate through Sysfs and find out the logical I2C bus number of the channel 3 of the 0x72 MUX.”h]”hXKIn this example, we have a system which has a physical I2C bus 7 and not renamed in DTS. There is a 4-channel MUX at address 0x71 on that bus. There is another 8-channel MUX at address 0x72 behind the channel 1 of the 0x71 MUX. Let us navigate through Sysfs and find out the logical I2C bus number of the channel 3 of the 0x72 MUX.”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K»hjh²hubhï)�”}”(hŒ7First of all, let us go to the directory of ``i2c-7``::”h]”(hŒ,First of all, let us go to the directory of ”…”�”}”(hjHh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-7``”h]”hŒi2c-7”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjHubhŒ:”…”�”}”(hjHh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÁhjh²hubj)�”}”(hŒô~$ cd /sys/bus/i2c/devices/i2c-7 /sys/bus/i2c/devices/i2c-7$ ls 7-0071 i2c-60 name subsystem delete_device i2c-73 new_device uevent device i2c-86 of_node i2c-203 i2c-dev power”h]”hŒô~$ cd /sys/bus/i2c/devices/i2c-7 /sys/bus/i2c/devices/i2c-7$ ls 7-0071 i2c-60 name subsystem delete_device i2c-73 new_device uevent device i2c-86 of_node i2c-203 i2c-dev power”…”�”}”hjhsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÃhjh²hubhï)�”}”(hŒ8There, we see the 0x71 MUX as ``7-0071``. Go inside it::”h]”(hŒThere, we see the 0x71 MUX as ”…”�”}”(hjvh²hh³Nh´Nubhù)�”}”(hŒ ``7-0071``”h]”hŒ7-0071”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjvubhŒ. Go inside it:”…”�”}”(hjvh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÊhjh²hubj)�”}”(hŒÒ/sys/bus/i2c/devices/i2c-7$ cd 7-0071/ /sys/bus/i2c/devices/i2c-7/7-0071$ ls -l channel-0 channel-3 modalias power channel-1 driver name subsystem channel-2 idle_state of_node uevent”h]”hŒÒ/sys/bus/i2c/devices/i2c-7$ cd 7-0071/ /sys/bus/i2c/devices/i2c-7/7-0071$ ls -l channel-0 channel-3 modalias power channel-1 driver name subsystem channel-2 idle_state of_node uevent”…”�”}”hj–sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÌhjh²hubhï)�”}”(hŒ=Read the link ``channel-1`` using ``readlink`` or ``ls -l``::”h]”(hŒRead the link ”…”�”}”(hj¤h²hh³Nh´Nubhù)�”}”(hŒ ``channel-1``”h]”hŒ channel-1”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj¤ubhŒ using ”…”�”}”(hj¤h²hh³Nh´Nubhù)�”}”(hŒ ``readlink``”h]”hŒreadlink”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj¤ubhŒ or ”…”�”}”(hj¤h²hh³Nh´Nubhù)�”}”(hŒ ``ls -l``”h]”hŒls -l”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj¤ubhŒ:”…”�”}”(hj¤h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÒhjh²hubj)�”}”(hŒ?/sys/bus/i2c/devices/i2c-7/7-0071$ readlink channel-1 ../i2c-73”h]”hŒ?/sys/bus/i2c/devices/i2c-7/7-0071$ readlink channel-1 ../i2c-73”…”�”}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÔhjh²hubhï)�”}”(hŒ­We find out that the channel 1 of 0x71 MUX on ``i2c-7`` is assigned with a logical I2C bus number of 73. Let us continue the journey to directory ``i2c-73`` in either ways::”h]”(hŒ.We find out that the channel 1 of 0x71 MUX on ”…”�”}”(hjöh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-7``”h]”hŒi2c-7”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjöubhŒ[ is assigned with a logical I2C bus number of 73. Let us continue the journey to directory ”…”�”}”(hjöh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-73``”h]”hŒi2c-73”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjöubhŒ in either ways:”…”�”}”(hjöh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K×hjh²hubj)�”}”(hXi# cd to i2c-73 under I2C Sysfs root /sys/bus/i2c/devices/i2c-7/7-0071$ cd /sys/bus/i2c/devices/i2c-73 /sys/bus/i2c/devices/i2c-73$ # cd the channel symbolic link /sys/bus/i2c/devices/i2c-7/7-0071$ cd channel-1 /sys/bus/i2c/devices/i2c-7/7-0071/channel-1$ # cd the link content /sys/bus/i2c/devices/i2c-7/7-0071$ cd ../i2c-73 /sys/bus/i2c/devices/i2c-7/i2c-73$”h]”hXi# cd to i2c-73 under I2C Sysfs root /sys/bus/i2c/devices/i2c-7/7-0071$ cd /sys/bus/i2c/devices/i2c-73 /sys/bus/i2c/devices/i2c-73$ # cd the channel symbolic link /sys/bus/i2c/devices/i2c-7/7-0071$ cd channel-1 /sys/bus/i2c/devices/i2c-7/7-0071/channel-1$ # cd the link content /sys/bus/i2c/devices/i2c-7/7-0071$ cd ../i2c-73 /sys/bus/i2c/devices/i2c-7/i2c-73$”…”�”}”hj(sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÛhjh²hubhï)�”}”(hŒ­Either ways, you will end up in the directory of ``i2c-73``. Similar to above, we can now find the 0x72 MUX and what logical I2C bus numbers that its channels are assigned::”h]”(hŒ1Either ways, you will end up in the directory of ”…”�”}”(hj6h²hh³Nh´Nubhù)�”}”(hŒ ``i2c-73``”h]”hŒi2c-73”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj6ubhŒq. Similar to above, we can now find the 0x72 MUX and what logical I2C bus numbers that its channels are assigned:”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kçhjh²hubj)�”}”(hXŽ/sys/bus/i2c/devices/i2c-73$ ls 73-0040 device i2c-83 new_device 73-004e i2c-78 i2c-84 of_node 73-0050 i2c-79 i2c-85 power 73-0070 i2c-80 i2c-dev subsystem 73-0072 i2c-81 mux_device uevent delete_device i2c-82 name /sys/bus/i2c/devices/i2c-73$ cd 73-0072 /sys/bus/i2c/devices/i2c-73/73-0072$ ls channel-0 channel-4 driver of_node channel-1 channel-5 idle_state power channel-2 channel-6 modalias subsystem channel-3 channel-7 name uevent /sys/bus/i2c/devices/i2c-73/73-0072$ readlink channel-3 ../i2c-81”h]”hXŽ/sys/bus/i2c/devices/i2c-73$ ls 73-0040 device i2c-83 new_device 73-004e i2c-78 i2c-84 of_node 73-0050 i2c-79 i2c-85 power 73-0070 i2c-80 i2c-dev subsystem 73-0072 i2c-81 mux_device uevent delete_device i2c-82 name /sys/bus/i2c/devices/i2c-73$ cd 73-0072 /sys/bus/i2c/devices/i2c-73/73-0072$ ls channel-0 channel-4 driver of_node channel-1 channel-5 idle_state power channel-2 channel-6 modalias subsystem channel-3 channel-7 name uevent /sys/bus/i2c/devices/i2c-73/73-0072$ readlink channel-3 ../i2c-81”…”�”}”hjVsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Këhjh²hubhï)�”}”(hŒ¼There, we find out the logical I2C bus number of the channel 3 of the 0x72 MUX is 81. We can later use this number to switch to its own I2C Sysfs directory or issue ``i2c-tools`` commands.”h]”(hŒ¥There, we find out the logical I2C bus number of the channel 3 of the 0x72 MUX is 81. We can later use this number to switch to its own I2C Sysfs directory or issue ”…”�”}”(hjdh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-tools``”h]”hŒ i2c-tools”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjdubhŒ commands.”…”�”}”(hjdh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kûhjh²hubhï)�”}”(hX8Tip: Once you understand the I2C topology with MUX, command `i2cdetect -l `_ in `I2C Tools `_ can give you an overview of the I2C topology easily, if it is available on your system. For example::”h]”(hŒ`_”h]”hŒ i2cdetect -l”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ i2cdetect -l”Œrefuri”ŒBhttps://manpages.debian.org/unstable/i2c-tools/i2cdetect.8.en.html”uh1jŒhj„ubhŒtarget”“”)�”}”(hŒE ”h]”h}”(h]”Œ i2cdetect-l”ah ]”h"]”Œ i2cdetect -l”ah$]”h&]”Œrefuri”jŸuh1j Œ referenced”Khj„ubhŒ in ”…”�”}”(hj„h²hh³Nh´Nubj�)�”}”(hŒ>`I2C Tools `_”h]”hŒ I2C Tools”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ I2C Tools”jžŒ/https://i2c.wiki.kernel.org/index.php/I2C_Tools”uh1jŒhj„ubj¡)�”}”(hŒ2 ”h]”h}”(h]”Œ i2c-tools”ah ]”h"]”Œ i2c tools”ah$]”h&]”Œrefuri”jÄuh1j j¯Khj„ubhŒe can give you an overview of the I2C topology easily, if it is available on your system. For example:”…”�”}”(hj„h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kÿhjh²hubj)�”}”(hX'$ i2cdetect -l | grep -e '\-73' -e _7 | sort -V i2c-7 i2c npcm_i2c_7 I2C adapter i2c-73 i2c i2c-7-mux (chan_id 1) I2C adapter i2c-78 i2c i2c-73-mux (chan_id 0) I2C adapter i2c-79 i2c i2c-73-mux (chan_id 1) I2C adapter i2c-80 i2c i2c-73-mux (chan_id 2) I2C adapter i2c-81 i2c i2c-73-mux (chan_id 3) I2C adapter i2c-82 i2c i2c-73-mux (chan_id 4) I2C adapter i2c-83 i2c i2c-73-mux (chan_id 5) I2C adapter i2c-84 i2c i2c-73-mux (chan_id 6) I2C adapter i2c-85 i2c i2c-73-mux (chan_id 7) I2C adapter”h]”hX'$ i2cdetect -l | grep -e '\-73' -e _7 | sort -V i2c-7 i2c npcm_i2c_7 I2C adapter i2c-73 i2c i2c-7-mux (chan_id 1) I2C adapter i2c-78 i2c i2c-73-mux (chan_id 0) I2C adapter i2c-79 i2c i2c-73-mux (chan_id 1) I2C adapter i2c-80 i2c i2c-73-mux (chan_id 2) I2C adapter i2c-81 i2c i2c-73-mux (chan_id 3) I2C adapter i2c-82 i2c i2c-73-mux (chan_id 4) I2C adapter i2c-83 i2c i2c-73-mux (chan_id 5) I2C adapter i2c-84 i2c i2c-73-mux (chan_id 6) I2C adapter i2c-85 i2c i2c-73-mux (chan_id 7) I2C adapter”…”�”}”hjÜsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´M hjh²hubeh}”(h]”Œ"finding-out-logical-i2c-bus-number”ah ]”h"]”Œ"finding out logical i2c bus number”ah$]”h&]”uh1hÈhj¹h²hh³hÇh´KµubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPinned Logical I2C Bus Number”h]”hŒPinned Logical I2C Bus Number”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjòh²hh³hÇh´Mubhï)�”}”(hXÄIf not specified in DTS, when an I2C MUX driver is applied and the MUX device is successfully probed, the kernel will assign the MUX channels with a logical bus number based on the current biggest logical bus number incrementally. For example, if the system has ``i2c-15`` as the highest logical bus number, and a 4-channel MUX is applied successfully, we will have ``i2c-16`` for the MUX channel 0, and all the way to ``i2c-19`` for the MUX channel 3.”h]”(hXIf not specified in DTS, when an I2C MUX driver is applied and the MUX device is successfully probed, the kernel will assign the MUX channels with a logical bus number based on the current biggest logical bus number incrementally. For example, if the system has ”…”�”}”(hjh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-15``”h]”hŒi2c-15”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjubhŒ^ as the highest logical bus number, and a 4-channel MUX is applied successfully, we will have ”…”�”}”(hjh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-16``”h]”hŒi2c-16”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjubhŒ+ for the MUX channel 0, and all the way to ”…”�”}”(hjh²hh³Nh´Nubhù)�”}”(hŒ ``i2c-19``”h]”hŒi2c-19”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjubhŒ for the MUX channel 3.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjòh²hubhï)�”}”(hXThe kernel software developer is able to pin the fanout MUX channels to a static logical I2C bus number in the DTS. This doc will not go through the details on how to implement this in DTS, but we can see an example in: ``arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts``”h]”(hŒÜThe kernel software developer is able to pin the fanout MUX channels to a static logical I2C bus number in the DTS. This doc will not go through the details on how to implement this in DTS, but we can see an example in: ”…”�”}”(hjGh²hh³Nh´Nubhù)�”}”(hŒ6``arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts``”h]”hŒ2arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjGubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjòh²hubhï)�”}”(hŒúIn the above example, there is an 8-channel I2C MUX at address 0x70 on physical I2C bus 2. The channel 2 of the MUX is defined as ``imux18`` in DTS, and pinned to logical I2C bus number 18 with the line of ``i2c18 = &imux18;`` in section ``aliases``.”h]”(hŒ‚In the above example, there is an 8-channel I2C MUX at address 0x70 on physical I2C bus 2. The channel 2 of the MUX is defined as ”…”�”}”(hjch²hh³Nh´Nubhù)�”}”(hŒ ``imux18``”h]”hŒimux18”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjcubhŒB in DTS, and pinned to logical I2C bus number 18 with the line of ”…”�”}”(hjch²hh³Nh´Nubhù)�”}”(hŒ``i2c18 = &imux18;``”h]”hŒi2c18 = &imux18;”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjcubhŒ in section ”…”�”}”(hjch²hh³Nh´Nubhù)�”}”(hŒ ``aliases``”h]”hŒaliases”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjcubhŒ.”…”�”}”(hjch²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M$hjòh²hubhï)�”}”(hXtTake it further, it is possible to design a logical I2C bus number schema that can be easily remembered by humans or calculated arithmetically. For example, we can pin the fanout channels of a MUX on bus 3 to start at 30. So 30 will be the logical bus number of the channel 0 of the MUX on bus 3, and 37 will be the logical bus number of the channel 7 of the MUX on bus 3.”h]”hXtTake it further, it is possible to design a logical I2C bus number schema that can be easily remembered by humans or calculated arithmetically. For example, we can pin the fanout channels of a MUX on bus 3 to start at 30. So 30 will be the logical bus number of the channel 0 of the MUX on bus 3, and 37 will be the logical bus number of the channel 7 of the MUX on bus 3.”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M)hjòh²hubeh}”(h]”Œpinned-logical-i2c-bus-number”ah ]”h"]”Œpinned logical i2c bus number”ah$]”h&]”uh1hÈhj¹h²hh³hÇh´Mubeh}”(h]”Œwalk-through-logical-i2c-bus”ah ]”h"]”Œwalk through logical i2c bus”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KqubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ I2C Devices”h]”hŒ I2C Devices”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÅh²hh³hÇh´M0ubhï)�”}”(hXKIn previous sections, we mostly covered the I2C bus. In this section, let us see what we can learn from the I2C device directory whose link name is in the format of ``${bus}-${addr}``. The ``${bus}`` part in the name is a logical I2C bus decimal number, while the ``${addr}`` part is a hex number of the I2C address of each device.”h]”(hŒ¥In previous sections, we mostly covered the I2C bus. In this section, let us see what we can learn from the I2C device directory whose link name is in the format of ”…”�”}”(hjÖh²hh³Nh´Nubhù)�”}”(hŒ``${bus}-${addr}``”h]”hŒ${bus}-${addr}”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjÖubhŒ. The ”…”�”}”(hjÖh²hh³Nh´Nubhù)�”}”(hŒ ``${bus}``”h]”hŒ${bus}”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjÖubhŒA part in the name is a logical I2C bus decimal number, while the ”…”�”}”(hjÖh²hh³Nh´Nubhù)�”}”(hŒ ``${addr}``”h]”hŒ${addr}”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjÖubhŒ8 part is a hex number of the I2C address of each device.”…”�”}”(hjÖh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M2hjÅh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒI2C Device Directory Content”h]”hŒI2C Device Directory Content”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´M9ubhï)�”}”(hŒÑInside each I2C device directory, there is a file named ``name``. This file tells what device name it was used for the kernel driver to probe this device. Use command ``cat`` to read its content. For example::”h]”(hŒ8Inside each I2C device directory, there is a file named ”…”�”}”(hj+h²hh³Nh´Nubhù)�”}”(hŒ``name``”h]”hŒname”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj+ubhŒg. This file tells what device name it was used for the kernel driver to probe this device. Use command ”…”�”}”(hj+h²hh³Nh´Nubhù)�”}”(hŒ``cat``”h]”hŒcat”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj+ubhŒ" to read its content. For example:”…”�”}”(hj+h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M;hjh²hubj)�”}”(hŒ /sys/bus/i2c/devices/i2c-73$ cat 73-0040/name ina230 /sys/bus/i2c/devices/i2c-73$ cat 73-0070/name pca9546 /sys/bus/i2c/devices/i2c-73$ cat 73-0072/name pca9547”h]”hŒ /sys/bus/i2c/devices/i2c-73$ cat 73-0040/name ina230 /sys/bus/i2c/devices/i2c-73$ cat 73-0070/name pca9546 /sys/bus/i2c/devices/i2c-73$ cat 73-0072/name pca9547”…”�”}”hj]sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´M?hjh²hubhï)�”}”(hŒjThere is a symbolic link named ``driver`` to tell what Linux kernel driver was used to probe this device::”h]”(hŒThere is a symbolic link named ”…”�”}”(hjkh²hh³Nh´Nubhù)�”}”(hŒ ``driver``”h]”hŒdriver”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjkubhŒ@ to tell what Linux kernel driver was used to probe this device:”…”�”}”(hjkh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MFhjh²hubj)�”}”(hŒ¨/sys/bus/i2c/devices/i2c-73$ readlink -f 73-0040/driver /sys/bus/i2c/drivers/ina2xx /sys/bus/i2c/devices/i2c-73$ readlink -f 73-0072/driver /sys/bus/i2c/drivers/pca954x”h]”hŒ¨/sys/bus/i2c/devices/i2c-73$ readlink -f 73-0040/driver /sys/bus/i2c/drivers/ina2xx /sys/bus/i2c/devices/i2c-73$ readlink -f 73-0072/driver /sys/bus/i2c/drivers/pca954x”…”�”}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´MIhjh²hubhï)�”}”(hŒ¶But if the link ``driver`` does not exist at the first place, it may mean that the kernel driver failed to probe this device due to some errors. The error may be found in ``dmesg``::”h]”(hŒBut if the link ”…”�”}”(hj™h²hh³Nh´Nubhù)�”}”(hŒ ``driver``”h]”hŒdriver”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj™ubhŒ‘ does not exist at the first place, it may mean that the kernel driver failed to probe this device due to some errors. The error may be found in ”…”�”}”(hj™h²hh³Nh´Nubhù)�”}”(hŒ ``dmesg``”h]”hŒdmesg”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj™ubhŒ:”…”�”}”(hj™h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MNhjh²hubj)�”}”(hŒÊ/sys/bus/i2c/devices/i2c-73$ ls 73-0070/driver ls: 73-0070/driver: No such file or directory /sys/bus/i2c/devices/i2c-73$ dmesg | grep 73-0070 pca954x 73-0070: probe failed pca954x 73-0070: probe failed”h]”hŒÊ/sys/bus/i2c/devices/i2c-73$ ls 73-0070/driver ls: 73-0070/driver: No such file or directory /sys/bus/i2c/devices/i2c-73$ dmesg | grep 73-0070 pca954x 73-0070: probe failed pca954x 73-0070: probe failed”…”�”}”hjËsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´MRhjh²hubhï)�”}”(hŒ�Depending on what the I2C device is and what kernel driver was used to probe the device, we may have different content in the device directory.”h]”hŒ�Depending on what the I2C device is and what kernel driver was used to probe the device, we may have different content in the device directory.”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MXhjh²hubeh}”(h]”Œi2c-device-directory-content”ah ]”h"]”Œi2c device directory content”ah$]”h&]”uh1hÈhjÅh²hh³hÇh´M9ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒI2C MUX Device”h]”hŒI2C MUX Device”…”�”}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjïh²hh³hÇh´M\ubhï)�”}”(hŒÓWhile you may be already aware of this in previous sections, an I2C MUX device will have symbolic link ``channel-*`` inside its device directory. These symbolic links point to their logical I2C bus directories::”h]”(hŒgWhile you may be already aware of this in previous sections, an I2C MUX device will have symbolic link ”…”�”}”(hj h²hh³Nh´Nubhù)�”}”(hŒ ``channel-*``”h]”hŒ channel-*”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj ubhŒ^ inside its device directory. These symbolic links point to their logical I2C bus directories:”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M^hjïh²hubj)�”}”(hX¤/sys/bus/i2c/devices/i2c-73$ ls -l 73-0072/channel-* lrwxrwxrwx ... 73-0072/channel-0 -> ../i2c-78 lrwxrwxrwx ... 73-0072/channel-1 -> ../i2c-79 lrwxrwxrwx ... 73-0072/channel-2 -> ../i2c-80 lrwxrwxrwx ... 73-0072/channel-3 -> ../i2c-81 lrwxrwxrwx ... 73-0072/channel-4 -> ../i2c-82 lrwxrwxrwx ... 73-0072/channel-5 -> ../i2c-83 lrwxrwxrwx ... 73-0072/channel-6 -> ../i2c-84 lrwxrwxrwx ... 73-0072/channel-7 -> ../i2c-85”h]”hX¤/sys/bus/i2c/devices/i2c-73$ ls -l 73-0072/channel-* lrwxrwxrwx ... 73-0072/channel-0 -> ../i2c-78 lrwxrwxrwx ... 73-0072/channel-1 -> ../i2c-79 lrwxrwxrwx ... 73-0072/channel-2 -> ../i2c-80 lrwxrwxrwx ... 73-0072/channel-3 -> ../i2c-81 lrwxrwxrwx ... 73-0072/channel-4 -> ../i2c-82 lrwxrwxrwx ... 73-0072/channel-5 -> ../i2c-83 lrwxrwxrwx ... 73-0072/channel-6 -> ../i2c-84 lrwxrwxrwx ... 73-0072/channel-7 -> ../i2c-85”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Mbhjïh²hubeh}”(h]”Œi2c-mux-device”ah ]”h"]”Œi2c mux device”ah$]”h&]”uh1hÈhjÅh²hh³hÇh´M\ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒI2C Sensor Device / Hwmon”h]”hŒI2C Sensor Device / Hwmon”…”�”}”(hj9 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj6 h²hh³hÇh´Mmubhï)�”}”(hX I2C sensor device is also common to see. If they are bound by a kernel hwmon (Hardware Monitoring) driver successfully, you will see a ``hwmon`` directory inside the I2C device directory. Keep digging into it, you will find the Hwmon Sysfs for the I2C sensor device::”h]”(hŒ‡I2C sensor device is also common to see. If they are bound by a kernel hwmon (Hardware Monitoring) driver successfully, you will see a ”…”�”}”(hjG h²hh³Nh´Nubhù)�”}”(hŒ ``hwmon``”h]”hŒhwmon”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1høhjG ubhŒz directory inside the I2C device directory. Keep digging into it, you will find the Hwmon Sysfs for the I2C sensor device:”…”�”}”(hjG h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mohj6 h²hubj)�”}”(hX¡/sys/bus/i2c/devices/i2c-73/73-0040/hwmon/hwmon17$ ls curr1_input in0_lcrit_alarm name subsystem device in1_crit power uevent in0_crit in1_crit_alarm power1_crit update_interval in0_crit_alarm in1_input power1_crit_alarm in0_input in1_lcrit power1_input in0_lcrit in1_lcrit_alarm shunt_resistor”h]”hX¡/sys/bus/i2c/devices/i2c-73/73-0040/hwmon/hwmon17$ ls curr1_input in0_lcrit_alarm name subsystem device in1_crit power uevent in0_crit in1_crit_alarm power1_crit update_interval in0_crit_alarm in1_input power1_crit_alarm in0_input in1_lcrit power1_input in0_lcrit in1_lcrit_alarm shunt_resistor”…”�”}”hjg sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Mthj6 h²hubhï)�”}”(hŒ3For more info on the Hwmon Sysfs, refer to the doc:”h]”hŒ3For more info on the Hwmon Sysfs, refer to the doc:”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M|hj6 h²hubhï)�”}”(hŒ../hwmon/sysfs-interface.rst”h]”hŒ../hwmon/sysfs-interface.rst”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M~hj6 h²hubeh}”(h]”Œi2c-sensor-device-hwmon”ah ]”h"]”Œi2c sensor device / hwmon”ah$]”h&]”uh1hÈhjÅh²hh³hÇh´MmubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ$Instantiate I2C Devices in I2C Sysfs”h]”hŒ$Instantiate I2C Devices in I2C Sysfs”…”�”}”(hjœ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj™ h²hh³hÇh´M�ubhï)�”}”(hŒURefer to section "Method 4: Instantiate from user-space" of instantiating-devices.rst”h]”hŒYRefer to section “Method 4: Instantiate from user-spaceâ€� of instantiating-devices.rst”…”�”}”(hjª h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mƒhj™ h²hubeh}”(h]”Œ$instantiate-i2c-devices-in-i2c-sysfs”ah ]”h"]”Œ$instantiate i2c devices in i2c sysfs”ah$]”h&]”uh1hÈhjÅh²hh³hÇh´M�ubeh}”(h]”Œ i2c-devices”ah ]”h"]”Œ i2c devices”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M0ubeh}”(h]”Œlinux-i2c-sysfs”ah ]”h"]”Œlinux i2c sysfs”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Ê j™j–j6j3j‘jŽjTjQj¶j³j¬j©jåjâjjjAj>j®j«jÂj¿jjjïjìj«j¨jÎjËjºj·jÅ j jìjéj3 j0 j– j“ j½ jº uŒ nametypes”}”(jÍ ‰j™‰j6‰j‘‰jT‰j¶‰j¬‰jå‰j‰jA‰j®‰j‰j‰jï‰j«ˆjΈjº‰jÅ ‰jì‰j3 ‰j– ‰j½ ‰uh}”(jÊ hÊj–hÝj3jjŽj9jQjœj³jWj©jvjâj¯jjèj>jj«jDj¿j¹jjæjìjj¨j¢jËjÅj·jòj jÅjéjj0 jïj“ j6 jº j™ 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”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.