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
6 Add an overlay - maxtherm - to support the MAX6675 and MAX31855 family
9 Developed from an original set of overlays by Dougie Lawson.
11 See: https://github.com/raspberrypi/linux/pull/3763
13 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
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
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) += \
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).
38 +Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device.
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.
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.
50 + MAX31855 on /dev/spidev0.0
51 + dtoverlay=maxtherm,spi0-0,max31855
53 +Load: dtoverlay=maxtherm,<param>=<val>
54 +Params: spi<n>-<m> Configure device at spi<n>, cs<m>
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
68 Info: Configures the mbed AudioCODEC (TLV320AIC23B)
69 Load: dtoverlay=mbed-dac
71 +++ b/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
74 + * Universal device tree overlay for SPI devices
81 + compatible = "brcm,bcm2835";
84 + target = <&spidev0>;
86 + status = "disabled";
91 + target = <&spidev1>;
93 + status = "disabled";
98 + target-path = "spi1/spidev@0";
100 + status = "disabled";
105 + target-path = "spi1/spidev@1";
107 + status = "disabled";
112 + target-path = "spi1/spidev@2";
114 + status = "disabled";
119 + target-path = "spi2/spidev@0";
121 + status = "disabled";
126 + target-path = "spi2/spidev@1";
128 + status = "disabled";
133 + target-path = "spi2/spidev@2";
135 + status = "disabled";
139 + maxfrag: fragment@8 {
143 + #address-cells = <1>;
147 + compatible = "maxim,max6675";
149 + spi-max-frequency = <500000>;
157 + compatible = "maxim,max31855e", "maxim,max31855";
164 + compatible = "maxim,max31855j", "maxim,max31855";
171 + compatible = "maxim,max31855k", "maxim,max31855";
178 + compatible = "maxim,max31855n", "maxim,max31855";
185 + compatible = "maxim,max31855r", "maxim,max31855";
192 + compatible = "maxim,max31855s", "maxim,max31855";
199 + compatible = "maxim,max31855t", "maxim,max31855";
204 + spi0-0 = <0>, "+0",
205 + <&maxfrag>,"target:0=",<&spi0>,
207 + spi0-1 = <0>, "+1",
208 + <&maxfrag>,"target:0=",<&spi0>,
210 + spi1-0 = <0>, "+2",
211 + <&maxfrag>,"target:0=",<&spi1>,
213 + spi1-1 = <0>, "+3",
214 + <&maxfrag>,"target:0=",<&spi1>,
216 + spi1-2 = <0>, "+4",
217 + <&maxfrag>,"target:0=",<&spi1>,
219 + spi2-0 = <0>, "+5",
220 + <&maxfrag>,"target:0=",<&spi2>,
222 + spi2-1 = <0>, "+6",
223 + <&maxfrag>,"target:0=",<&spi2>,
225 + spi2-2 = <0>, "+7",
226 + <&maxfrag>,"target:0=",<&spi2>,
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";