Skip to content

Commit 6e6673d

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 2d8ca95 commit 6e6673d

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
@@ -77,6 +77,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
7777
mcp2515-can1.dtbo \
7878
mcp3008.dtbo \
7979
mcp3202.dtbo \
80+
mcp342x.dtbo \
8081
media-center.dtbo \
8182
midi-uart0.dtbo \
8283
midi-uart1.dtbo \

arch/arm/boot/dts/overlays/README

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

12531253

1254+
Name: mcp342x
1255+
Info: Overlay for activation of Microchip MCP3421-3428 ADCs over I2C
1256+
Load: dtoverlay=mcp342x,<param>=<val>
1257+
Params: addr I2C bus address of device, for devices with
1258+
addresses that are configurable, e.g. by
1259+
hardware links (default=0x68)
1260+
mcp3421 The device is an MCP3421
1261+
mcp3422 The device is an MCP3422
1262+
mcp3423 The device is an MCP3423
1263+
mcp3424 The device is an MCP3424
1264+
mcp3425 The device is an MCP3425
1265+
mcp3426 The device is an MCP3426
1266+
mcp3427 The device is an MCP3427
1267+
mcp3428 The device is an MCP3428
1268+
1269+
12541270
Name: media-center
12551271
Info: Media Center HAT - 2.83" Touch Display + extras by Pi Supply
12561272
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)