arm64: dts: mt8183: add kukui platform audio node
authorKansho Nishida <kansho@chromium.org>
Tue, 6 Jul 2021 10:01:36 +0000 (19:01 +0900)
committerMatthias Brugger <matthias.bgg@gmail.com>
Mon, 13 Sep 2021 08:51:33 +0000 (10:51 +0200)
Set pin control for the SoC sound node.
The compatibles are set by each model dts.

The codecs that each models use are:
burnet       ts3a227_max98357
damu         da7219_max98357
fennel       da7219_rt1015p
fennel14     da7219_rt1015p
juniper      ts3a227_max98357
kakadu       da7219_rt1015p
kappa        ts3a227_max98357
kenzo        ts3a227_max98357
kodama       ts3a227_max98357
krane        ts3a227_max98357
willow-sku0  da7219_max98357
willow-sku1  ts3a227_max98357

Signed-off-by: Kansho Nishida <kansho@chromium.org>
Link: https://lore.kernel.org/r/20210706190111.v3.2.I6e9ce0f2a489f9a52299656cd966b38ae75e7552@changeid
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
21 files changed:
arch/arm64/boot/dts/mediatek/mt6358.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-max98357a.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-rt1015p.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-max98357a.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-rt1015p.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-max98357a.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-rt1015p.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kappa.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow-sku0.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow-sku1.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi

index fa159b20379e45babcfc9eb1b150291d255f0ee3..95145076b7e658c3c047c7d2f9b702f268e1324e 100644 (file)
@@ -13,6 +13,7 @@
 
                mt6358codec: mt6358codec {
                        compatible = "mediatek,mt6358-sound";
+                       mediatek,dmic-mode = <0>; /* two-wires */
                };
 
                mt6358regulator: mt6358regulator {
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-max98357a.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-max98357a.dtsi
new file mode 100644 (file)
index 0000000..e4aeea4
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) da7219-max98357a sound card.
+ *
+ * Copyright 2019 Google LLC.
+ */
+
+#include "mt8183-kukui-audio-da7219.dtsi"
+#include "mt8183-kukui-audio-max98357a.dtsi"
+
+&sound {
+       compatible = "mediatek,mt8183_da7219_max98357";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-rt1015p.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-rt1015p.dtsi
new file mode 100644 (file)
index 0000000..16ce5a3
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) da7219-rt1015p sound card.
+ *
+ * Copyright 2020 Google LLC.
+ */
+
+#include "mt8183-kukui-audio-da7219.dtsi"
+#include "mt8183-kukui-audio-rt1015p.dtsi"
+
+&sound {
+       compatible = "mediatek,mt8183_da7219_rt1015p";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219.dtsi
new file mode 100644 (file)
index 0000000..2c69e76
--- /dev/null
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) audio fragment for da7219.
+ *
+ * Copyright 2020 Google LLC.
+ */
+
+&i2c5 {
+       da7219: da7219@1a {
+               pinctrl-names = "default";
+               pinctrl-0 = <&da7219_pins>;
+               compatible = "dlg,da7219";
+               reg = <0x1a>;
+               interrupt-parent = <&pio>;
+               interrupts = <165 IRQ_TYPE_LEVEL_LOW 165 0>;
+
+               dlg,micbias-lvl = <2600>;
+               dlg,mic-amp-in-sel = "diff";
+               VDD-supply = <&pp1800_alw>;
+               VDDMIC-supply = <&pp3300_alw>;
+               VDDIO-supply = <&pp1800_alw>;
+
+               status = "okay";
+
+               da7219_aad {
+                       dlg,adc-1bit-rpt = <1>;
+                       dlg,btn-avg = <4>;
+                       dlg,btn-cfg = <50>;
+                       dlg,mic-det-thr = <500>;
+                       dlg,jack-ins-deb = <20>;
+                       dlg,jack-det-rate = "32ms_64ms";
+                       dlg,jack-rem-deb = <1>;
+
+                       dlg,a-d-btn-thr = <0xa>;
+                       dlg,d-b-btn-thr = <0x16>;
+                       dlg,b-c-btn-thr = <0x21>;
+                       dlg,c-mic-btn-thr = <0x3E>;
+               };
+       };
+};
+
+&pio {
+       da7219_pins: da7219_pins {
+               pins1 {
+                       pinmux = <PINMUX_GPIO165__FUNC_GPIO165>;
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+};
+
+&sound {
+       mediatek,headset-codec = <&da7219>;
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-max98357a.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-max98357a.dtsi
new file mode 100644 (file)
index 0000000..2b60967
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) audio fragment for max98357a.
+ *
+ * Copyright 2020 Google LLC.
+ */
+
+/ {
+       max98357a: max98357a {
+               compatible = "maxim,max98357a";
+               sdmode-gpios = <&pio 175 0>;
+       };
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-rt1015p.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-rt1015p.dtsi
new file mode 100644 (file)
index 0000000..658a764
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) audio fragment for rt1015p.
+ *
+ * Copyright 2020 Google LLC.
+ */
+
+/ {
+       rt1015p: rt1015p {
+               compatible = "realtek,rt1015p";
+               sdb-gpios = <&pio 175 0>;
+       };
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-max98357a.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-max98357a.dtsi
new file mode 100644 (file)
index 0000000..260a5f5
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) ts3a227e-max98357a sound card.
+ *
+ * Copyright 2020 Google LLC.
+ */
+
+#include "mt8183-kukui-audio-max98357a.dtsi"
+#include "mt8183-kukui-audio-ts3a227e.dtsi"
+
+&sound {
+       compatible = "mediatek,mt8183_mt6358_ts3a227_max98357";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-rt1015p.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-rt1015p.dtsi
new file mode 100644 (file)
index 0000000..2f7d1fa
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) mt6358-ts3a227-rt1015p sound card.
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+#include "mt8183-kukui-audio-ts3a227e.dtsi"
+#include "mt8183-kukui-audio-rt1015p.dtsi"
+
+&sound {
+       compatible = "mediatek,mt8183_mt6358_ts3a227_rt1015p";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e.dtsi
new file mode 100644 (file)
index 0000000..0799c48
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Google Kukui (and derivatives) audio fragment for ts3a227e.
+ *
+ * Copyright 2019 Google LLC.
+ */
+
+&i2c5 {
+       ts3a227e: ts3a227e@3b {
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts3a227e_pins>;
+               compatible = "ti,ts3a227e";
+               reg = <0x3b>;
+               interrupt-parent = <&pio>;
+               interrupts = <157 IRQ_TYPE_LEVEL_LOW>;
+               status = "okay";
+       };
+};
+
+&pio {
+       ts3a227e_pins: ts3a227e_pins {
+               pins1 {
+                       pinmux = <PINMUX_GPIO157__FUNC_GPIO157>;
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+};
+
+&sound {
+       mediatek,headset-codec = <&ts3a227e>;
+};
index a8d6f32ade8d9832064da6b6d03f4af1bdb18440..1a2ec0787d3caa5ae29e3d3f510681f28fd427c7 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        model = "Google burnet board";
index 42ba9c00866cd692b82a4c6068ba514d6d97539c..0eca3ff8672a755cf60359a9f1be88832c59844f 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi.dtsi"
+#include "mt8183-kukui-audio-da7219-max98357a.dtsi"
 
 / {
        model = "Google damu board";
index bbe6c338f465ee7c11bfbfc30767bdb142706480..577519a775c05713cf98e140af91d37ba5c3fd49 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi.dtsi"
+#include "mt8183-kukui-audio-da7219-rt1015p.dtsi"
 
 &mt6358codec {
        mediatek,dmic-mode = <1>; /* one-wire */
index 36d2c3b3cadf9abee7520b355c5539d7eeb0f9db..bc2c57f0a827b1fdbc09320964e689206e335774 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi-juniper.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        model = "Google juniper sku16 board";
index b3f46c16e5d7b61ec6eacc325c6dad1a6c18126a..e5bd9191e42619460a40b6a1edbd24be37b6abde 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        model = "Google kappa board";
index 6f1aa692753ad6d10d3000eab29d9e0281667870..8fa89db03e639990bdcb3a6e8575e7822fa1a849 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi-juniper.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        model = "Google kenzo sku17 board";
index 281265f082dbbaf30b3900e12c31acfae97d72c7..89208b843b276508f0218e7bdafdda3ed9d4ed85 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi-willow.dtsi"
+#include "mt8183-kukui-audio-da7219-max98357a.dtsi"
 
 / {
        model = "Google willow board sku0";
index 22e56bdc1ee37fcd084c98c272fb94f3c8e69a1c..c7b20441d053da2bf5a014059d0df309ccd2fbf8 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-jacuzzi-willow.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        model = "Google willow board sku1";
index 20eb0dc68f094903dc0f59dab3057d2c1565cffa..89a139a0ee44426922c1d3e5bbe9c8375a22a1e7 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui-kakadu.dtsi"
+#include "mt8183-kukui-audio-da7219-rt1015p.dtsi"
 
 / {
        model = "MediaTek kakadu board";
index 3aa79403c0c2c24d1007c309acf17b502d8f8a5c..06f8c80bf553651e66ae49cbfffb567180617a73 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 #include "mt8183-kukui.dtsi"
+#include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi"
 
 / {
        ppvarn_lcd: ppvarn-lcd {
index 30c183c96a54cb0b72a31cda50db9617c670e12b..a7b0cb3ff7b0aba4a135c6df770dcd1dad6b5e92 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "mt8183-kukui.dtsi"
+#include "mt8183-kukui-audio-max98357a.dtsi"
 
 / {
        ppvarn_lcd: ppvarn-lcd {
 &qca_wifi {
        qcom,ath10k-calibration-variant = "LE_Krane";
 };
+
+&sound {
+       compatible = "mediatek,mt8183_mt6358_ts3a227_max98357";
+};
index 8e9cf36a9a41ac48992b352abe59e764148ededd..b42d81d26d721163966ceadb1d41223ec9eaedf7 100644 (file)
                };
        };
 
-       max98357a: codec0 {
-               compatible = "maxim,max98357a";
-               sdmode-gpios = <&pio 175 0>;
+       sound: mt8183-sound {
+               mediatek,platform = <&afe>;
+               pinctrl-names = "default",
+                               "aud_tdm_out_on",
+                               "aud_tdm_out_off";
+               pinctrl-0 = <&aud_pins_default>;
+               pinctrl-1 = <&aud_pins_tdm_out_on>;
+               pinctrl-2 = <&aud_pins_tdm_out_off>;
+               status = "okay";
        };
 
-       btsco: codec1 {
+       btsco: bt-sco {
                compatible = "linux,bt-sco";
        };
 
        };
 };
 
+&afe {
+       i2s3-share = "I2S2";
+       i2s0-share = "I2S5";
+};
+
 &auxadc {
        status = "okay";
 };
 };
 
 &pio {
+       aud_pins_default: audiopins {
+               pins_bus {
+                       pinmux = <PINMUX_GPIO97__FUNC_I2S2_MCK>,
+                               <PINMUX_GPIO98__FUNC_I2S2_BCK>,
+                               <PINMUX_GPIO101__FUNC_I2S2_LRCK>,
+                               <PINMUX_GPIO102__FUNC_I2S2_DI>,
+                               <PINMUX_GPIO3__FUNC_I2S3_DO>, /*i2s to da7219/max98357*/
+                               <PINMUX_GPIO89__FUNC_I2S5_BCK>,
+                               <PINMUX_GPIO90__FUNC_I2S5_LRCK>,
+                               <PINMUX_GPIO91__FUNC_I2S5_DO>,
+                               <PINMUX_GPIO174__FUNC_I2S0_DI>, /*i2s to wifi/bt*/
+                               <PINMUX_GPIO136__FUNC_AUD_CLK_MOSI>,
+                               <PINMUX_GPIO137__FUNC_AUD_SYNC_MOSI>,
+                               <PINMUX_GPIO138__FUNC_AUD_DAT_MOSI0>,
+                               <PINMUX_GPIO139__FUNC_AUD_DAT_MOSI1>,
+                               <PINMUX_GPIO140__FUNC_AUD_CLK_MISO>,
+                               <PINMUX_GPIO141__FUNC_AUD_SYNC_MISO>,
+                               <PINMUX_GPIO142__FUNC_AUD_DAT_MISO0>,
+                               <PINMUX_GPIO143__FUNC_AUD_DAT_MISO1>; /*mtkaif3.0*/
+               };
+       };
+
+       aud_pins_tdm_out_on: audiotdmouton {
+               pins_bus {
+                       pinmux = <PINMUX_GPIO169__FUNC_TDM_BCK_2ND>,
+                               <PINMUX_GPIO170__FUNC_TDM_LRCK_2ND>,
+                               <PINMUX_GPIO171__FUNC_TDM_DATA0_2ND>,
+                               <PINMUX_GPIO172__FUNC_TDM_DATA1_2ND>,
+                               <PINMUX_GPIO173__FUNC_TDM_DATA2_2ND>,
+                               <PINMUX_GPIO10__FUNC_TDM_DATA3>; /*8ch-i2s to it6505*/
+                       drive-strength = <MTK_DRIVE_6mA>;
+               };
+       };
+
+       aud_pins_tdm_out_off: audiotdmoutoff {
+               pins_bus {
+                       pinmux = <PINMUX_GPIO169__FUNC_GPIO169>,
+                               <PINMUX_GPIO170__FUNC_GPIO170>,
+                               <PINMUX_GPIO171__FUNC_GPIO171>,
+                               <PINMUX_GPIO172__FUNC_GPIO172>,
+                               <PINMUX_GPIO173__FUNC_GPIO173>,
+                               <PINMUX_GPIO10__FUNC_GPIO10>;
+                       input-enable;
+                       bias-pull-down;
+                       drive-strength = <MTK_DRIVE_2mA>;
+               };
+       };
+
        bt_pins: bt-pins {
                pins_bt_en {
                        pinmux = <PINMUX_GPIO120__FUNC_GPIO120>;