/* Device tree overlay for the Microchip MCP3204 12-bit A/D Converter */ /* on the Mikroelektronika Pi 3 Click Shield (MIKROE-2756). */ /dts-v1/; /plugin/; / { compatible = "brcm,bcm2712"; // Create a fictitious voltage regulator for the MCP3204 reference fragment@0 { target-path = "/"; __overlay__ { piclick3_vref: piclick3-vref { compatible = "regulator-fixed"; regulator-name = "piclick3_mcp1541"; regulator-min-microvolt = <4096000>; regulator-max-microvolt = <4096000>; regulator-always-on; status = "okay"; }; }; }; // Power up the PWM controller, but don't assign any pins fragment@1 { target = <&pwm>; frag1: __overlay__ { assigned-clock-rates = <30720000>; status = "okay"; }; }; fragment@2 { target = <&gpio>; __overlay__ { spi1_pins: spi1_pins { brcm,pins = <19 20 21>; brcm,function = <3>; /* alt4 */ }; spi1_cs_pins: spi1_cs_pins { brcm,pins = <16>; brcm,function = <1>; /* output */ }; }; }; fragment@3 { target = <&spi1>; frag2: __overlay__ { #address-cells = <1>; #size-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&spi1_pins &spi1_cs_pins>; cs-gpios = <&gpio 16 1>; status = "okay"; spidev1_0: spidev@0 { compatible = "spidev"; reg = <0>; /* CE0 */ #address-cells = <1>; #size-cells = <0>; spi-max-frequency = <125000000>; status = "okay"; }; }; }; fragment@4 { target = <&aux>; __overlay__ { status = "okay"; }; }; fragment@5 { target-path = "spi1/spidev@0"; __overlay__ { status = "disabled"; }; }; fragment@6 { target = <&spi1>; __overlay__ { status = "okay"; #address-cells = <1>; #size-cells = <0>; mcp3204_10: mcp3204@0 { compatible = "mcp3204"; reg = <0>; spi-max-frequency = <2000000>; vref-supply = <&piclick3_vref>; }; }; }; };