cb89142dff36f33d5d7aa74eb982628f790362da
[oweals/openwrt.git] /
1 From 83b839b8b3a599336c2d48ab22ed919a77666476 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 26 Nov 2018 17:02:15 +0000
4 Subject: [PATCH] dtoverlays: Add i2c on 0&1 option to TC358743,
5  ADV7282 and OV5647
6
7 Adds the option of configuring i2c0 to be on GPIOs 0&1 as
8 this is of use on the Compute Module.
9
10 Also fixes the ov5647 overlay where the override enabled the wrong
11 fragments.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 ---
15  arch/arm/boot/dts/overlays/README               | 14 ++++++++++++--
16  arch/arm/boot/dts/overlays/adv7282m-overlay.dts | 10 +++++++++-
17  arch/arm/boot/dts/overlays/ov5647-overlay.dts   | 10 +++++++++-
18  arch/arm/boot/dts/overlays/tc358743-overlay.dts | 10 +++++++++-
19  4 files changed, 39 insertions(+), 5 deletions(-)
20
21 --- a/arch/arm/boot/dts/overlays/README
22 +++ b/arch/arm/boot/dts/overlays/README
23 @@ -277,7 +277,9 @@ Info:   Analog Devices ADV7282M analogue
24          Uses Unicam1, which is the standard camera connector on most Pi
25          variants.
26  Load:   dtoverlay=adv7282m,<param>=<val>
27 -Params: i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
28 +Params: i2c_pins_0_1            Use pins 0&1 for the I2C instead of 44&45.
29 +                                Useful on Compute Modules.
30 +        i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
31                                  This is required for Pi B+, 2, 0, and 0W.
32          addr                    Overrides the I2C address (default 0x21)
33  
34 @@ -286,7 +288,9 @@ Name:   adv728x-m
35  Info:   Analog Devices ADV728[0|1|2]-M analogue video to CSI2 bridges.
36          This is a wrapper for adv7282m, and defaults to ADV7282M.
37  Load:   dtoverlay=adv728x-m,<param>=<val>
38 -Params: i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
39 +Params: i2c_pins_0_1            Use pins 0&1 for the I2C instead of 44&45.
40 +                                Useful on Compute Modules.
41 +        i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
42                                  This is required for Pi B+, 2, 0, and 0W.
43          addr                    Overrides the I2C address (default 0x21)
44          adv7280m                Select ADV7280-M.
45 @@ -1324,6 +1328,9 @@ Params: cam0-pwdn               GPIO use
46                                  configuration of the particular Pi variant in
47                                  use.
48  
49 +        i2c_pins_0_1            Use pins 0&1 for the I2C instead of 44&45.
50 +                                Useful on Compute Modules.
51 +
52          i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
53                                  This is required for Pi B+, 2, 0, and 0W.
54  
55 @@ -1949,6 +1956,9 @@ Params: 4lane                   Use 4 la
56                                  (574Mbit/s) and 486000000 (972Mbit/s - default)
57                                  are supported by the driver.
58  
59 +        i2c_pins_0_1            Use pins 0&1 for the I2C instead of 44&45.
60 +                                Useful on Compute Modules.
61 +
62          i2c_pins_28_29          Use pins 28&29 for the I2C instead of 44&45.
63                                  This is required for Pi B+, 2, 0, and 0W.
64  
65 --- a/arch/arm/boot/dts/overlays/adv7282m-overlay.dts
66 +++ b/arch/arm/boot/dts/overlays/adv7282m-overlay.dts
67 @@ -60,6 +60,13 @@
68                 };
69         };
70         fragment@4 {
71 +               target = <&i2c0_pins>;
72 +               __dormant__ {
73 +                       brcm,pins = <0 1>;
74 +                       brcm,function = <4>; /* alt0 */
75 +               };
76 +       };
77 +       fragment@5 {
78                 target = <&i2c_vc>;
79                 __overlay__ {
80                         status = "okay";
81 @@ -67,7 +74,8 @@
82         };
83  
84         __overrides__ {
85 -               i2c_pins_28_29 =        <0>,"+2-3";
86 +               i2c_pins_0_1 =          <0>,"-2-3+4";
87 +               i2c_pins_28_29 =        <0>,"+2-3-4";
88                 addr =                  <&adv728x>,"reg:0";
89         };
90  };
91 --- a/arch/arm/boot/dts/overlays/ov5647-overlay.dts
92 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
93 @@ -69,6 +69,13 @@
94                 };
95         };
96         fragment@4 {
97 +               target = <&i2c0_pins>;
98 +               __dormant__ {
99 +                       brcm,pins = <0 1>;
100 +                       brcm,function = <4>; /* alt0 */
101 +               };
102 +       };
103 +       fragment@5 {
104                 target = <&i2c_vc>;
105                 __overlay__ {
106                         status = "okay";
107 @@ -76,7 +83,8 @@
108         };
109  
110         __overrides__ {
111 -               i2c_pins_28_29 = <0>,"+4-5";
112 +               i2c_pins_0_1 = <0>,"-2-3+4";
113 +               i2c_pins_28_29 = <0>,"+2-3-4";
114                 cam0-pwdn = <&ov5647>,"pwdn-gpios:4";
115                 cam0-led = <&ov5647>,"pwdn-gpios:16";
116         };
117 --- a/arch/arm/boot/dts/overlays/tc358743-overlay.dts
118 +++ b/arch/arm/boot/dts/overlays/tc358743-overlay.dts
119 @@ -94,6 +94,13 @@
120                 };
121         };
122         fragment@6 {
123 +               target = <&i2c0_pins>;
124 +               __dormant__ {
125 +                       brcm,pins = <0 1>;
126 +                       brcm,function = <4>; /* alt0 */
127 +               };
128 +       };
129 +       fragment@7 {
130                 target = <&i2c_vc>;
131                 __overlay__ {
132                         status = "okay";
133 @@ -101,7 +108,8 @@
134         };
135  
136         __overrides__ {
137 -               i2c_pins_28_29 = <0>,"+4-5";
138 +               i2c_pins_0_1 = <0>,"-4-5+6";
139 +               i2c_pins_28_29 = <0>,"+4-5-6";
140                 4lane = <0>, "-2+3";
141                 link-frequency = <&tc358743>,"link-frequencies#0";
142         };