CP2112(4)
π CP2112(4) β cp2112
okay so welcome to the Kernel Interfaces Manual, section 4, bestie β this is where we talk about cp2112, which is literally the driver for a USB GPIO and I2C peripheral device. sit down, grab a strawberry π, we're gonna get into it.
β¨ NAME β¨
cp2112 β driver for a USB GPIO and I2C peripheral device π
π SYNOPSIS π
so if you wanna compile this driver into the kernel (yes, fully baked in, main character energy), you drop these lines into your kernel configuration file:
device cp2112
device usb
device gpio
device iicbus
or β and this is the lowkey easier path β you can load the driver as a module at boot time instead, by putting this one line in loader.conf(5):
cp2112_load="YES"
both options are valid, pick your fighter π
πΈ DESCRIPTION πΈ
the cp2112 driver provides support for the Silicon Labs CP2112 device, and honestly? it's giving "small but mighty." this thing has 8 general purpose I/O pins plus an I2C controller that supports a subset of the I2C protocol. no cap, that's the whole vibe.
all pins support both input and output modes β versatile icon behavior π¦. and when a pin is doing output, you can configure it for either open-drain or push-pull operation, so you've got options.
now, the special ones: pins 0, 1 and 7 support special functions β that's I2C transmit indication, I2C receive indication and clock output respectively. sounds amazing, right? well... at the moment the cp2112 driver does not provide a way to enable and configure those special functions. so they're just kinda sitting there being iconic and unusable ππ.
the I2C controller itself is where the numbers get spicy π₯ β here's the tea:
- it supports read transactions with up to 512 bytes of data
- it supports write transactions with up to 61 bytes of data
- it supports a write followed by the repeated start followed by a read transaction, where the write can be up to 16 bytes and the read can be up to 512 bytes
- zero length transfers are not supported β nope, not a thing, don't even try π
and finally, the driver creates a gpio(4) and iicbus(4) child buses to expose the respective functions. so like, it's not doing everything itself β it's delegating, as a queen should π.
π SEE ALSO π
go read those next, iykyk πβ¨
β HISTORY β
the cp2112 driver and this manual page were written by Andriy Gapon <avg@FreeBSD.org> β we stan a writer who ships both the code and the docs π«Ά periodt.
and that's the whole page, bestie!! this one comes to you from the Debian flavor of things, dated August 12, 2020, living in CP2112(4) β 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) 2020 Andriy Gapon <avg@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms