Lines Matching full:bus

12 kernel abstracts the MUX channels into logical I2C bus numbers. However, there
13 is a gap of knowledge to map from the I2C bus physical number and MUX topology
14 to logical I2C bus number. This doc is aimed to fill in this gap, so the
38 so you can find the I2C Sysfs under ``/sys/bus/i2c/devices``
43 the first number is I2C bus number, and the second number is I2C address.
47 blueline:/sys/bus/i2c/devices $ ls
51 ``i2c-2`` is an I2C bus whose number is 2, and ``2-0049`` is an I2C device
52 on bus 2 address 0x49 bound with a kernel driver.
60 (Physical) I2C Bus Controller
64 physical I2C bus controllers. The controllers are hardware and physical, and the
66 controllers. Linux kernel has I2C bus drivers under source directory
71 I2C Bus Physical Number
74 For each physical I2C bus controller, the system vendor may assign a physical
75 number to each controller. For example, the first I2C bus controller which has
78 Logical I2C Bus
81 Every I2C bus number you see in Linux I2C Sysfs is a logical I2C bus with a
85 Each logical I2C bus may be an abstraction of a physical I2C bus controller, or
87 MUX channel, whenever we access an I2C device via a such logical bus, the kernel
91 Physical I2C Bus
94 If the logical I2C bus is a direct abstraction of a physical I2C bus controller,
95 let us call it a physical I2C bus.
101 design of a board. It is actually possible to rename the I2C bus physical number
102 to a different number in logical I2C bus level in Device Tree Source (DTS) under
109 bus physical number the same as their corresponding logical I2C bus number,
113 bus has a number same as their I2C bus physical number.
115 Walk through Logical I2C Bus
125 i2c-7 (physical I2C bus controller 7)
138 Distinguish Physical and Logical I2C Bus
141 One simple way to distinguish between a physical I2C bus and a logical I2C bus,
142 is to read the symbolic link ``device`` under the I2C bus directory by using
146 in logical I2C bus directory which is fanned out from another I2C bus.
148 this logical I2C bus.
151 physical I2C bus, directly abstracting a physical I2C bus controller. For
154 $ readlink /sys/bus/i2c/devices/i2c-7/device
156 $ ls /sys/bus/i2c/devices/i2c-7/mux_device
157 ls: /sys/bus/i2c/devices/i2c-7/mux_device: No such file or directory
159 In this case, ``i2c-7`` is a physical I2C bus, so it does not have the symbolic
162 mean the physical I2C bus controller 7 of the system.
164 On the other hand, if the symbolic link points to another I2C bus, the I2C bus
165 presented by the current directory has to be a logical bus. The I2C bus pointed
166 by the link is the parent bus which may be either a physical I2C bus or a
167 logical one. In this case, the I2C bus presented by the current directory
168 abstracts an I2C MUX channel under the parent bus.
172 $ readlink /sys/bus/i2c/devices/i2c-73/device
174 $ readlink /sys/bus/i2c/devices/i2c-73/mux_device
177 ``i2c-73`` is a logical bus fanout by an I2C MUX under ``i2c-7``
179 Whenever we access an I2C device with bus 73, the kernel will always
183 Finding out Logical I2C Bus Number
186 In this section, we will describe how to find out the logical I2C bus number
190 In this example, we have a system which has a physical I2C bus 7 and not renamed
191 in DTS. There is a 4-channel MUX at address 0x71 on that bus. There is another
193 navigate through Sysfs and find out the logical I2C bus number of the channel 3
198 ~$ cd /sys/bus/i2c/devices/i2c-7
199 /sys/bus/i2c/devices/i2c-7$ ls
207 /sys/bus/i2c/devices/i2c-7$ cd 7-0071/
208 /sys/bus/i2c/devices/i2c-7/7-0071$ ls -l
215 /sys/bus/i2c/devices/i2c-7/7-0071$ readlink channel-1
219 with a logical I2C bus number of 73.
223 /sys/bus/i2c/devices/i2c-7/7-0071$ cd /sys/bus/i2c/devices/i2c-73
224 /sys/bus/i2c/devices/i2c-73$
227 /sys/bus/i2c/devices/i2c-7/7-0071$ cd channel-1
228 /sys/bus/i2c/devices/i2c-7/7-0071/channel-1$
231 /sys/bus/i2c/devices/i2c-7/7-0071$ cd ../i2c-73
232 /sys/bus/i2c/devices/i2c-7/i2c-73$
235 we can now find the 0x72 MUX and what logical I2C bus numbers
238 /sys/bus/i2c/devices/i2c-73$ ls
245 /sys/bus/i2c/devices/i2c-73$ cd 73-0072
246 /sys/bus/i2c/devices/i2c-73/73-0072$ ls
251 /sys/bus/i2c/devices/i2c-73/73-0072$ readlink channel-3
254 There, we find out the logical I2C bus number of the channel 3 of the 0x72 MUX
280 Pinned Logical I2C Bus Number
284 successfully probed, the kernel will assign the MUX channels with a logical bus
285 number based on the current biggest logical bus number incrementally. For
286 example, if the system has ``i2c-15`` as the highest logical bus number, and a
291 logical I2C bus number in the DTS. This doc will not go through the details on
297 I2C bus 2. The channel 2 of the MUX is defined as ``imux18`` in DTS,
298 and pinned to logical I2C bus number 18 with the line of ``i2c18 = &imux18;``
301 Take it further, it is possible to design a logical I2C bus number schema that
303 can pin the fanout channels of a MUX on bus 3 to start at 30. So 30 will be the
304 logical bus number of the channel 0 of the MUX on bus 3, and 37 will be the
305 logical bus number of the channel 7 of the MUX on bus 3.
310 In previous sections, we mostly covered the I2C bus. In this section, let us see
312 of ``${bus}-${addr}``. The ``${bus}`` part in the name is a logical I2C bus
323 /sys/bus/i2c/devices/i2c-73$ cat 73-0040/name
325 /sys/bus/i2c/devices/i2c-73$ cat 73-0070/name
327 /sys/bus/i2c/devices/i2c-73$ cat 73-0072/name
333 /sys/bus/i2c/devices/i2c-73$ readlink -f 73-0040/driver
334 /sys/bus/i2c/drivers/ina2xx
335 /sys/bus/i2c/devices/i2c-73$ readlink -f 73-0072/driver
336 /sys/bus/i2c/drivers/pca954x
342 /sys/bus/i2c/devices/i2c-73$ ls 73-0070/driver
344 /sys/bus/i2c/devices/i2c-73$ dmesg | grep 73-0070
356 These symbolic links point to their logical I2C bus directories::
358 /sys/bus/i2c/devices/i2c-73$ ls -l 73-0072/channel-*
376 /sys/bus/i2c/devices/i2c-73/73-0040/hwmon/hwmon17$ ls