aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0315-overlays-mcp23017-Support-the-MCP23008.patch
blob: 24e1e03086d30a156030a773160ac343c35f3186 (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
41
42
43
44
45
46
47
48
49
From 1cfb681bddf0f63b99296987b155a8a9efdb7bbf Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 21 Jan 2019 12:19:57 +0000
Subject: [PATCH 315/703] overlays: mcp23017: Support the MCP23008

Add an 'mcp23008' parameter to enable support for the MCP23008 device.

See: https://github.com/raspberrypi/linux/issues/2818

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

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1212,6 +1212,8 @@ Params: gpiopin                 Gpio pin
 
         addr                    I2C address of the MCP23017 (default: 0x20)
 
+        mcp23008                Configure an MCP23008 instead.
+
 
 Name:   mcp23s17
 Info:   Configures the MCP23S08/17 SPI GPIO expanders.
--- a/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
+++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
@@ -44,11 +44,19 @@
 			};
 		};
 	};
-	
+
+	fragment@3 {
+		target = <&mcp23017>;
+		__dormant__ {
+			compatible = "microchip,mcp23008";
+		};
+	};
+
 	__overrides__ {
 		gpiopin = <&mcp23017_pins>,"brcm,pins:0",
 				<&mcp23017>,"interrupts:0";
 		addr = <&mcp23017>,"reg:0";
+		mcp23008 = <0>,"=3";
 	};
 };