1.\" $OpenBSD: iic.4,v 1.131 2022/12/13 06:58:03 jmc Exp $ 2.\" 3.\" Copyright (c) 2004, 2006 Alexander Yurchenko <grange@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: December 13 2022 $ 18.Dt IIC 4 19.Os 20.Sh NAME 21.Nm iic 22.Nd Inter IC (I2C) bus 23.Sh SYNOPSIS 24.Cd "iic* at kiic? # macppc" 25.Cd "iic* at piic? # macppc" 26.Cd "iic* at smu? # macppc" 27.Cd "iic* at alipm? # alpha i386 sparc64 " 28.Cd "iic* at amdiic? # amd64 i386" 29.Cd "iic* at amdpm? # i386" 30.Cd "iic* at glxpcib? # i386" 31.Cd "iic* at gscsio? # i386" 32.Cd "iic* at ichiic? # amd64 i386" 33.Cd "iic* at iicmux? # arm64" 34.Cd "iic* at nviic? # amd64 i386" 35.Cd "iic* at pcamux? # arm64" 36.Cd "iic* at pcfiic? # sparc64" 37.Cd "iic* at piixpm? # amd64 i386" 38.Cd "iic* at viapm? # amd64 i386" 39.Cd "iic* at gpioiic? # i386" 40.Cd "iic* at gdiumiic? # loongson" 41.Cd "iic* at tsciic? # alpha" 42.Cd "iic* at amliic? # arm64" 43.Cd "iic* at apliic? # arm64" 44.Cd "iic* at bcmbsc? # arm64 armv7" 45.Cd "iic* at dwiic? # amd64 arm64" 46.Cd "iic* at octiic? # octeon" 47.Cd "iic* at imxiic? # arm64 armv7" 48.Cd "iic* at mviic? # arm64" 49.Cd "iic* at rkiic? # arm64 armv7" 50.Cd "iic* at qciic? # arm64" 51.Cd "iic* at sxitwi? # arm64 armv7" 52.Cd "iic* at mpfiic? # riscv64" 53.Cd "iic* at ociic? # riscv64" 54.Sh DESCRIPTION 55I2C is a two-wire bus developed by Philips used for connecting 56integrated circuits. 57It is commonly used for connecting devices such as EEPROMs, 58temperature sensors, fan controllers, real-time clocks, tuners, 59and other types of integrated circuits. 60.Pp 61The 62.Nm 63driver provides a uniform programming interface layer between 64I2C master controllers and various I2C slave devices. 65Each I2C master controller attaches an 66.Nm 67framework; several slave devices can then be attached to the 68.Nm 69bus. 70.Pp 71All I2C slave devices are uniquely identified by the address on the bus. 72The master accesses a particular slave device using its address. 73Devices are found on the bus using a sophisticated scanning routine 74which attempts to identify commonly available devices. 75On other machines (such as sparc64 and macppc) where the machine ROM 76supplies a list of I2C devices, that list is used instead. 77.Pp 78System Management Bus (SMBus) protocol is also supported by emulating 79it with the I2C commands. 80.Sh SUPPORTED MASTERS 81.Bl -tag -width 13n -compact 82.It Xr alipm 4 83Acer Labs M7101 SMBus controller 84.It Xr amdiic 4 85AMD-8111 SMBus controller 86.It Xr amdpm 4 87AMD-756/766/768/8111 Power Management and SMBus controller 88.It Xr amliic 4 89Amlogic I2C controller 90.It Xr apliic 4 91Apple I2C controller 92.It Xr bcmbsc 4 93Broadcom Serial Control controller 94.It Xr dwiic 4 95Synopsys DesignWare I2C controller 96.It Xr glxpcib 4 97AMD CS5536 PCI-ISA bridge with timecounter, watchdog timer, and GPIO 98.It Xr gpioiic 4 99GPIO I2C controller 100.It Xr gscsio 4 101National Semiconductor Geode SC1100 I2C controller 102.It Xr ichiic 4 103Intel ICH SMBus controller 104.It Xr imxiic 4 105Freescale i.MX I2C controller 106.It Xr kiic 4 107Apple Kauai I2C controller 108.It Xr mpfiic 4 109Microchip PolarFire SoC MSS I2C controller 110.It Xr mviic 4 111Marvell Armada 3700 onboard I2C controller 112.It Xr nviic 4 113NVIDIA nForce2/3/4 SMBus controller 114.It Xr ociic 4 115OpenCores I2C controller 116.It Xr octiic 4 117OCTEON two-wire serial interface 118.It Xr pcfiic 4 119Philips PCF8584 I2C controller 120.It Xr piic 4 121Apple via-pmu I2C controller 122.It Xr piixpm 4 123Intel PIIX SMBus controller 124.It Xr rkiic 4 125Rockchip I2C controller 126.It Xr qciic 4 127Qualcomm Snapdragon GENI I2C controller 128.It Xr smu 4 129Apple System Management Unit 130.It Xr sxitwi 4 131Allwinner Two Wire Interface controller 132.It Xr tsciic 4 133DECchip 21272 and 21274 Core Logic chipset I2C controller 134.It Xr viapm 4 135VIA SMBus controller 136.El 137.Sh SUPPORTED SLAVES 138.Bl -tag -width 13n -compact 139.It Xr abcrtc 4 140Abracon AB1805 real-time clock 141.It Xr adc 4 142Analog Devices AD7416/AD7417/7418 temperature sensor 143.It Xr adl 4 144Andigilog aSC7621 temperature, voltage, and fan sensor 145.It Xr admcts 4 146Analog Devices ADM1026 temperature and voltage sensor 147.It Xr admlc 4 148Analog Devices ADM1024 temperature and voltage sensor 149.It Xr admtemp 4 150Analog Devices ADM1021 temperature sensor 151.It Xr admtm 4 152Analog Devices ADM1025 temperature and voltage sensor 153.It Xr admtmp 4 154Analog Devices ADM1030 temperature sensor 155.It Xr admtt 4 156Analog Devices ADM1031 temperature sensor 157.It Xr adt 4 158Analog Devices ADT7460 temperature, voltage, and fan sensor 159.It Xr adtfsm 4 160Analog Devices ADT7462 temperature, voltage, and fan sensor 161.It Xr andl 4 162Andigilog aSC7611 temperature, voltage, and fan sensor 163.It Xr asbtm 4 164Asus ASB 100 temperature sensor 165.It Xr asms 4 166Apple sudden motion sensor 167.It Xr axppmic 4 168X-Powers AXP Power Management IC 169.It Xr bdpmic 4 170ROHM BD718x7 Power Management IC 171.It Xr bgw 4 172Bosch motion sensor 173.It Xr ccpmic 4 174Intel Crystal Cove Power Management IC 175.It Xr cwfg 4 176CellWise CW201x fuel gauge 177.It Xr dapmic 4 178Dialog DA9063 Power Management IC 179.It Xr dsxrtc 4 180Maxim DS3231/DS3232 real-time clock 181.It Xr ecadc 4 182environmental monitoring subsystem temperature sensor 183.It Xr escodec 4 184Everest Semiconductor ES8316 audio codec 185.It Xr fanpwr 4 186Fairchild FAN53555 voltage regulator 187.It Xr fcu 4 188Apple Fan Control Unit sensor device 189.It Xr fintek 4 190Fintek F75375 temperature sensor 191.It Xr fusbtc 4 192Fairchild FUSB302 USB Type-C Port controller 193.It Xr glenv 4 194Genesys Logic GL518SM temperature, voltage, and fan sensor 195.It Xr iatp 4 196Atmel maXTouch touchpad and touchscreen 197.It Xr ihidev 4 198HID over I2C support 199.It Xr islrtc 4 200Intersil ISL1208/1218 real-time clock 201.It Xr lisa 4 202STMicroelectronics LIS331DL MEMS motion sensor 203.It Xr lm 4 204National Semiconductor LM78/79/81 temperature, voltage, and fan sensor 205.It Xr lmenv 4 206National Semiconductor LM87 temperature, voltage, and fan sensor 207.It Xr lmn 4 208National Semiconductor LM93 temperature, voltage, and fan sensor 209.It Xr lmtemp 4 210National Semiconductor LM75/LM76/LM77 temperature sensor 211.It Xr maxds 4 212Maxim DS1624/DS1631/DS1721 temperature sensor 213.It Xr maxrtc 4 214Maxim DS1307/DS1339 real-time clock 215.It Xr maxtmp 4 216Maxim MAX6642/MAX6690 temperature sensor 217.It Xr mcprtc 4 218Microchip MCP79400 real-time clock 219.It Xr mfokrtc 4 220M41T8x real-time clock 221.It Xr nvt 4 222Nuvoton W83795G/ADG temperature, voltage, and fan sensor 223.It Xr pcagpio 4 224Philips PCA955[4567] GPIO controller 225.It Xr pcaled 4 226Philips PCA9532/9552 GPIO LED dimmer 227.It Xr pcamux 4 228Philips PCA954[678] I2C switch/mux 229.It Xr pcfadc 4 230Philips PCF8591 temperature sensor 231.It Xr pcfrtc 4 232NXP PCF8523 real-time clock 233.It Xr pcxrtc 4 234NXP PCF8563 real-time clock 235.It Xr pcyrtc 4 236NXP PCF85063A/TP real-time clock 237.It Xr pijuice 4 238PiJuice HAT UPS 239.It Xr ricohrtc 4 240Ricoh RS5C372 real-time clock 241.It Xr rkpmic 4 242Rockchip RK8xx Power Management IC 243.It Xr sdtemp 4 244SO-DIMM (JC-42.4) temperature sensor 245.It Xr spdmem 4 246Serial Presence Detect memory 247.It Xr ssdfb 4 248Solomon Systech SSD1306/SSD1309 OLED display module 249.It Xr stsec 4 250ST7 embedded controller 251.It Xr tascodec 4 252Texas Instruments TAS2770 digital amplifier 253.It Xr tcpci 4 254USB Type-C Port Controller Interface 255.It Xr tda 4 256Philips TDA8444 fan controller 257.It Xr thmc 4 258TI THMC50, Analog ADM1022/1028 temperature sensor 259.It Xr tipd 4 260TI USB Type-C power delivery controller 261.It Xr titmp 4 262TI TMP451 temperature sensor 263.It Xr tsl 4 264TAOS TSL2560/61 light sensor 265.It Xr wbenv 4 266Winbond W83L784R/W83L785R/W83L785TS-L temperature, voltage, and fan sensor 267.It Xr wbng 4 268Winbond W83793G temperature, voltage, and fan sensor 269.El 270.Sh SEE ALSO 271.Xr iicmux 4 , 272.Xr intro 4 , 273.Xr iic 9 274.Sh HISTORY 275The I2C framework first appeared in 276.Nx 2.0 . 277.Ox 278support was added in 279.Ox 3.6 . 280I2C bus scanning was added in 281.Ox 3.9 . 282.Sh AUTHORS 283The I2C framework was written by 284.An Steve C. Woodford 285and 286.An Jason R. Thorpe 287for 288.Nx 289and then ported to 290.Ox 291by 292.An Alexander Yurchenko Aq Mt grange@openbsd.org . 293