1 From 9444edfa8b5b18f8727b82853dd50345a400a316 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 22 Oct 2020 17:11:12 +0100
4 Subject: [PATCH] overlays: Add MAX31856 support to maxtherm overlay
6 Extend the maxtherm overlay with support for the MAX31856.
7 The driver reads the thermocouple type from a property, which is much
10 See: https://github.com/raspberrypi/linux/issues/3915
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 arch/arm/boot/dts/overlays/README | 18 ++++++++++++-----
15 .../boot/dts/overlays/maxtherm-overlay.dts | 20 +++++++++++++++++++
16 2 files changed, 33 insertions(+), 5 deletions(-)
18 --- a/arch/arm/boot/dts/overlays/README
19 +++ b/arch/arm/boot/dts/overlays/README
20 @@ -1666,20 +1666,19 @@ Params: no-sdmode Driver d
24 -Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device.
25 +Info: Configure a MAX6675, MAX31855 or MAX31856 thermocouple as an IIO device.
27 For devices on spi1 or spi2, the interfaces should be enabled
28 with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
29 The overlay expects to disable the relevant spidev node, so also using
30 e.g. cs0_spidev=off is unnecessary.
32 - Note: with the 5.7 kernel (and later) there will also be
33 - overlays for MAX31855E, MAX31855J, MAX31855K,
34 - MAX31885N, MAX31855R, MAX31855S and MAX31855T.
37 MAX31855 on /dev/spidev0.0
38 dtoverlay=maxtherm,spi0-0,max31855
39 + MAX31856 using a type J thermocouple on /dev/spidev2.1
41 + dtoverlay=maxtherm,spi2-1,max31856,type_j
43 Load: dtoverlay=maxtherm,<param>=<val>
44 Params: spi<n>-<m> Configure device at spi<n>, cs<m>
45 @@ -1693,6 +1692,15 @@ Params: spi<n>-<m> Configur
46 max31855r Enable support for the MAX31855R
47 max31855s Enable support for the MAX31855S
48 max31855t Enable support for the MAX31855T
49 + max31856 Enable support for the MAX31856 (with type K)
50 + type_b Select a type B sensor for max31856
51 + type_e Select a type E sensor for max31856
52 + type_j Select a type J sensor for max31856
53 + type_k Select a type K sensor for max31856
54 + type_n Select a type N sensor for max31856
55 + type_r Select a type R sensor for max31856
56 + type_s Select a type S sensor for max31856
57 + type_t Select a type T sensor for max31856
61 --- a/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
62 +++ b/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
67 +#include <dt-bindings/iio/temperature/thermocouple.h>
70 compatible = "brcm,bcm2835";
79 + compatible = "maxim,max31856";
81 + thermocouple-type = <THERMOCOUPLE_TYPE_K>;
87 <&maxfrag>,"target:0=",<&spi0>,
89 max31855r = <0>,"+13";
90 max31855s = <0>,"+14";
91 max31855t = <0>,"+15";
92 + max31856 = <0>,"+16";
93 + type_b = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_B>;
94 + type_e = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_E>;
95 + type_j = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_J>;
96 + type_k = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_K>;
97 + type_n = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_N>;
98 + type_r = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_R>;
99 + type_s = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_S>;
100 + type_t = <&max>,"thermocouple-type:0=",<THERMOCOUPLE_TYPE_T>;