IICMUX(4)
π IICMUX(4) π
okay bestie, buckle up, because today we're learning about iicmux β the I2C bus mulitiplexer framework β and no, that's not a typo, that's just how the original spells it and I refuse to touch it. we're in the Kernel Interfaces Manual, section 4, and this is gonna be so good.
β¨ NAME β¨
iicmux β I2C bus mulitiplexer framework π¦
πΈ SYNOPSIS πΈ
so if you wanna compile this driver straight into the kernel, you gotta drop this line into your kernel configuration file:
device iicmux
or, alternatively β if you're feeling more like a load-it-at-boot kind of girl β put this in loader.conf(5):
iicmux_load="YES"
heads up tho: you usually don't need to explicitly load the driver module, because it gets loaded automatically along with the driver for whatever specific mux hardware you're actually using. it's giving self-sufficient, honestly. π
π DESCRIPTION π
The iicmux framework is basically the support squad for implementing drivers for all kinds of I2C bus multiplexer (mux) hardware. important: iicmux is not a standalone driver. it's a collection of support functions and driver methods that individual mux hardware drivers use. it'll load itself automatically when a mux hardware driver needs it. and this manual page? it's your overview of the I2C mux framework and how it behaves. main character energy for a support library, honestly. π
so 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. now β some hardware can connect multiple downstream buses at the same time, but that concept is simply not supported by iicmux. it's giving monogamous. π
The iicmux framework operates automatically when I2C slave devices initiate I/O. it does not require (or even allow for) any external control to select the active downstream bus. it just knows. periodt.
When there's no I/O in progress, the mux is said to be in the βidleβ state. some mux hardware can disconnect all downstream buses while idle. other hardware must always have one of the downstream buses connected. individual mux hardware drivers typically provide a way to pick which downstream bus (if any) should be connected while idle. and in the absence of such configuration? whichever downstream bus was last used just... stays connected to the upstream bus. lowkey clingy but okay. β¨
Now here's the slay part β 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(). that request gets 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 hosting the slave device that requested bus ownership. and 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. iconic behavior, no notes. π
π 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 itself an I2C slave. π¦
It may also 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.
either way, the children of the mux node are additional I2C buses, and those will have one or more I2C slave devices described in their child nodes. it's giving family tree. πΈ
Drivers using the iicmux framework conform to the standard i2c/i2c-mux.txt bindings document.
π§ 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. however β there is currently no way to indicate used versus unused downstream buses. we simply do not have that feature yet, bestie. π
π₯ SEE ALSO π₯
π HISTORY π
The iicmux framework first appeared in FreeBSD 13.0. β
okay and that's the whole page, you ate that fr fr. this one came from the Debian crew, dated January 1, 2020, and it's the IICMUX(4) page in the Kernel Interfaces Manual β go forth and mux responsibly, bestie π«Άπ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- π the page's license: BSD-2-Clause
- Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms