1.\" $OpenBSD: iic.4,v 1.117 2021/06/23 15:32:40 kettenis 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: June 23 2021 $ 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 nviic? # amd64 i386" 34.Cd "iic* at pcamux? # arm64" 35.Cd "iic* at pcfiic? # sparc64" 36.Cd "iic* at piixpm? # amd64 i386" 37.Cd "iic* at viapm? # amd64 i386" 38.Cd "iic* at gpioiic? # i386" 39.Cd "iic* at gdiumiic? # loongson" 40.Cd "iic* at tsciic? # alpha" 41.Cd "iic* at amliic? # arm64" 42.Cd "iic* at bcmbsc? # arm64 armv7" 43.Cd "iic* at dwiic? # amd64 arm64" 44.Cd "iic* at octiic? # octeon" 45.Cd "iic* at imxiic? # arm64 armv7" 46.Cd "iic* at mviic? # arm64" 47.Cd "iic* at rkiic? # arm64 armv7" 48.Cd "iic* at sxitwi? # arm64 armv7" 49.Cd "iic* at ociic? # riscv64" 50.Sh DESCRIPTION 51.Tn I2C 52is a two-wire bus developed by Philips used for connecting 53integrated circuits. 54It is commonly used for connecting devices such as EEPROMs, 55temperature sensors, fan controllers, real-time clocks, tuners, 56and other types of integrated circuits. 57.Pp 58The 59.Nm 60driver provides a uniform programming interface layer between 61.Tn I2C 62master controllers and various 63.Tn I2C 64slave devices. 65Each 66.Tn I2C 67master controller attaches an 68.Nm 69framework; several slave devices can then be attached to the 70.Nm 71bus. 72.Pp 73All 74.Tn I2C 75slave devices are uniquely identified by the address on the bus. 76The master accesses a particular slave device using its address. 77Devices are found on the bus using a sophisticated scanning routine 78which attempts to identify commonly available devices. 79On other machines (such as sparc64 and macppc) where the machine ROM 80supplies a list of I2C devices, that list is used instead. 81.Pp 82System Management Bus (SMBus) protocol is also supported by emulating 83it with the 84.Tn I2C 85commands. 86.Sh SUPPORTED MASTERS 87.Bl -tag -width 13n -compact 88.It Xr alipm 4 89Acer Labs M7101 SMBus controller 90.It Xr amdiic 4 91AMD-8111 SMBus controller 92.It Xr amdpm 4 93AMD-756/766/768/8111 Power Management and SMBus controller 94.It Xr amliic 4 95Amlogic I2C controller 96.It Xr bcmbsc 4 97Broadcom Serial Control controller 98.It Xr dwiic 4 99Synopsys DesignWare I2C controller 100.It Xr glxpcib 4 101AMD CS5536 PCI-ISA bridge with timecounter, watchdog timer, and GPIO 102.It Xr gpioiic 4 103GPIO I2C controller 104.It Xr gscsio 4 105National Semiconductor Geode SC1100 I2C controller 106.It Xr ichiic 4 107Intel ICH SMBus controller 108.It Xr imxiic 4 109Freescale i.MX I2C controller 110.It Xr kiic 4 111Apple Kauai I2C controller 112.It Xr mviic 4 113Marvell Armada 3700 I2C Controller 114.It Xr nviic 4 115NVIDIA nForce2/3/4 SMBus controller 116.It Xr ociic 4 117OpenCores I2C controller 118.It Xr octiic 4 119OCTEON two-wire serial interface 120.It Xr pcfiic 4 121Philips PCF8584 I2C controller 122.It Xr piic 4 123Apple via-pmu I2C controller 124.It Xr piixpm 4 125Intel PIIX SMBus controller 126.It Xr rkiic 4 127Rockchip 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 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 ricohrtc 4 236Ricoh RS5C372 real-time clock 237.It Xr rkpmic 4 238Rockchip RK8xx Power Management IC 239.It Xr sdtemp 4 240SO-DIMM (JC-42.4) temperature sensor 241.It Xr spdmem 4 242Serial Presence Detect memory 243.It Xr ssdfb 4 244Solomon Systech SSD1306/SSD1309 OLED display module 245.It Xr stsec 4 246ST7 embedded controller 247.It Xr tcpci 4 248USB Type-C Port Controller Interface 249.It Xr tda 4 250Philips TDA8444 fan controller 251.It Xr thmc 4 252TI THMC50, Analog ADM1022/1028 temperature sensor 253.It Xr titmp 4 254TI TMP451 temperature sensor 255.It Xr tsl 4 256TAOS TSL2560/61 light sensor 257.It Xr wbenv 4 258Winbond W83L784R/W83L785R/W83L785TS-L temperature, voltage, and fan sensor 259.It Xr wbng 4 260Winbond W83793G temperature, voltage, and fan sensor 261.El 262.Sh SEE ALSO 263.Xr intro 4 , 264.Xr iic 9 265.Sh HISTORY 266The 267.Tn I2C 268framework first appeared in 269.Nx 2.0 . 270.Ox 271support was added in 272.Ox 3.6 . 273I2C bus scanning was added in 274.Ox 3.9 . 275.Sh AUTHORS 276The 277.Tn I2C 278framework was written by 279Steve C. Woodford and Jason R. Thorpe for 280.Nx 281and then ported to 282.Ox 283by 284.An Alexander Yurchenko Aq Mt grange@openbsd.org . 285