666da86998b2b01f03e7d5a3063835bc3edc727a
[openwrt/staging/neocturne.git] /
1 From 43f0013d9050a0011c05370c9b6123eb059f235b Mon Sep 17 00:00:00 2001
2 From: b-ak <anur.bhargav@gmail.com>
3 Date: Thu, 3 Jan 2019 00:29:14 +0530
4 Subject: [PATCH 303/703] BCM270X: Adding device tree support for AudioSense-Pi
5 add-on soundcard
6
7 Device tree overlay for AudioSense-Pi card.
8
9 To enable support for the hardware add the following
10 line to the RPi /boot/config.txt:
11
12 dtoverlay=audiosense-pi
13
14 More documentation @ arch/arm/boot/dts/overlays/README
15
16 Signed-off-by: b-ak <anur.bhargav@gmail.com>
17 ---
18 arch/arm/boot/dts/overlays/Makefile | 1 +
19 arch/arm/boot/dts/overlays/README | 8 ++
20 .../dts/overlays/audiosense-pi-overlay.dts | 82 +++++++++++++++++++
21 3 files changed, 91 insertions(+)
22 create mode 100644 arch/arm/boot/dts/overlays/audiosense-pi-overlay.dts
23
24 --- a/arch/arm/boot/dts/overlays/Makefile
25 +++ b/arch/arm/boot/dts/overlays/Makefile
26 @@ -20,6 +20,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
27 audioinjector-addons.dtbo \
28 audioinjector-ultra.dtbo \
29 audioinjector-wm8731-audio.dtbo \
30 + audiosense-pi.dtbo \
31 audremap.dtbo \
32 balena-fin.dtbo \
33 bmp085_i2c-sensor.dtbo \
34 --- a/arch/arm/boot/dts/overlays/README
35 +++ b/arch/arm/boot/dts/overlays/README
36 @@ -453,6 +453,14 @@ Load: dtoverlay=audioinjector-wm8731-a
37 Params: <None>
38
39
40 +Name: audiosense-pi
41 +Info: Configures the audiosense-pi add on soundcard
42 + For more information refer to
43 + https://gitlab.com/kakar0t/audiosense-pi
44 +Load: dtoverlay=audiosense-pi
45 +Params: <None>
46 +
47 +
48 Name: audremap
49 Info: Switches PWM sound output to pins 12 (Right) & 13 (Left)
50 Load: dtoverlay=audremap,<param>=<val>
51 --- /dev/null
52 +++ b/arch/arm/boot/dts/overlays/audiosense-pi-overlay.dts
53 @@ -0,0 +1,82 @@
54 +// Definitions for audiosense add on soundcard
55 +/dts-v1/;
56 +/plugin/;
57 +#include <dt-bindings/pinctrl/bcm2835.h>
58 +#include <dt-bindings/gpio/gpio.h>
59 +
60 +/ {
61 + compatible = "brcm,bcm2837", "brcm,bcm2836", "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
62 +
63 + fragment@0 {
64 + target = <&i2s>;
65 + __overlay__ {
66 + status = "okay";
67 + };
68 + };
69 +
70 + fragment@1 {
71 + target-path = "/";
72 + __overlay__ {
73 + codec_reg_1v8: codec-reg-1v8 {
74 + compatible = "regulator-fixed";
75 + regulator-name = "tlv320aic3204_1v8";
76 + regulator-min-microvolt = <1800000>;
77 + regulator-max-microvolt = <1800000>;
78 + regulator-always-on;
79 + };
80 + };
81 + };
82 +
83 + fragment@2 {
84 + target = <&gpio>;
85 + __overlay__ {
86 + codec_rst: codec-rst {
87 + brcm,pins = <26>;
88 + brcm,function = <BCM2835_FSEL_GPIO_OUT>;
89 + };
90 + };
91 + };
92 +
93 + fragment@3 {
94 + target = <&i2c1>;
95 + __overlay__ {
96 + #address-cells = <1>;
97 + #size-cells = <0>;
98 + status = "okay";
99 +
100 + /* audio external oscillator */
101 + codec_osc: codec_osc {
102 + compatible = "fixed-clock";
103 + #clock-cells = <0>;
104 + clock-frequency = <12000000>; /* 12 MHz */
105 + };
106 +
107 + codec: tlv320aic32x4@18 {
108 + #sound-dai-cells = <0>;
109 + compatible = "ti,tlv320aic32x4";
110 + reg = <0x18>;
111 +
112 + clocks = <&codec_osc>;
113 + clock-names = "mclk";
114 +
115 + iov-supply = <&vdd_3v3_reg>;
116 + ldoin-supply = <&vdd_3v3_reg>;
117 +
118 + gpio-controller;
119 + #gpio-cells = <2>;
120 + reset-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
121 +
122 + status = "okay";
123 + };
124 + };
125 + };
126 +
127 + fragment@4 {
128 + target = <&sound>;
129 + __overlay__ {
130 + compatible = "as,audiosense-pi";
131 + i2s-controller = <&i2s>;
132 + status = "okay";
133 + };
134 + };
135 +};