summaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-6.1/950-0684-overlays-Add-pcf857x-support.patch
blob: e66f83cfee2f7462a434a79bfa88b328536bbbc1 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From e0db80960019c296c47690dea9052dc4960f4f99 Mon Sep 17 00:00:00 2001
From: Clarke X <1014930533@qq.com>
Date: Sat, 8 Apr 2023 11:29:16 +0800
Subject: [PATCH] overlays: Add pcf857x support

Add pcf857x overlay with related documents.

Signed-off-by: Clarke X <1014930533@qq.com>
---
 arch/arm/boot/dts/overlays/Makefile           |  1 +
 arch/arm/boot/dts/overlays/README             | 11 +++++++
 .../arm/boot/dts/overlays/pcf857x-overlay.dts | 32 +++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 arch/arm/boot/dts/overlays/pcf857x-overlay.dts

--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -167,6 +167,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
 	ov9281.dtbo \
 	papirus.dtbo \
 	pca953x.dtbo \
+	pcf857x.dtbo \
 	pcie-32bit-dma.dtbo \
 	pibell.dtbo \
 	pifacedigital.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -3065,6 +3065,17 @@ Params: addr                    I2C addr
         xra1202                 Select the Exar XRA1202 (8 bit)
 
 
+Name:   pcf857x
+Info:   NXP PCF857x family of I2C GPIO expanders.
+Load:   dtoverlay=pcf857x,<param>=<val>
+Params: addr                    I2C address of expander. Default
+                                depends on model selected.
+        pcf8574                 Select the NXP PCF8574 (8 bit)
+        pcf8574a                Select the NXP PCF8574A (8 bit)
+        pcf8575                 Select the NXP PCF8575 (16 bit)
+        pca8574                 Select the NXP PCA8574 (8 bit)
+
+
 Name:   pcie-32bit-dma
 Info:   Force PCIe config to support 32bit DMA addresses at the expense of
         having to bounce buffers.
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/pcf857x-overlay.dts
@@ -0,0 +1,32 @@
+// Definitions for PCF857X GPIO Extender from NXP
+
+/dts-v1/;
+/plugin/;
+
+/ {
+	compatible = "brcm,bcm2835";
+
+	fragment@0 {
+		target = <&i2c_arm>;
+		__overlay__ {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			pcf857x: pcf857x@0 {
+				compatible = "";
+				reg = <0x00>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				status = "okay";
+			};
+		};
+	};
+
+	__overrides__ {
+		pcf8574  = <&pcf857x>,"compatible=nxp,pcf8574",  <&pcf857x>,"reg:0=0x20";
+		pcf8574a = <&pcf857x>,"compatible=nxp,pcf8574a", <&pcf857x>,"reg:0=0x38";
+		pcf8575  = <&pcf857x>,"compatible=nxp,pcf8575",  <&pcf857x>,"reg:0=0x20";
+		pca8574  = <&pcf857x>,"compatible=nxp,pca8574", <&pcf857x>,"reg:0=0x20";
+		addr = <&pcf857x>,"reg:0";
+	};
+};