Skip to content

Commit d15e5ed

Browse files
Phil Elwellahmedradaideh
Phil Elwell
authored andcommitted
overlays: Add mcp342x overlay
Support the MCP342x family of ADCs from Microchip. See: raspberrypi/linux#2819 Signed-off-by: Phil Elwell <[email protected]> Signed-off-by: ahmedradaideh <[email protected]>
1 parent fb123d2 commit d15e5ed

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

arch/arm/boot/dts/overlays/README

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

12631263

1264+
Name: mcp342x
1265+
Info: Overlay for activation of Microchip MCP3421-3428 ADCs over I2C
1266+
Load: dtoverlay=mcp342x,<param>=<val>
1267+
Params: addr I2C bus address of device, for devices with
1268+
addresses that are configurable, e.g. by
1269+
hardware links (default=0x68)
1270+
mcp3421 The device is an MCP3421
1271+
mcp3422 The device is an MCP3422
1272+
mcp3423 The device is an MCP3423
1273+
mcp3424 The device is an MCP3424
1274+
mcp3425 The device is an MCP3425
1275+
mcp3426 The device is an MCP3426
1276+
mcp3427 The device is an MCP3427
1277+
mcp3428 The device is an MCP3428
1278+
1279+
12641280
Name: media-center
12651281
Info: Media Center HAT - 2.83" Touch Display + extras by Pi Supply
12661282
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)