Skip to content

Commit 39de65a

Browse files
committed
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang: "Here is the pull request from the i2c subsystem. It got a little delayed because I needed to wait for a dependency to be included (commit b424080: "reset: Add optional resets and stubs"). Plus, I had some email problems. All done now, the highlights are: - drivers can now deprecate their use of i2c classes. That shouldn't be used on embedded platforms anyhow and was often blindly copy&pasted. This mechanism gives users time to switch away and ultimately boot faster once the use of classes for those drivers is gone for good. - new drivers for QUP, Cadence, efm32 - tracepoint support for I2C and SMBus - bigger cleanups for the mv64xxx, nomadik, and designware drivers And the usual bugfixes, cleanups, feature additions. Most stuff has been in linux-next for a while. Just some hot fixes and new drivers were added a bit more recently." * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (63 commits) i2c: cadence: fix Kconfig dependency i2c: Add driver for Cadence I2C controller i2c: cadence: Document device tree bindings Documentation: i2c: improve section about flags mangling the protocol i2c: qup: use proper type fro clk_freq i2c: qup: off by ones in qup_i2c_probe() i2c: efm32: fix binding doc MAINTAINERS: update I2C web resources i2c: qup: New bus driver for the Qualcomm QUP I2C controller i2c: qup: Add device tree bindings information i2c: i2c-xiic: deprecate class based instantiation i2c: i2c-sirf: deprecate class based instantiation i2c: i2c-mv64xxx: deprecate class based instantiation i2c: i2c-designware-platdrv: deprecate class based instantiation i2c: i2c-davinci: deprecate class based instantiation i2c: i2c-bcm2835: deprecate class based instantiation i2c: mv64xxx: Fix reset controller handling i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync i2c: efm32: new bus driver i2c: exynos5: remove unnecessary cast of void pointer ...
2 parents 97e18dc + 1fbeab0 commit 39de65a

64 files changed

Lines changed: 3292 additions & 501 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/i2c/i2c-at91.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Required properties :
1212
- clocks: phandles to input clocks.
1313

1414
Optional properties:
15+
- clock-frequency: Desired I2C bus frequency in Hz, otherwise defaults to 100000
1516
- Child nodes conforming to i2c bus binding
1617

1718
Examples :
@@ -23,6 +24,7 @@ i2c0: i2c@fff84000 {
2324
#address-cells = <1>;
2425
#size-cells = <0>;
2526
clocks = <&twi0_clk>;
27+
clock-frequency = <400000>;
2628

2729
24c512@50 {
2830
compatible = "24c512";
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Binding for the Cadence I2C controller
2+
3+
Required properties:
4+
- reg: Physical base address and size of the controller's register area.
5+
- compatible: Compatibility string. Must be 'cdns,i2c-r1p10'.
6+
- clocks: Input clock specifier. Refer to common clock bindings.
7+
- interrupts: Interrupt specifier. Refer to interrupt bindings.
8+
- #address-cells: Should be 1.
9+
- #size-cells: Should be 0.
10+
11+
Optional properties:
12+
- clock-frequency: Desired operating frequency, in Hz, of the bus.
13+
- clock-names: Input clock name, should be 'pclk'.
14+
15+
Example:
16+
i2c@e0004000 {
17+
compatible = "cdns,i2c-r1p10";
18+
clocks = <&clkc 38>;
19+
interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
20+
reg = <0xe0004000 0x1000>;
21+
clock-frequency = <400000>;
22+
#address-cells = <1>;
23+
#size-cells = <0>;
24+
};

‎Documentation/devicetree/bindings/i2c/i2c-designware.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Optional properties :
1414
- i2c-sda-hold-time-ns : should contain the SDA hold time in nanoseconds.
1515
This option is only supported in hardware blocks version 1.11a or newer.
1616

17+
- i2c-scl-falling-time : should contain the SCL falling time in nanoseconds.
18+
This value which is by default 300ns is used to compute the tLOW period.
19+
20+
- i2c-sda-falling-time : should contain the SDA falling time in nanoseconds.
21+
This value which is by default 300ns is used to compute the tHIGH period.
22+
1723
Example :
1824

1925
i2c@f0000 {
@@ -34,4 +40,6 @@ Example :
3440
interrupts = <12 1>;
3541
clock-frequency = <400000>;
3642
i2c-sda-hold-time-ns = <300>;
43+
i2c-sda-falling-time-ns = <300>;
44+
i2c-scl-falling-time-ns = <300>;
3745
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
* Energymicro efm32 i2c controller
2+
3+
Required properties :
4+
5+
- reg : Offset and length of the register set for the device
6+
- compatible : should be "energymicro,efm32-i2c"
7+
- interrupts : the interrupt number
8+
- clocks : reference to the module clock
9+
10+
Recommended properties :
11+
12+
- clock-frequency : maximal I2C bus clock frequency in Hz.
13+
- efm32,location : Decides the location of the USART I/O pins.
14+
Allowed range : [0 .. 6]
15+
16+
Example:
17+
i2c0: i2c@4000a000 {
18+
#address-cells = <1>;
19+
#size-cells = <0>;
20+
compatible = "energymicro,efm32-i2c";
21+
reg = <0x4000a000 0x400>;
22+
interrupts = <9>;
23+
clocks = <&cmu clk_HFPERCLKI2C0>;
24+
clock-frequency = <100000>;
25+
status = "ok";
26+
efm32,location = <3>;
27+
28+
eeprom@50 {
29+
compatible = "microchip,24c02";
30+
reg = <0x50>;
31+
pagesize = <16>;
32+
};
33+
};
34+

‎Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@
44
Required properties :
55

66
- reg : Offset and length of the register set for the device
7-
- compatible : Should be "marvell,mv64xxx-i2c" or "allwinner,sun4i-i2c"
8-
or "marvell,mv78230-i2c" or "marvell,mv78230-a0-i2c"
9-
Note: Only use "marvell,mv78230-a0-i2c" for a very rare,
10-
initial version of the SoC which had broken offload
11-
support. Linux auto-detects this and sets it
12-
appropriately.
7+
- compatible : Should be either:
8+
- "allwinner,sun4i-i2c"
9+
- "allwinner,sun6i-a31-i2c"
10+
- "marvell,mv64xxx-i2c"
11+
- "marvell,mv78230-i2c"
12+
- "marvell,mv78230-a0-i2c"
13+
* Note: Only use "marvell,mv78230-a0-i2c" for a
14+
very rare, initial version of the SoC which
15+
had broken offload support. Linux
16+
auto-detects this and sets it appropriately.
1317
- interrupts : The interrupt number
1418

1519
Optional properties :
1620

1721
- clock-frequency : Desired I2C bus clock frequency in Hz. If not set the
1822
default frequency is 100kHz
1923

24+
- resets : phandle to the parent reset controller. Mandatory
25+
whenever you're using the "allwinner,sun6i-a31-i2c"
26+
compatible.
27+
2028
Examples:
2129

2230
i2c@11000 {

‎Documentation/devicetree/bindings/i2c/i2c-rcar.txt‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ Required properties:
66
"renesas,i2c-r8a7778"
77
"renesas,i2c-r8a7779"
88
"renesas,i2c-r8a7790"
9+
"renesas,i2c-r8a7791"
910
- reg: physical base address of the controller and length of memory mapped
1011
region.
1112
- interrupts: interrupt specifier.
1213

1314
Optional properties:
1415
- clock-frequency: desired I2C bus clock frequency in Hz. The absence of this
1516
propoerty indicates the default frequency 100 kHz.
17+
- clocks: clock specifier.
1618

1719
Examples :
1820

19-
i2c0: i2c@e6500000 {
20-
compatible = "renesas,i2c-rcar-h2";
21-
reg = <0 0xe6500000 0 0x428>;
22-
interrupts = <0 174 0x4>;
21+
i2c0: i2c@e6508000 {
22+
#address-cells = <1>;
23+
#size-cells = <0>;
24+
compatible = "renesas,i2c-r8a7791";
25+
reg = <0 0xe6508000 0 0x40>;
26+
interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
27+
clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
28+
clock-frequency = <400000>;
2329
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Qualcomm Universal Peripheral (QUP) I2C controller
2+
3+
Required properties:
4+
- compatible: Should be:
5+
* "qcom,i2c-qup-v1.1.1" for 8660, 8960 and 8064.
6+
* "qcom,i2c-qup-v2.1.1" for 8974 v1.
7+
* "qcom,i2c-qup-v2.2.1" for 8974 v2 and later.
8+
- reg: Should contain QUP register address and length.
9+
- interrupts: Should contain I2C interrupt.
10+
11+
- clocks: A list of phandles + clock-specifiers, one for each entry in
12+
clock-names.
13+
- clock-names: Should contain:
14+
* "core" for the core clock
15+
* "iface" for the AHB clock
16+
17+
- #address-cells: Should be <1> Address cells for i2c device address
18+
- #size-cells: Should be <0> as i2c addresses have no size component
19+
20+
Optional properties:
21+
- clock-frequency: Should specify the desired i2c bus clock frequency in Hz,
22+
defaults to 100kHz if omitted.
23+
24+
Child nodes should conform to i2c bus binding.
25+
26+
Example:
27+
28+
i2c@f9924000 {
29+
compatible = "qcom,i2c-qup-v2.2.1";
30+
reg = <0xf9924000 0x1000>;
31+
interrupts = <0 96 0>;
32+
33+
clocks = <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
34+
clock-names = "core", "iface";
35+
36+
clock-frequency = <355000>;
37+
38+
#address-cells = <1>;
39+
#size-cells = <0>;
40+
};

‎Documentation/i2c/busses/i2c-i801‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Supported adapters:
2626
* Intel Wellsburg (PCH)
2727
* Intel Coleto Creek (PCH)
2828
* Intel Wildcat Point-LP (PCH)
29+
* Intel BayTrail (SOC)
2930
Datasheets: Publicly available at the Intel website
3031

3132
On Intel Patsburg and later chipsets, both the normal host SMBus controller

‎Documentation/i2c/functionality‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ A few combinations of the above flags are also defined for your convenience:
4646
and write_block_data commands
4747
I2C_FUNC_SMBUS_I2C_BLOCK Handles the SMBus read_i2c_block_data
4848
and write_i2c_block_data commands
49-
I2C_FUNC_SMBUS_EMUL Handles all SMBus commands than can be
49+
I2C_FUNC_SMBUS_EMUL Handles all SMBus commands that can be
5050
emulated by a real I2C adapter (using
5151
the transparent emulation layer)
5252

‎Documentation/i2c/i2c-protocol‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Key to symbols
66
S (1 bit) : Start bit
77
P (1 bit) : Stop bit
88
Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0.
9-
A, NA (1 bit) : Accept and reverse accept bit.
10-
Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to
9+
A, NA (1 bit) : Accept and reverse accept bit.
10+
Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to
1111
get a 10 bit I2C address.
1212
Comm (8 bits): Command byte, a data byte which often selects a register on
1313
the device.
@@ -49,11 +49,20 @@ a byte read, followed by a byte write:
4949
Modified transactions
5050
=====================
5151

52-
The following modifications to the I2C protocol can also be generated,
53-
with the exception of I2C_M_NOSTART these are usually only needed to
54-
work around device issues:
52+
The following modifications to the I2C protocol can also be generated by
53+
setting these flags for i2c messages. With the exception of I2C_M_NOSTART, they
54+
are usually only needed to work around device issues:
5555

56-
Flag I2C_M_NOSTART:
56+
I2C_M_IGNORE_NAK:
57+
Normally message is interrupted immediately if there is [NA] from the
58+
client. Setting this flag treats any [NA] as [A], and all of
59+
message is sent.
60+
These messages may still fail to SCL lo->hi timeout.
61+
62+
I2C_M_NO_RD_ACK:
63+
In a read message, master A/NA bit is skipped.
64+
65+
I2C_M_NOSTART:
5766
In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some
5867
point. For example, setting I2C_M_NOSTART on the second partial message
5968
generates something like:
@@ -67,17 +76,13 @@ work around device issues:
6776
I2C device but may also be used between direction changes by some
6877
rare devices.
6978

70-
Flags I2C_M_REV_DIR_ADDR
79+
I2C_M_REV_DIR_ADDR:
7180
This toggles the Rd/Wr flag. That is, if you want to do a write, but
7281
need to emit an Rd instead of a Wr, or vice versa, you set this
7382
flag. For example:
7483
S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P
7584

76-
Flags I2C_M_IGNORE_NAK
77-
Normally message is interrupted immediately if there is [NA] from the
78-
client. Setting this flag treats any [NA] as [A], and all of
79-
message is sent.
80-
These messages may still fail to SCL lo->hi timeout.
81-
82-
Flags I2C_M_NO_RD_ACK
83-
In a read message, master A/NA bit is skipped.
85+
I2C_M_STOP:
86+
Force a stop condition (P) after the message. Some I2C related protocols
87+
like SCCB require that. Normally, you really don't want to get interrupted
88+
between the messages of one transfer.

0 commit comments

Comments
 (0)