scripts/getver.sh: avoid use of git rev-list --count
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-4.4 / 0322-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
1 From c451203424a277e522ea5227cefa84658615f442 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Fri, 6 May 2016 12:53:16 +0100
4 Subject: [PATCH 322/381] BCM270X_DT: i2c0-bcm2708 - pin group params
5
6 Add parameters to set pin groups as a unit, setting the pin function
7 appropriately. The parameters are:
8 pins_0_1
9 pins_28_29
10 pins_44_45
11 pins_46_47
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
14 ---
15 arch/arm/boot/dts/overlays/README | 11 ++++--
16 .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 43 +++++++++++++++++-----
17 2 files changed, 42 insertions(+), 12 deletions(-)
18
19 --- a/arch/arm/boot/dts/overlays/README
20 +++ b/arch/arm/boot/dts/overlays/README
21 @@ -449,10 +449,15 @@ Params: ds1307 Select t
22
23
24 Name: i2c0-bcm2708
25 -Info: Enable the i2c_bcm2708 driver for the i2c0 bus
26 +Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
27 + are usable on all platforms.
28 Load: dtoverlay=i2c0-bcm2708,<param>=<val>
29 -Params: sda0_pin GPIO pin for SDA0 (0, 28 [or 44] - default 0)
30 - scl0_pin GPIO pin for SCL0 (1, 29 [or 45] - default 1)
31 +Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
32 + scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
33 + pins_0_1 Use pins 0 and 1 (default)
34 + pins_28_29 Use pins 28 and 29
35 + pins_44_45 Use pins 44 and 45
36 + pins_46_47 Use pins 46 and 47
37
38
39 Name: i2c1-bcm2708
40 --- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
41 +++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
42 @@ -14,23 +14,48 @@
43 fragment@0 {
44 target = <&i2c0>;
45 __overlay__ {
46 - pinctrl-0 = <&i2c0_pins>;
47 status = "okay";
48 };
49 };
50
51 fragment@1 {
52 - target = <&gpio>;
53 - __overlay__ {
54 - i2c0_pins: i2c0 {
55 - brcm,pins = <0 1>;
56 - brcm,function = <4>; /* alt0 */
57 - };
58 + target = <&i2c0_pins>;
59 + frag1: __overlay__ {
60 + brcm,pins = <0 1>;
61 + brcm,function = <4>; /* alt0 */
62 + };
63 + };
64 +
65 + fragment@2 {
66 + target = <&i2c0_pins>;
67 + __dormant__ {
68 + brcm,pins = <28 29>;
69 + brcm,function = <4>; /* alt0 */
70 + };
71 + };
72 +
73 + fragment@3 {
74 + target = <&i2c0_pins>;
75 + __dormant__ {
76 + brcm,pins = <44 45>;
77 + brcm,function = <5>; /* alt1 */
78 + };
79 + };
80 +
81 + fragment@4 {
82 + target = <&i2c0_pins>;
83 + __dormant__ {
84 + brcm,pins = <46 47>;
85 + brcm,function = <4>; /* alt0 */
86 };
87 };
88
89 __overrides__ {
90 - sda0_pin = <&i2c0_pins>,"brcm,pins:0";
91 - scl0_pin = <&i2c0_pins>,"brcm,pins:4";
92 + sda0_pin = <&frag1>,"brcm,pins:0";
93 + scl0_pin = <&frag1>,"brcm,pins:4";
94 + pins_0_1 = <0>,"+1-2-3-4";
95 + pins_28_29 = <0>,"-1+2-3-4";
96 + pins_44_45 = <0>,"-1-2+3-4";
97 + pins_46_47 = <0>,"-1-2-3+4";
98 };
99 };