mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			47 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From 7d860731ee655fef5984fa064df91ed6286b3215 Mon Sep 17 00:00:00 2001
 | 
						|
From: Phil Elwell <phil@raspberrypi.org>
 | 
						|
Date: Mon, 19 Feb 2018 17:29:15 +0000
 | 
						|
Subject: [PATCH 241/277] 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(-)
 | 
						|
 | 
						|
diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README
 | 
						|
index 65a93e655575..b066b19d2661 100644
 | 
						|
--- a/arch/arm/boot/dts/overlays/README
 | 
						|
+++ b/arch/arm/boot/dts/overlays/README
 | 
						|
@@ -693,6 +693,9 @@ Params: i2c_gpio_sda            GPIO used for I2C data (default "23")
 | 
						|
         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
 | 
						|
diff --git a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
 | 
						|
index b72b32e93677..3f692c1a8958 100644
 | 
						|
--- 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";
 | 
						|
 	};
 | 
						|
 };
 | 
						|
-
 | 
						|
-- 
 | 
						|
2.16.1
 | 
						|
 |