IICMUX(4)
π NAME π
iicmux β the I2C bus mulitiplexer framework. Bestie, yes, that's the exact spelling from the original NAME line β we keep it, periodt. This is the kernel interfaces manual page for iicmux(4), and it's giving βsupport framework, not a solo driverβ energy.
β¨ SYNOPSIS β¨
Wanna compile this driver into the kernel? Drop this line into your kernel configuration file:
device iicmux
Alternatively, load the driver as a module at boot time by putting this line in loader.conf(5):
iicmux_load="YES"
Note, bestie: it's usually not necessary to explicitly load the driver module, because it loads automatically along with the driver for the specific mux hardware you're using. Slay π
π DESCRIPTION π
The iicmux framework serves up support code to help implement drivers for all kinds of I2C bus multiplexer (mux) hardware. It is not a standalone driver β no cap β it's a collection of support functions and driver methods that individual mux hardware drivers use. It gets loaded automatically when a mux hardware driver needs it. This manual page gives you the overview of the I2C mux framework and how it behaves.
Generally speaking, an I2C mux is connected to an upstream I2C bus, and to one or more downstream I2C buses, and it can be commanded to connect any one of the downstream buses to the upstream bus. Some hardware may be able to connect multiple downstream buses at the same time, but that whole concept is not supported by iicmux. π
ββοΈ
The iicmux framework operates automatically when I2C slave devices initiate I/O. It does not require β or even allow β any external control to select the active downstream bus.
When there's no I/O in progress, the mux is said to be in the βidleβ state. Some mux hardware has the ability to disconnect all downstream buses when in an idle state. Other hardware must always have one of the downstream buses connected. Individual mux hardware drivers typically provide a way to select which downstream bus (if any) should be connected while in the idle state. In the absence of such configuration, whichever downstream bus was last used remains connected to the upstream bus. That's just how it is, iykyk. π¦
When an I2C slave device on a bus downstream of a mux initiates I/O, it first requests exclusive use of the bus by calling iicbus_request_bus(). This request is communicated to the bus's parent, which is the iicmux framework mux driver. Once exclusive bus ownership is obtained, the mux driver connects the upstream I2C bus to the downstream bus which hosts the slave device that requested bus ownership. The mux hardware maintains that upstream-to-downstream connection until the slave device calls iicbus_release_bus(). Before releasing ownership, the mux driver returns the mux hardware to the idle state. Main character energy: connect, hold, release, reset. π₯
π¦ FDT CONFIGURATION π¦
On an fdt(4) based system, an I2C mux device node is defined as a child node of its upstream I2C bus when the mux device is an I2C slave itself. It may be defined as a child node of any other bus or device in the system when it is not an I2C slave, in which case the i2c-parent property indicates which upstream bus the mux is attached to. In either case, the children of the mux node are additional I2C buses, which will have one or more I2C slave devices described in their child nodes.
Drivers using the iicmux framework conform to the standard i2c/i2c-mux.txt bindings document. Iconic. π
πΈ HINTS CONFIGURATION πΈ
On a device.hints(5) based system, these values are configurable for iicmux framework drivers:
hint.<driver>.<unit>.atβ the upstreamiicbus(4)theiicmuxinstance is attached to. π«Ά
When configured via hints, the driver automatically adds an iicbus instance for every downstream bus supported by the chip. There is currently no way to indicate used versus unused downstream buses. Not me wishing for more optionsβ¦ π
π SEE ALSO π
iicbus(4)β go peek, bestie π
π HISTORY π
The iicmux framework first appeared in FreeBSD 13.0. A whole moment. β¨
Cute sign-off: this page is from Debian, dated January 1, 2020, and it's the IICMUX(4) manual page. Byeee, mwah! ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms