xref: /linux/Documentation/i2c/ten-bit-addresses.rst (revision 976e3645923bdd2fe7893aae33fd7a21098bfb28)
1*ccf988b6SMauro Carvalho Chehab=====================
2*ccf988b6SMauro Carvalho ChehabI2C Ten-bit Addresses
3*ccf988b6SMauro Carvalho Chehab=====================
4*ccf988b6SMauro Carvalho Chehab
5*ccf988b6SMauro Carvalho ChehabThe I2C protocol knows about two kinds of device addresses: normal 7 bit
6*ccf988b6SMauro Carvalho Chehabaddresses, and an extended set of 10 bit addresses. The sets of addresses
7*ccf988b6SMauro Carvalho Chehabdo not intersect: the 7 bit address 0x10 is not the same as the 10 bit
8*ccf988b6SMauro Carvalho Chehabaddress 0x10 (though a single device could respond to both of them).
9*ccf988b6SMauro Carvalho ChehabTo avoid ambiguity, the user sees 10 bit addresses mapped to a different
10*ccf988b6SMauro Carvalho Chehabaddress space, namely 0xa000-0xa3ff. The leading 0xa (= 10) represents the
11*ccf988b6SMauro Carvalho Chehab10 bit mode. This is used for creating device names in sysfs. It is also
12*ccf988b6SMauro Carvalho Chehabneeded when instantiating 10 bit devices via the new_device file in sysfs.
13*ccf988b6SMauro Carvalho Chehab
14*ccf988b6SMauro Carvalho ChehabI2C messages to and from 10-bit address devices have a different format.
15*ccf988b6SMauro Carvalho ChehabSee the I2C specification for the details.
16*ccf988b6SMauro Carvalho Chehab
17*ccf988b6SMauro Carvalho ChehabThe current 10 bit address support is minimal. It should work, however
18*ccf988b6SMauro Carvalho Chehabyou can expect some problems along the way:
19*ccf988b6SMauro Carvalho Chehab
20*ccf988b6SMauro Carvalho Chehab* Not all bus drivers support 10-bit addresses. Some don't because the
21*ccf988b6SMauro Carvalho Chehab  hardware doesn't support them (SMBus doesn't require 10-bit address
22*ccf988b6SMauro Carvalho Chehab  support for example), some don't because nobody bothered adding the
23*ccf988b6SMauro Carvalho Chehab  code (or it's there but not working properly.) Software implementation
24*ccf988b6SMauro Carvalho Chehab  (i2c-algo-bit) is known to work.
25*ccf988b6SMauro Carvalho Chehab* Some optional features do not support 10-bit addresses. This is the
26*ccf988b6SMauro Carvalho Chehab  case of automatic detection and instantiation of devices by their,
27*ccf988b6SMauro Carvalho Chehab  drivers, for example.
28*ccf988b6SMauro Carvalho Chehab* Many user-space packages (for example i2c-tools) lack support for
29*ccf988b6SMauro Carvalho Chehab  10-bit addresses.
30*ccf988b6SMauro Carvalho Chehab
31*ccf988b6SMauro Carvalho ChehabNote that 10-bit address devices are still pretty rare, so the limitations
32*ccf988b6SMauro Carvalho Chehablisted above could stay for a long time, maybe even forever if nobody
33*ccf988b6SMauro Carvalho Chehabneeds them to be fixed.
34