aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0222-overlays-i2c-gpio-Support-for-multiple-instances.patch
blob: 6e0ca913933c3e3dc4fc0bc720fafba010346cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 3826d26d2a41f03c82c45465ff4759891c1688c6 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 19 Feb 2018 17:29:15 +0000
Subject: [PATCH 222/454] overlays: i2c-gpio: Support for multiple instances

Add a 'bus' parameter that, if set to a unique, non-zero
value, allows multiple i2c-gpio instances to coexist. The chosen
value doesn't determine the /dev/i2c-* value, but starting with
1 or 2 and counting upwards seems sensible. N.B. The bus parameter
has a default value of zero, so one instance doesn't need to specify
a value.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 arch/arm/boot/dts/overlays/README               | 3 +++
 arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -693,6 +693,9 @@ Params: i2c_gpio_sda            GPIO use
         i2c_gpio_delay_us       Clock delay in microseconds
                                 (default "2" = ~100kHz)
 
+        bus                     Set to a unique, non-zero value if wanting
+                                multiple i2c-gpio busses (default "0")
+
 
 Name:   i2c-mux
 Info:   Adds support for a number of I2C bus multiplexers on i2c_arm
--- a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
@@ -38,6 +38,6 @@
 		i2c_gpio_sda = <&i2c_gpio>,"gpios:4";
 		i2c_gpio_scl = <&i2c_gpio>,"gpios:16";
 		i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";
+		bus = <&i2c_gpio>, "reg:0";
 	};
 };
-