Skip to content

Commit d06804d

Browse files
DougieLawsonpopcornmix
authored andcommitted
overlays: Add maxtherm overlay for MAX6675/31855
Add an overlay - maxtherm - to support the MAX6675 and MAX31855 family of thermocouples. Developed from an original set of overlays by Dougie Lawson. See: #3763 Signed-off-by: Phil Elwell <[email protected]>
1 parent 229cb67 commit d06804d

File tree

3 files changed

+197
-0
lines changed

3 files changed

+197
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
9898
justboom-digi.dtbo \
9999
ltc294x.dtbo \
100100
max98357a.dtbo \
101+
maxtherm.dtbo \
101102
mbed-dac.dtbo \
102103
mcp23017.dtbo \
103104
mcp23s17.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,36 @@ Params: no-sdmode Driver does not manage the state of the DAC's
16221622
of the DAC (default GPIO4 if parameter omitted).
16231623

16241624

1625+
Name: maxtherm
1626+
Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device.
1627+
1628+
For devices on spi1 or spi2, the interfaces should be enabled
1629+
with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
1630+
The overlay expects to disable the relevant spidev node, so also using
1631+
e.g. cs0_spidev=off is unnecessary.
1632+
1633+
Note: with the 5.7 kernel (and later) there will also be
1634+
overlays for MAX31855E, MAX31855J, MAX31855K,
1635+
MAX31885N, MAX31855R, MAX31855S and MAX31855T.
1636+
1637+
Example:
1638+
MAX31855 on /dev/spidev0.0
1639+
dtoverlay=maxtherm,spi0-0,max31855
1640+
1641+
Load: dtoverlay=maxtherm,<param>=<val>
1642+
Params: spi<n>-<m> Configure device at spi<n>, cs<m>
1643+
(boolean, required)
1644+
max6675 Enable support for the MAX6675 (default)
1645+
max31855 Enable support for the MAX31855
1646+
max31855e Enable support for the MAX31855E
1647+
max31855j Enable support for the MAX31855J
1648+
max31855k Enable support for the MAX31855K
1649+
max31855n Enable support for the MAX31855N
1650+
max31855r Enable support for the MAX31855R
1651+
max31855s Enable support for the MAX31855S
1652+
max31855t Enable support for the MAX31855T
1653+
1654+
16251655
Name: mbed-dac
16261656
Info: Configures the mbed AudioCODEC (TLV320AIC23B)
16271657
Load: dtoverlay=mbed-dac
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/*
2+
* Universal device tree overlay for SPI devices
3+
*/
4+
5+
/dts-v1/;
6+
/plugin/;
7+
8+
/ {
9+
compatible = "brcm,bcm2835";
10+
11+
fragment@0 {
12+
target = <&spidev0>;
13+
__dormant__ {
14+
status = "disabled";
15+
};
16+
};
17+
18+
fragment@1 {
19+
target = <&spidev1>;
20+
__dormant__ {
21+
status = "disabled";
22+
};
23+
};
24+
25+
fragment@2 {
26+
target-path = "spi1/spidev@0";
27+
__dormant__ {
28+
status = "disabled";
29+
};
30+
};
31+
32+
fragment@3 {
33+
target-path = "spi1/spidev@1";
34+
__dormant__ {
35+
status = "disabled";
36+
};
37+
};
38+
39+
fragment@4 {
40+
target-path = "spi1/spidev@2";
41+
__dormant__ {
42+
status = "disabled";
43+
};
44+
};
45+
46+
fragment@5 {
47+
target-path = "spi2/spidev@0";
48+
__dormant__ {
49+
status = "disabled";
50+
};
51+
};
52+
53+
fragment@6 {
54+
target-path = "spi2/spidev@1";
55+
__dormant__ {
56+
status = "disabled";
57+
};
58+
};
59+
60+
fragment@7 {
61+
target-path = "spi2/spidev@2";
62+
__dormant__ {
63+
status = "disabled";
64+
};
65+
};
66+
67+
maxfrag: fragment@8 {
68+
target = <&spi0>;
69+
__overlay__ {
70+
status = "okay";
71+
#address-cells = <1>;
72+
#size-cells = <0>;
73+
74+
max: maxtherm@0 {
75+
compatible = "maxim,max6675";
76+
reg = <0>;
77+
spi-max-frequency = <500000>;
78+
};
79+
};
80+
};
81+
82+
fragment@9 {
83+
target = <&max>;
84+
__dormant__ {
85+
compatible = "maxim,max31855e", "maxim,max31855";
86+
};
87+
};
88+
89+
fragment@10 {
90+
target = <&max>;
91+
__dormant__ {
92+
compatible = "maxim,max31855j", "maxim,max31855";
93+
};
94+
};
95+
96+
fragment@11 {
97+
target = <&max>;
98+
__dormant__ {
99+
compatible = "maxim,max31855k", "maxim,max31855";
100+
};
101+
};
102+
103+
fragment@12 {
104+
target = <&max>;
105+
__dormant__ {
106+
compatible = "maxim,max31855n", "maxim,max31855";
107+
};
108+
};
109+
110+
fragment@13 {
111+
target = <&max>;
112+
__dormant__ {
113+
compatible = "maxim,max31855r", "maxim,max31855";
114+
};
115+
};
116+
117+
fragment@14 {
118+
target = <&max>;
119+
__dormant__ {
120+
compatible = "maxim,max31855s", "maxim,max31855";
121+
};
122+
};
123+
124+
fragment@15 {
125+
target = <&max>;
126+
__dormant__ {
127+
compatible = "maxim,max31855t", "maxim,max31855";
128+
};
129+
};
130+
131+
__overrides__ {
132+
spi0-0 = <0>, "+0",
133+
<&maxfrag>,"target:0=",<&spi0>,
134+
<&max>,"reg:0=0";
135+
spi0-1 = <0>, "+1",
136+
<&maxfrag>,"target:0=",<&spi0>,
137+
<&max>,"reg:0=1";
138+
spi1-0 = <0>, "+2",
139+
<&maxfrag>,"target:0=",<&spi1>,
140+
<&max>,"reg:0=0";
141+
spi1-1 = <0>, "+3",
142+
<&maxfrag>,"target:0=",<&spi1>,
143+
<&max>,"reg:0=1";
144+
spi1-2 = <0>, "+4",
145+
<&maxfrag>,"target:0=",<&spi1>,
146+
<&max>,"reg:0=2";
147+
spi2-0 = <0>, "+5",
148+
<&maxfrag>,"target:0=",<&spi2>,
149+
<&max>,"reg:0=0";
150+
spi2-1 = <0>, "+6",
151+
<&maxfrag>,"target:0=",<&spi2>,
152+
<&max>,"reg:0=1";
153+
spi2-2 = <0>, "+7",
154+
<&maxfrag>,"target:0=",<&spi2>,
155+
<&max>,"reg:0=2";
156+
max6675 = <&max>,"compatible=maxim,max6675";
157+
max31855 = <&max>,"compatible=maxim,max31855";
158+
max31855e = <0>,"+9";
159+
max31855j = <0>,"+10";
160+
max31855k = <0>,"+11";
161+
max31855n = <0>,"+12";
162+
max31855r = <0>,"+13";
163+
max31855s = <0>,"+14";
164+
max31855t = <0>,"+15";
165+
};
166+
};

0 commit comments

Comments
 (0)