OpenWrt – Rev 1

Subversion Repositories:
Rev:
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";
        };
 };
-

Generated by GNU Enscript 1.6.5.90.