Skip to content

Commit 8fb274f

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
overlays: Add mcp342x overlay
Support the MCP342x family of ADCs from Microchip. See: #2819 Signed-off-by: Phil Elwell <[email protected]>
1 parent e1791c1 commit 8fb274f

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
7979
mcp2515-can1.dtbo \
8080
mcp3008.dtbo \
8181
mcp3202.dtbo \
82+
mcp342x.dtbo \
8283
media-center.dtbo \
8384
midi-uart0.dtbo \
8485
midi-uart1.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,22 @@ Params: spi<n>-<m>-present boolean, configure device at spi<n>, cs<m>
12771277
spi<n>-<m>-speed integer, set the spi bus speed for this device
12781278

12791279

1280+
Name: mcp342x
1281+
Info: Overlay for activation of Microchip MCP3421-3428 ADCs over I2C
1282+
Load: dtoverlay=mcp342x,<param>=<val>
1283+
Params: addr I2C bus address of device, for devices with
1284+
addresses that are configurable, e.g. by
1285+
hardware links (default=0x68)
1286+
mcp3421 The device is an MCP3421
1287+
mcp3422 The device is an MCP3422
1288+
mcp3423 The device is an MCP3423
1289+
mcp3424 The device is an MCP3424
1290+
mcp3425 The device is an MCP3425
1291+
mcp3426 The device is an MCP3426
1292+
mcp3427 The device is an MCP3427
1293+
mcp3428 The device is an MCP3428
1294+
1295+
12801296
Name: media-center
12811297
Info: Media Center HAT - 2.83" Touch Display + extras by Pi Supply
12821298
Load: dtoverlay=media-center,<param>=<val>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Overlay for MCP3421-8 ADCs from Microchip Semiconductor
2+
3+
/dts-v1/;
4+
/plugin/;
5+
6+
/ {
7+
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
8+
9+
fragment@0 {
10+
target = <&i2c1>;
11+
__overlay__ {
12+
#address-cells = <1>;
13+
#size-cells = <0>;
14+
15+
status = "okay";
16+
17+
mcp342x: mcp@68 {
18+
reg = <0x68>;
19+
20+
status = "okay";
21+
};
22+
};
23+
};
24+
25+
fragment@1 {
26+
target = <&mcp342x>;
27+
__dormant__ {
28+
compatible = "microchip,mcp3421";
29+
};
30+
};
31+
32+
fragment@2 {
33+
target = <&mcp342x>;
34+
__dormant__ {
35+
compatible = "microchip,mcp3422";
36+
};
37+
};
38+
39+
fragment@3 {
40+
target = <&mcp342x>;
41+
__dormant__ {
42+
compatible = "microchip,mcp3423";
43+
};
44+
};
45+
46+
fragment@4 {
47+
target = <&mcp342x>;
48+
__dormant__ {
49+
compatible = "microchip,mcp3424";
50+
};
51+
};
52+
53+
fragment@5 {
54+
target = <&mcp342x>;
55+
__dormant__ {
56+
compatible = "microchip,mcp3425";
57+
};
58+
};
59+
60+
fragment@6 {
61+
target = <&mcp342x>;
62+
__dormant__ {
63+
compatible = "microchip,mcp3426";
64+
};
65+
};
66+
67+
fragment@7 {
68+
target = <&mcp342x>;
69+
__dormant__ {
70+
compatible = "microchip,mcp3427";
71+
};
72+
};
73+
74+
fragment@8 {
75+
target = <&mcp342x>;
76+
__dormant__ {
77+
compatible = "microchip,mcp3428";
78+
};
79+
};
80+
81+
__overrides__ {
82+
addr = <&mcp342x>,"reg:0";
83+
mcp3421 = <0>,"=1";
84+
mcp3422 = <0>,"=2";
85+
mcp3423 = <0>,"=3";
86+
mcp3424 = <0>,"=4";
87+
mcp3425 = <0>,"=5";
88+
mcp3426 = <0>,"=6";
89+
mcp3427 = <0>,"=7";
90+
mcp3428 = <0>,"=8";
91+
};
92+
};
93+

0 commit comments

Comments
 (0)