1 From 377a971a6d66cd45f011daeb17eaf6cbba59f54c Mon Sep 17 00:00:00 2001
2 From: Alistair Buxton <a.j.buxton@gmail.com>
3 Date: Sun, 1 Nov 2015 22:27:56 +0000
4 Subject: [PATCH 106/423] Build i2c_gpio module and add a device tree overlay
8 arch/arm/boot/dts/overlays/Makefile | 1 +
9 arch/arm/boot/dts/overlays/README | 13 +++++++++++-
10 arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 28 +++++++++++++++++++++++++
11 arch/arm/configs/bcm2709_defconfig | 1 +
12 arch/arm/configs/bcmrpi_defconfig | 1 +
13 5 files changed, 43 insertions(+), 1 deletion(-)
14 create mode 100644 arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -25,6 +25,7 @@ dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi
19 dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
20 dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
21 dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
22 +dtb-$(RPI_DT_OVERLAYS) += i2c-gpio-overlay.dtb
23 dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
24 dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
25 dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -287,9 +287,20 @@ Params: speed Display
29 ledgpio GPIO used to control backlight
33 +Info: Adds support for software i2c controller on gpio pins
34 +Load: dtoverlay=i2c-gpio,<param>=<val>
35 +Params: i2c_gpio_sda GPIO used for I2C data (default "23")
37 + i2c_gpio_scl GPIO used for I2C clock (default "24")
39 + i2c_gpio_delay_us Clock delay in microseconds
40 + (default "2" = ~100kHz)
44 Info: Adds support for a number of I2C Real Time Clock devices
45 -Load: dtoverlay=i2c-rtc,<param>
46 +Load: dtoverlay=i2c-rtc,<param>=<val>
47 Params: ds1307 Select the DS1307 device
49 ds3231 Select the DS3231 device
51 +++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
53 +// Overlay for i2c_gpio bitbanging host bus.
58 + compatible = "brcm,bcm2708";
64 + compatible = "i2c-gpio";
65 + gpios = <&gpio 23 0 /* sda */
66 + &gpio 24 0 /* scl */
68 + i2c-gpio,delay-us = <2>; /* ~100 kHz */
69 + #address-cells = <1>;
75 + i2c_gpio_sda = <&i2c_gpio>,"gpios:4";
76 + i2c_gpio_scl = <&i2c_gpio>,"gpios:16";
77 + i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";
81 --- a/arch/arm/configs/bcm2709_defconfig
82 +++ b/arch/arm/configs/bcm2709_defconfig
83 @@ -595,6 +595,7 @@ CONFIG_RAW_DRIVER=y
91 --- a/arch/arm/configs/bcmrpi_defconfig
92 +++ b/arch/arm/configs/bcmrpi_defconfig
93 @@ -588,6 +588,7 @@ CONFIG_RAW_DRIVER=y