kernel: bump 4.14 to 4.14.93
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0277-overlays-Add-combine-option-to-i2c-overlays.patch
1 From 1b02fe3ab446613cadcfac08d611b90becb02189 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 18 Apr 2018 17:04:23 +0100
4 Subject: [PATCH 277/454] overlays: Add 'combine' option to i2c overlays
5
6 The i2c0-bcm2708 and i2c1-bcm2708 overlays allow the I2C pin usage to
7 be changed. The names also suggest they revert to the old i2c_bcm2708
8 driver, but they don't. The newer i2c_bcm2835 driver forces
9 transactions to be combined where possible, but this breaks some
10 devices.
11
12 Add an option to disable transaction combining, which is currently
13 implemented by reverting to the old driver.
14
15 See: https://github.com/raspberrypi/firmware/issues/828
16
17 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
18 ---
19 arch/arm/boot/dts/overlays/README | 12 ++++++++++--
20 arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 8 ++++++++
21 arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts | 9 +++++++++
22 3 files changed, 27 insertions(+), 2 deletions(-)
23
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -865,8 +865,9 @@ Params: addr Set the
27
28
29 Name: i2c0-bcm2708
30 -Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
31 - are usable on all platforms.
32 +Info: Change i2c0 pin usage. Not all pin combinations are usable on all
33 + platforms - platforms other then Compute Modules can only use this
34 + to disable transaction combining.
35 Load: dtoverlay=i2c0-bcm2708,<param>=<val>
36 Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
37 scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
38 @@ -874,15 +875,22 @@ Params: sda0_pin GPIO pin
39 pins_28_29 Use pins 28 and 29
40 pins_44_45 Use pins 44 and 45
41 pins_46_47 Use pins 46 and 47
42 + combine Allow transactions to be combined (default
43 + "yes")
44
45
46 Name: i2c1-bcm2708
47 +Info: Change i2c1 pin usage. Not all pin combinations are usable on all
48 + platforms - platforms other then Compute Modules can only use this
49 + to disable transaction combining.
50 Info: Enable the i2c_bcm2708 driver for the i2c1 bus
51 Load: dtoverlay=i2c1-bcm2708,<param>=<val>
52 Params: sda1_pin GPIO pin for SDA1 (2 or 44 - default 2)
53 scl1_pin GPIO pin for SCL1 (3 or 45 - default 3)
54 pin_func Alternative pin function (4 (alt0), 6 (alt2) -
55 default 4)
56 + combine Allow transactions to be combined (default
57 + "yes")
58
59
60 Name: i2s-gpio28-31
61 --- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
62 +++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
63 @@ -50,6 +50,13 @@
64 };
65 };
66
67 + fragment@5 {
68 + target = <&i2c0>;
69 + __dormant__ {
70 + compatible = "brcm,bcm2708-i2c";
71 + };
72 + };
73 +
74 __overrides__ {
75 sda0_pin = <&frag1>,"brcm,pins:0";
76 scl0_pin = <&frag1>,"brcm,pins:4";
77 @@ -57,5 +64,6 @@
78 pins_28_29 = <0>,"-1+2-3-4";
79 pins_44_45 = <0>,"-1-2+3-4";
80 pins_46_47 = <0>,"-1-2-3+4";
81 + combine = <0>, "!5";
82 };
83 };
84 --- a/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
85 +++ b/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
86 @@ -26,9 +26,18 @@
87 brcm,function = <4>; /* alt 0 */
88 };
89 };
90 +
91 + fragment@2 {
92 + target = <&i2c1>;
93 + __dormant__ {
94 + compatible = "brcm,bcm2708-i2c";
95 + };
96 + };
97 +
98 __overrides__ {
99 sda1_pin = <&pins>,"brcm,pins:0";
100 scl1_pin = <&pins>,"brcm,pins:4";
101 pin_func = <&pins>,"brcm,function:0";
102 + combine = <0>, "!2";
103 };
104 };