firmware-utils: bump to git HEAD
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0931-overlays-Add-maxtherm-overlay-for-MAX6675-31855.patch
1 From 56e726d1631c9551530b8db4127352c64c3cb94d Mon Sep 17 00:00:00 2001
2 From: Dougie Lawson <dl1ims@gmail.com>
3 Date: Mon, 27 Jul 2020 23:52:40 +0100
4 Subject: [PATCH] overlays: Add maxtherm overlay for MAX6675/31855
5
6 Add an overlay - maxtherm - to support the MAX6675 and MAX31855 family
7 of thermocouples.
8
9 Developed from an original set of overlays by Dougie Lawson.
10
11 See: https://github.com/raspberrypi/linux/pull/3763
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 ---
15 arch/arm/boot/dts/overlays/Makefile | 1 +
16 arch/arm/boot/dts/overlays/README | 30 ++++
17 .../boot/dts/overlays/maxtherm-overlay.dts | 166 ++++++++++++++++++
18 3 files changed, 197 insertions(+)
19 create mode 100644 arch/arm/boot/dts/overlays/maxtherm-overlay.dts
20
21 --- a/arch/arm/boot/dts/overlays/Makefile
22 +++ b/arch/arm/boot/dts/overlays/Makefile
23 @@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
24 justboom-digi.dtbo \
25 ltc294x.dtbo \
26 max98357a.dtbo \
27 + maxtherm.dtbo \
28 mbed-dac.dtbo \
29 mcp23017.dtbo \
30 mcp23s17.dtbo \
31 --- a/arch/arm/boot/dts/overlays/README
32 +++ b/arch/arm/boot/dts/overlays/README
33 @@ -1622,6 +1622,36 @@ Params: no-sdmode Driver d
34 of the DAC (default GPIO4 if parameter omitted).
35
36
37 +Name: maxtherm
38 +Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device.
39 +
40 + For devices on spi1 or spi2, the interfaces should be enabled
41 + with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
42 + The overlay expects to disable the relevant spidev node, so also using
43 + e.g. cs0_spidev=off is unnecessary.
44 +
45 + Note: with the 5.7 kernel (and later) there will also be
46 + overlays for MAX31855E, MAX31855J, MAX31855K,
47 + MAX31885N, MAX31855R, MAX31855S and MAX31855T.
48 +
49 + Example:
50 + MAX31855 on /dev/spidev0.0
51 + dtoverlay=maxtherm,spi0-0,max31855
52 +
53 +Load: dtoverlay=maxtherm,<param>=<val>
54 +Params: spi<n>-<m> Configure device at spi<n>, cs<m>
55 + (boolean, required)
56 + max6675 Enable support for the MAX6675 (default)
57 + max31855 Enable support for the MAX31855
58 + max31855e Enable support for the MAX31855E
59 + max31855j Enable support for the MAX31855J
60 + max31855k Enable support for the MAX31855K
61 + max31855n Enable support for the MAX31855N
62 + max31855r Enable support for the MAX31855R
63 + max31855s Enable support for the MAX31855S
64 + max31855t Enable support for the MAX31855T
65 +
66 +
67 Name: mbed-dac
68 Info: Configures the mbed AudioCODEC (TLV320AIC23B)
69 Load: dtoverlay=mbed-dac
70 --- /dev/null
71 +++ b/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
72 @@ -0,0 +1,166 @@
73 +/*
74 + * Universal device tree overlay for SPI devices
75 + */
76 +
77 +/dts-v1/;
78 +/plugin/;
79 +
80 +/ {
81 + compatible = "brcm,bcm2835";
82 +
83 + fragment@0 {
84 + target = <&spidev0>;
85 + __dormant__ {
86 + status = "disabled";
87 + };
88 + };
89 +
90 + fragment@1 {
91 + target = <&spidev1>;
92 + __dormant__ {
93 + status = "disabled";
94 + };
95 + };
96 +
97 + fragment@2 {
98 + target-path = "spi1/spidev@0";
99 + __dormant__ {
100 + status = "disabled";
101 + };
102 + };
103 +
104 + fragment@3 {
105 + target-path = "spi1/spidev@1";
106 + __dormant__ {
107 + status = "disabled";
108 + };
109 + };
110 +
111 + fragment@4 {
112 + target-path = "spi1/spidev@2";
113 + __dormant__ {
114 + status = "disabled";
115 + };
116 + };
117 +
118 + fragment@5 {
119 + target-path = "spi2/spidev@0";
120 + __dormant__ {
121 + status = "disabled";
122 + };
123 + };
124 +
125 + fragment@6 {
126 + target-path = "spi2/spidev@1";
127 + __dormant__ {
128 + status = "disabled";
129 + };
130 + };
131 +
132 + fragment@7 {
133 + target-path = "spi2/spidev@2";
134 + __dormant__ {
135 + status = "disabled";
136 + };
137 + };
138 +
139 + maxfrag: fragment@8 {
140 + target = <&spi0>;
141 + __overlay__ {
142 + status = "okay";
143 + #address-cells = <1>;
144 + #size-cells = <0>;
145 +
146 + max: maxtherm@0 {
147 + compatible = "maxim,max6675";
148 + reg = <0>;
149 + spi-max-frequency = <500000>;
150 + };
151 + };
152 + };
153 +
154 + fragment@9 {
155 + target = <&max>;
156 + __dormant__ {
157 + compatible = "maxim,max31855e", "maxim,max31855";
158 + };
159 + };
160 +
161 + fragment@10 {
162 + target = <&max>;
163 + __dormant__ {
164 + compatible = "maxim,max31855j", "maxim,max31855";
165 + };
166 + };
167 +
168 + fragment@11 {
169 + target = <&max>;
170 + __dormant__ {
171 + compatible = "maxim,max31855k", "maxim,max31855";
172 + };
173 + };
174 +
175 + fragment@12 {
176 + target = <&max>;
177 + __dormant__ {
178 + compatible = "maxim,max31855n", "maxim,max31855";
179 + };
180 + };
181 +
182 + fragment@13 {
183 + target = <&max>;
184 + __dormant__ {
185 + compatible = "maxim,max31855r", "maxim,max31855";
186 + };
187 + };
188 +
189 + fragment@14 {
190 + target = <&max>;
191 + __dormant__ {
192 + compatible = "maxim,max31855s", "maxim,max31855";
193 + };
194 + };
195 +
196 + fragment@15 {
197 + target = <&max>;
198 + __dormant__ {
199 + compatible = "maxim,max31855t", "maxim,max31855";
200 + };
201 + };
202 +
203 + __overrides__ {
204 + spi0-0 = <0>, "+0",
205 + <&maxfrag>,"target:0=",<&spi0>,
206 + <&max>,"reg:0=0";
207 + spi0-1 = <0>, "+1",
208 + <&maxfrag>,"target:0=",<&spi0>,
209 + <&max>,"reg:0=1";
210 + spi1-0 = <0>, "+2",
211 + <&maxfrag>,"target:0=",<&spi1>,
212 + <&max>,"reg:0=0";
213 + spi1-1 = <0>, "+3",
214 + <&maxfrag>,"target:0=",<&spi1>,
215 + <&max>,"reg:0=1";
216 + spi1-2 = <0>, "+4",
217 + <&maxfrag>,"target:0=",<&spi1>,
218 + <&max>,"reg:0=2";
219 + spi2-0 = <0>, "+5",
220 + <&maxfrag>,"target:0=",<&spi2>,
221 + <&max>,"reg:0=0";
222 + spi2-1 = <0>, "+6",
223 + <&maxfrag>,"target:0=",<&spi2>,
224 + <&max>,"reg:0=1";
225 + spi2-2 = <0>, "+7",
226 + <&maxfrag>,"target:0=",<&spi2>,
227 + <&max>,"reg:0=2";
228 + max6675 = <&max>,"compatible=maxim,max6675";
229 + max31855 = <&max>,"compatible=maxim,max31855";
230 + max31855e = <0>,"+9";
231 + max31855j = <0>,"+10";
232 + max31855k = <0>,"+11";
233 + max31855n = <0>,"+12";
234 + max31855r = <0>,"+13";
235 + max31855s = <0>,"+14";
236 + max31855t = <0>,"+15";
237 + };
238 +};