bcm27xx: switch to 5.15
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.10 / 950-0373-overlays-Add-MAX31856-support-to-maxtherm-overlay.patch
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
5
6 Extend the maxtherm overlay with support for the MAX31856.
7 The driver reads the thermocouple type from a property, which is much
8 more civilised.
9
10 See: https://github.com/raspberrypi/linux/issues/3915
11
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
13 ---
14 arch/arm/boot/dts/overlays/README | 18 ++++++++++++-----
15 .../boot/dts/overlays/maxtherm-overlay.dts | 20 +++++++++++++++++++
16 2 files changed, 33 insertions(+), 5 deletions(-)
17
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
21
22
23 Name: maxtherm
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.
26
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.
31
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.
35 -
36 Example:
37 MAX31855 on /dev/spidev0.0
38 dtoverlay=maxtherm,spi0-0,max31855
39 + MAX31856 using a type J thermocouple on /dev/spidev2.1
40 + dtoverlay=spi2-2cs
41 + dtoverlay=maxtherm,spi2-1,max31856,type_j
42
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
58
59
60 Name: mbed-dac
61 --- a/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
62 +++ b/arch/arm/boot/dts/overlays/maxtherm-overlay.dts
63 @@ -5,6 +5,8 @@
64 /dts-v1/;
65 /plugin/;
66
67 +#include <dt-bindings/iio/temperature/thermocouple.h>
68 +
69 / {
70 compatible = "brcm,bcm2835";
71
72 @@ -128,6 +130,15 @@
73 };
74 };
75
76 + fragment@16 {
77 + target = <&max>;
78 + __dormant__ {
79 + compatible = "maxim,max31856";
80 + spi-cpha;
81 + thermocouple-type = <THERMOCOUPLE_TYPE_K>;
82 + };
83 + };
84 +
85 __overrides__ {
86 spi0-0 = <0>, "+0",
87 <&maxfrag>,"target:0=",<&spi0>,
88 @@ -162,5 +173,14 @@
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>;
101 };
102 };