1 From e4fc78fecfc8cf3cf04b252d0822b2ebd149c031 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <6by9@users.noreply.github.com>
3 Date: Mon, 8 Feb 2016 23:49:41 +0000
4 Subject: [PATCH 161/381] DT: Add overlays to configure I2C pins
7 https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=120938&p=825883
8 so not claiming this to be my own work.
9 Adds overlays i2c0-bcm2708 and i2c1-bcm2708 that allow the pin
10 allocations for i2c-0 and i2c-1 to be changed.
12 arch/arm/boot/dts/overlays/Makefile | 2 ++
13 arch/arm/boot/dts/overlays/README | 16 ++++++++++
14 .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 36 +++++++++++++++++++++
15 .../arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts | 37 ++++++++++++++++++++++
16 4 files changed, 91 insertions(+)
17 create mode 100644 arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
18 create mode 100644 arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
20 --- a/arch/arm/boot/dts/overlays/Makefile
21 +++ b/arch/arm/boot/dts/overlays/Makefile
22 @@ -29,6 +29,8 @@ dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.
23 dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
24 dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
25 dtb-$(RPI_DT_OVERLAYS) += i2c-gpio-overlay.dtb
26 +dtb-$(RPI_DT_OVERLAYS) += i2c0-bcm2708-overlay.dtb
27 +dtb-$(RPI_DT_OVERLAYS) += i2c1-bcm2708-overlay.dtb
28 dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
29 dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
30 dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
31 --- a/arch/arm/boot/dts/overlays/README
32 +++ b/arch/arm/boot/dts/overlays/README
33 @@ -371,6 +371,22 @@ Params: ds1307 Select t
34 pcf8563 Select the PCF8563 device
38 +Info: Enable the i2c_bcm2708 driver for the i2c0 bus
39 +Load: dtoverlay=i2c0-bcm2708,<param>=<val>
40 +Params: sda0_pin GPIO pin for SDA0 (0, 28 [or 44] - default 0)
41 + scl0_pin GPIO pin for SCL0 (1, 29 [or 45] - default 1)
45 +Info: Enable the i2c_bcm2708 driver for the i2c1 bus
46 +Load: dtoverlay=i2c1-bcm2708,<param>=<val>
47 +Params: sda1_pin GPIO pin for SDA1 (2 or 44 - default 2)
48 + scl1_pin GPIO pin for SCL1 (3 or 45 - default 3)
49 + pin_func Alternative pin function (4 (alt0), 6 (alt2) -
54 Info: Enables mmap support in the bcm2708-i2s driver
55 Load: dtoverlay=i2s-mmap
57 +++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts
60 + * Device tree overlay for i2c_bcm2708, i2c0 bus
63 + * dtc -@ -I dts -O dtb -o i2c0-bcm2708-overlay.dtb i2c0-bcm2708-overlay.dts
70 + compatible = "brcm,bcm2708";
75 + pinctrl-0 = <&i2c0_pins>;
85 + brcm,function = <4>; /* alt0 */
91 + sda0_pin = <&i2c0_pins>,"brcm,pins:0";
92 + scl0_pin = <&i2c0_pins>,"brcm,pins:4";
96 +++ b/arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts
99 + * Device tree overlay for i2c_bcm2708, i2c1 bus
102 + * dtc -@ -I dts -O dtb -o i2c1-bcm2708-overlay.dtb i2c1-bcm2708-overlay.dts
109 + compatible = "brcm,bcm2708";
114 + pinctrl-0 = <&i2c1_pins>;
124 + brcm,function = <4>; /* alt0 */
130 + sda1_pin = <&i2c1_pins>,"brcm,pins:0";
131 + scl1_pin = <&i2c1_pins>,"brcm,pins:4";
132 + pin_func = <&i2c1_pins>,"brcm,function:0";