Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: mt8183: add kukui platform audio node

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>

authored by

Kansho Nishida and committed by
Matthias Brugger
d2bbd5d9 13dd23cf

+243 -4
+1
arch/arm64/boot/dts/mediatek/mt6358.dtsi
··· 13 13 14 14 mt6358codec: mt6358codec { 15 15 compatible = "mediatek,mt6358-sound"; 16 + mediatek,dmic-mode = <0>; /* two-wires */ 16 17 }; 17 18 18 19 mt6358regulator: mt6358regulator {
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-max98357a.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) da7219-max98357a sound card. 4 + * 5 + * Copyright 2019 Google LLC. 6 + */ 7 + 8 + #include "mt8183-kukui-audio-da7219.dtsi" 9 + #include "mt8183-kukui-audio-max98357a.dtsi" 10 + 11 + &sound { 12 + compatible = "mediatek,mt8183_da7219_max98357"; 13 + };
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219-rt1015p.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) da7219-rt1015p sound card. 4 + * 5 + * Copyright 2020 Google LLC. 6 + */ 7 + 8 + #include "mt8183-kukui-audio-da7219.dtsi" 9 + #include "mt8183-kukui-audio-rt1015p.dtsi" 10 + 11 + &sound { 12 + compatible = "mediatek,mt8183_da7219_rt1015p"; 13 + };
+54
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-da7219.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) audio fragment for da7219. 4 + * 5 + * Copyright 2020 Google LLC. 6 + */ 7 + 8 + &i2c5 { 9 + da7219: da7219@1a { 10 + pinctrl-names = "default"; 11 + pinctrl-0 = <&da7219_pins>; 12 + compatible = "dlg,da7219"; 13 + reg = <0x1a>; 14 + interrupt-parent = <&pio>; 15 + interrupts = <165 IRQ_TYPE_LEVEL_LOW 165 0>; 16 + 17 + dlg,micbias-lvl = <2600>; 18 + dlg,mic-amp-in-sel = "diff"; 19 + VDD-supply = <&pp1800_alw>; 20 + VDDMIC-supply = <&pp3300_alw>; 21 + VDDIO-supply = <&pp1800_alw>; 22 + 23 + status = "okay"; 24 + 25 + da7219_aad { 26 + dlg,adc-1bit-rpt = <1>; 27 + dlg,btn-avg = <4>; 28 + dlg,btn-cfg = <50>; 29 + dlg,mic-det-thr = <500>; 30 + dlg,jack-ins-deb = <20>; 31 + dlg,jack-det-rate = "32ms_64ms"; 32 + dlg,jack-rem-deb = <1>; 33 + 34 + dlg,a-d-btn-thr = <0xa>; 35 + dlg,d-b-btn-thr = <0x16>; 36 + dlg,b-c-btn-thr = <0x21>; 37 + dlg,c-mic-btn-thr = <0x3E>; 38 + }; 39 + }; 40 + }; 41 + 42 + &pio { 43 + da7219_pins: da7219_pins { 44 + pins1 { 45 + pinmux = <PINMUX_GPIO165__FUNC_GPIO165>; 46 + input-enable; 47 + bias-pull-up; 48 + }; 49 + }; 50 + }; 51 + 52 + &sound { 53 + mediatek,headset-codec = <&da7219>; 54 + };
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-max98357a.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) audio fragment for max98357a. 4 + * 5 + * Copyright 2020 Google LLC. 6 + */ 7 + 8 + / { 9 + max98357a: max98357a { 10 + compatible = "maxim,max98357a"; 11 + sdmode-gpios = <&pio 175 0>; 12 + }; 13 + };
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-rt1015p.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) audio fragment for rt1015p. 4 + * 5 + * Copyright 2020 Google LLC. 6 + */ 7 + 8 + / { 9 + rt1015p: rt1015p { 10 + compatible = "realtek,rt1015p"; 11 + sdb-gpios = <&pio 175 0>; 12 + }; 13 + };
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-max98357a.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) ts3a227e-max98357a sound card. 4 + * 5 + * Copyright 2020 Google LLC. 6 + */ 7 + 8 + #include "mt8183-kukui-audio-max98357a.dtsi" 9 + #include "mt8183-kukui-audio-ts3a227e.dtsi" 10 + 11 + &sound { 12 + compatible = "mediatek,mt8183_mt6358_ts3a227_max98357"; 13 + };
+13
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e-rt1015p.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) mt6358-ts3a227-rt1015p sound card. 4 + * 5 + * Copyright 2021 Google LLC. 6 + */ 7 + 8 + #include "mt8183-kukui-audio-ts3a227e.dtsi" 9 + #include "mt8183-kukui-audio-rt1015p.dtsi" 10 + 11 + &sound { 12 + compatible = "mediatek,mt8183_mt6358_ts3a227_rt1015p"; 13 + };
+32
arch/arm64/boot/dts/mediatek/mt8183-kukui-audio-ts3a227e.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 + /* 3 + * Google Kukui (and derivatives) audio fragment for ts3a227e. 4 + * 5 + * Copyright 2019 Google LLC. 6 + */ 7 + 8 + &i2c5 { 9 + ts3a227e: ts3a227e@3b { 10 + pinctrl-names = "default"; 11 + pinctrl-0 = <&ts3a227e_pins>; 12 + compatible = "ti,ts3a227e"; 13 + reg = <0x3b>; 14 + interrupt-parent = <&pio>; 15 + interrupts = <157 IRQ_TYPE_LEVEL_LOW>; 16 + status = "okay"; 17 + }; 18 + }; 19 + 20 + &pio { 21 + ts3a227e_pins: ts3a227e_pins { 22 + pins1 { 23 + pinmux = <PINMUX_GPIO157__FUNC_GPIO157>; 24 + input-enable; 25 + bias-pull-up; 26 + }; 27 + }; 28 + }; 29 + 30 + &sound { 31 + mediatek,headset-codec = <&ts3a227e>; 32 + };
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-burnet.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google burnet board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi.dtsi" 8 + #include "mt8183-kukui-audio-da7219-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google damu board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-fennel.dtsi
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi.dtsi" 8 + #include "mt8183-kukui-audio-da7219-rt1015p.dtsi" 8 9 9 10 &mt6358codec { 10 11 mediatek,dmic-mode = <1>; /* one-wire */
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi-juniper.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google juniper sku16 board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kappa.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google kappa board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi-juniper.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google kenzo sku17 board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow-sku0.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi-willow.dtsi" 8 + #include "mt8183-kukui-audio-da7219-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google willow board sku0";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-willow-sku1.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-jacuzzi-willow.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 model = "Google willow board sku1";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dts
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui-kakadu.dtsi" 8 + #include "mt8183-kukui-audio-da7219-rt1015p.dtsi" 8 9 9 10 / { 10 11 model = "MediaTek kakadu board";
+1
arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi
··· 5 5 6 6 /dts-v1/; 7 7 #include "mt8183-kukui.dtsi" 8 + #include "mt8183-kukui-audio-ts3a227e-max98357a.dtsi" 8 9 9 10 / { 10 11 ppvarn_lcd: ppvarn-lcd {
+5
arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi
··· 4 4 */ 5 5 6 6 #include "mt8183-kukui.dtsi" 7 + #include "mt8183-kukui-audio-max98357a.dtsi" 7 8 8 9 / { 9 10 ppvarn_lcd: ppvarn-lcd { ··· 345 344 346 345 &qca_wifi { 347 346 qcom,ath10k-calibration-variant = "LE_Krane"; 347 + }; 348 + 349 + &sound { 350 + compatible = "mediatek,mt8183_mt6358_ts3a227_max98357"; 348 351 };
+63 -4
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
··· 115 115 }; 116 116 }; 117 117 118 - max98357a: codec0 { 119 - compatible = "maxim,max98357a"; 120 - sdmode-gpios = <&pio 175 0>; 118 + sound: mt8183-sound { 119 + mediatek,platform = <&afe>; 120 + pinctrl-names = "default", 121 + "aud_tdm_out_on", 122 + "aud_tdm_out_off"; 123 + pinctrl-0 = <&aud_pins_default>; 124 + pinctrl-1 = <&aud_pins_tdm_out_on>; 125 + pinctrl-2 = <&aud_pins_tdm_out_off>; 126 + status = "okay"; 121 127 }; 122 128 123 - btsco: codec1 { 129 + btsco: bt-sco { 124 130 compatible = "linux,bt-sco"; 125 131 }; 126 132 ··· 219 213 120000 183 220 214 125000 161>; 221 215 }; 216 + }; 217 + 218 + &afe { 219 + i2s3-share = "I2S2"; 220 + i2s0-share = "I2S5"; 222 221 }; 223 222 224 223 &auxadc { ··· 413 402 }; 414 403 415 404 &pio { 405 + aud_pins_default: audiopins { 406 + pins_bus { 407 + pinmux = <PINMUX_GPIO97__FUNC_I2S2_MCK>, 408 + <PINMUX_GPIO98__FUNC_I2S2_BCK>, 409 + <PINMUX_GPIO101__FUNC_I2S2_LRCK>, 410 + <PINMUX_GPIO102__FUNC_I2S2_DI>, 411 + <PINMUX_GPIO3__FUNC_I2S3_DO>, /*i2s to da7219/max98357*/ 412 + <PINMUX_GPIO89__FUNC_I2S5_BCK>, 413 + <PINMUX_GPIO90__FUNC_I2S5_LRCK>, 414 + <PINMUX_GPIO91__FUNC_I2S5_DO>, 415 + <PINMUX_GPIO174__FUNC_I2S0_DI>, /*i2s to wifi/bt*/ 416 + <PINMUX_GPIO136__FUNC_AUD_CLK_MOSI>, 417 + <PINMUX_GPIO137__FUNC_AUD_SYNC_MOSI>, 418 + <PINMUX_GPIO138__FUNC_AUD_DAT_MOSI0>, 419 + <PINMUX_GPIO139__FUNC_AUD_DAT_MOSI1>, 420 + <PINMUX_GPIO140__FUNC_AUD_CLK_MISO>, 421 + <PINMUX_GPIO141__FUNC_AUD_SYNC_MISO>, 422 + <PINMUX_GPIO142__FUNC_AUD_DAT_MISO0>, 423 + <PINMUX_GPIO143__FUNC_AUD_DAT_MISO1>; /*mtkaif3.0*/ 424 + }; 425 + }; 426 + 427 + aud_pins_tdm_out_on: audiotdmouton { 428 + pins_bus { 429 + pinmux = <PINMUX_GPIO169__FUNC_TDM_BCK_2ND>, 430 + <PINMUX_GPIO170__FUNC_TDM_LRCK_2ND>, 431 + <PINMUX_GPIO171__FUNC_TDM_DATA0_2ND>, 432 + <PINMUX_GPIO172__FUNC_TDM_DATA1_2ND>, 433 + <PINMUX_GPIO173__FUNC_TDM_DATA2_2ND>, 434 + <PINMUX_GPIO10__FUNC_TDM_DATA3>; /*8ch-i2s to it6505*/ 435 + drive-strength = <MTK_DRIVE_6mA>; 436 + }; 437 + }; 438 + 439 + aud_pins_tdm_out_off: audiotdmoutoff { 440 + pins_bus { 441 + pinmux = <PINMUX_GPIO169__FUNC_GPIO169>, 442 + <PINMUX_GPIO170__FUNC_GPIO170>, 443 + <PINMUX_GPIO171__FUNC_GPIO171>, 444 + <PINMUX_GPIO172__FUNC_GPIO172>, 445 + <PINMUX_GPIO173__FUNC_GPIO173>, 446 + <PINMUX_GPIO10__FUNC_GPIO10>; 447 + input-enable; 448 + bias-pull-down; 449 + drive-strength = <MTK_DRIVE_2mA>; 450 + }; 451 + }; 452 + 416 453 bt_pins: bt-pins { 417 454 pins_bt_en { 418 455 pinmux = <PINMUX_GPIO120__FUNC_GPIO120>;