1 From 3fbe7d511602b2888eec568b8870484a06e165e7 Mon Sep 17 00:00:00 2001
2 From: Annaliese McDermond <nh6z@nh6z.net>
3 Date: Sun, 17 Mar 2019 16:48:36 -0700
4 Subject: [PATCH 418/725] dtoverlays: Add Support for the UDRC/DRAWS
6 Adds a new overlay to support the Northwest Digital Radio
7 DRAWS and UDRC HATs. See http://nwdigitalradio.com.
9 Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
11 arch/arm/boot/dts/overlays/Makefile | 2 +
12 arch/arm/boot/dts/overlays/README | 59 ++++++
13 arch/arm/boot/dts/overlays/draws-overlay.dts | 200 +++++++++++++++++++
14 arch/arm/boot/dts/overlays/udrc-overlay.dts | 128 ++++++++++++
15 4 files changed, 389 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/draws-overlay.dts
17 create mode 100644 arch/arm/boot/dts/overlays/udrc-overlay.dts
19 --- a/arch/arm/boot/dts/overlays/Makefile
20 +++ b/arch/arm/boot/dts/overlays/Makefile
21 @@ -29,6 +29,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
22 dionaudio-loco-v2.dtbo \
29 @@ -146,6 +147,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
35 upstream-aux-interrupt.dtbo \
37 --- a/arch/arm/boot/dts/overlays/README
38 +++ b/arch/arm/boot/dts/overlays/README
39 @@ -531,6 +531,59 @@ Load: dtoverlay=dpi24
44 +Info: Configures the NW Digital Radio DRAWS Hat
46 + The board includes an ADC to measure various board values and also
47 + provides two analog user inputs on the expansion header. The ADC
48 + can be configured for various sample rates and gain values to adjust
49 + the input range. Tables describing the two parameters follow.
61 + ADC Datarate Values:
66 + 4 = 1600sps (default)
70 +Load: dtoverlay=draws,<param>=<val>
71 +Params: draws_adc_ch4_gain Sets the full scale resolution of the ADCs
72 + input voltage sensor (default 1)
74 + draws_adc_ch4_datarate Sets the datarate of the ADCs input voltage
77 + draws_adc_ch5_gain Sets the full scale resolution of the ADCs
78 + 5V rail voltage sensor (default 1)
80 + draws_adc_ch5_datarate Sets the datarate of the ADCs 4V rail voltage
83 + draws_adc_ch6_gain Sets the full scale resolution of the ADCs
84 + AIN2 input (default 2)
86 + draws_adc_ch6_datarate Sets the datarate of the ADCs AIN2 input
88 + draws_adc_ch7_gain Sets the full scale resolution of the ADCs
89 + AIN3 input (default 2)
91 + draws_adc_ch7_datarate Sets the datarate of the ADCs AIN3 input
93 + alsaname Name of the ALSA audio device (default "draws")
97 Info: Selects the dwc_otg USB controller driver which has fiq support. This
98 is the default on all except the Pi Zero which defaults to dwc2.
99 @@ -2117,6 +2170,12 @@ Params: txd1_pin GPIO pin
100 rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15)
104 +Info: Configures the NW Digital Radio UDRC Hat
105 +Load: dtoverlay=udrc,<param>=<val>
106 +Params: alsaname Name of the ALSA audio device (default "udrc")
110 Info: Allow usage of downstream .dtb with upstream kernel. Comprises
111 vc4-kms-v3d, dwc2 and upstream-aux-interrupt overlays.
113 +++ b/arch/arm/boot/dts/overlays/draws-overlay.dts
115 +#include <dt-bindings/clock/bcm2835.h>
117 + * Device tree overlay for the DRAWS Hardware
124 + compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
136 + compatible = "simple-bus";
137 + #address-cells = <1>;
140 + udrc0_ldoin: udrc0_ldoin {
141 + compatible = "regulator-fixed";
142 + regulator-name = "ldoin";
143 + regulator-min-microvolt = <3300000>;
144 + regulator-max-microvolt = <3300000>;
145 + regulator-always-on;
150 + compatible = "pps-gpio";
151 + pinctrl-names = "default";
152 + pinctrl-0 = <&pps_pins>;
153 + gpios = <&gpio 7 0>;
160 + target = <&i2c_arm>;
162 + #address-cells = <1>;
166 + tlv320aic32x4: tlv320aic32x4@18 {
167 + compatible = "ti,tlv320aic32x4";
169 + #sound-dai-cells = <0>;
172 + clocks = <&clocks BCM2835_CLOCK_GP0>;
173 + clock-names = "mclk";
174 + assigned-clocks = <&clocks BCM2835_CLOCK_GP0>;
175 + assigned-clock-rates = <25000000>;
177 + pinctrl-names = "default";
178 + pinctrl-0 = <&gpclk0_pin &aic3204_reset>;
180 + reset-gpios = <&gpio 13 0>;
182 + iov-supply = <&udrc0_ldoin>;
183 + ldoin-supply = <&udrc0_ldoin>;
186 + sc16is752: sc16is752@50 {
187 + compatible = "nxp,sc16is752";
189 + clocks = <&sc16is752_clk>;
190 + interrupt-parent = <&gpio>;
191 + interrupts = <17 2>; /* IRQ_TYPE_EDGE_FALLING */
193 + pinctrl-names = "default";
194 + pinctrl-0 = <&sc16is752_irq>;
196 + sc16is752_clk: sc16is752_clk {
197 + compatible = "fixed-clock";
198 + #clock-cells = <0>;
199 + clock-frequency = <1843200>;
203 + tla2024: tla2024@48 {
204 + compatible = "ti,ads1015";
206 + #address-cells = <1>;
209 + adc_ch4: channel@4 {
215 + adc_ch5: channel@5 {
221 + adc_ch6: channel@6 {
227 + adc_ch7: channel@7 {
239 + compatible = "simple-audio-card";
240 + i2s-controller = <&i2s>;
243 + simple-audio-card,name = "draws";
244 + simple-audio-card,format = "i2s";
246 + simple-audio-card,bitclock-master = <&dailink0_master>;
247 + simple-audio-card,frame-master = <&dailink0_master>;
249 + simple-audio-card,widgets =
251 + "Line", "Line Out";
253 + simple-audio-card,routing =
254 + "IN1_R", "Line In",
255 + "IN1_L", "Line In",
261 + dailink0_master: simple-audio-card,cpu {
262 + sound-dai = <&i2s>;
265 + simple-audio-card,codec {
266 + sound-dai = <&tlv320aic32x4>;
274 + gpclk0_pin: gpclk0_pin {
276 + brcm,function = <4>;
279 + aic3204_reset: aic3204_reset {
281 + brcm,function = <1>;
285 + aic3204_gpio: aic3204_gpio {
289 + sc16is752_irq: sc16is752_irq {
291 + brcm,function = <0>;
295 + pps_pins: pps_pins {
297 + brcm,function = <0>;
304 + draws_adc_ch4_gain = <&adc_ch4>,"ti,gain:0";
305 + draws_adc_ch4_datarate = <&adc_ch4>,"ti,datarate:0";
306 + draws_adc_ch5_gain = <&adc_ch5>,"ti,gain:0";
307 + draws_adc_ch5_datarate = <&adc_ch5>,"ti,datarate:0";
308 + draws_adc_ch6_gain = <&adc_ch6>,"ti,gain:0";
309 + draws_adc_ch6_datarate = <&adc_ch6>,"ti,datarate:0";
310 + draws_adc_ch7_gain = <&adc_ch7>,"ti,gain:0";
311 + draws_adc_ch7_datarate = <&adc_ch7>,"ti,datarate:0";
312 + alsaname = <&snd>, "simple-audio-card,name";
316 +++ b/arch/arm/boot/dts/overlays/udrc-overlay.dts
318 +#include <dt-bindings/clock/bcm2835.h>
320 + * Device tree overlay for the Universal Digital Radio Controller
327 + compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
331 + clocks = <&clocks BCM2835_CLOCK_PCM>;
332 + clock-names = "pcm";
341 + compatible = "simple-bus";
342 + #address-cells = <1>;
345 + udrc0_ldoin: udrc0_ldoin {
346 + compatible = "regulator-fixed";
347 + regulator-name = "ldoin";
348 + regulator-min-microvolt = <3300000>;
349 + regulator-max-microvolt = <3300000>;
350 + regulator-always-on;
359 + #address-cells = <1>;
362 + clocks = <&clocks BCM2835_CLOCK_VPU>;
363 + clock-frequency = <400000>;
365 + tlv320aic32x4: tlv320aic32x4@18 {
366 + compatible = "ti,tlv320aic32x4";
367 + #sound-dai-cells = <0>;
371 + clocks = <&clocks BCM2835_CLOCK_GP0>;
372 + clock-names = "mclk";
373 + assigned-clocks = <&clocks BCM2835_CLOCK_GP0>;
374 + assigned-clock-rates = <25000000>;
376 + pinctrl-names = "default";
377 + pinctrl-0 = <&gpclk0_pin &aic3204_reset>;
379 + reset-gpios = <&gpio 13 0>;
381 + iov-supply = <&udrc0_ldoin>;
382 + ldoin-supply = <&udrc0_ldoin>;
390 + compatible = "simple-audio-card";
391 + i2s-controller = <&i2s>;
394 + simple-audio-card,name = "udrc";
395 + simple-audio-card,format = "i2s";
397 + simple-audio-card,bitclock-master = <&dailink0_master>;
398 + simple-audio-card,frame-master = <&dailink0_master>;
400 + simple-audio-card,widgets =
402 + "Line", "Line Out";
404 + simple-audio-card,routing =
405 + "IN1_R", "Line In",
406 + "IN1_L", "Line In",
412 + dailink0_master: simple-audio-card,cpu {
413 + sound-dai = <&i2s>;
416 + simple-audio-card,codec {
417 + sound-dai = <&tlv320aic32x4>;
425 + gpclk0_pin: gpclk0_pin {
427 + brcm,function = <4>;
430 + aic3204_reset: aic3204_reset {
432 + brcm,function = <1>;
436 + aic3204_gpio: aic3204_gpio {
443 + alsaname = <&snd>, "simple-audio-card,name";