Skip to content

Commit 12ffe6f

Browse files
author
André Apitzsch
committed
arm64: dts: qcom: msm8939-longcheer-l9100: Add sound support
Signed-off-by: André Apitzsch <[email protected]>
1 parent d9c33a3 commit 12ffe6f

File tree

1 file changed

+217
-1
lines changed

1 file changed

+217
-1
lines changed

arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts

Lines changed: 217 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <dt-bindings/input/input.h>
1010
#include <dt-bindings/interrupt-controller/irq.h>
1111
#include <dt-bindings/leds/common.h>
12+
#include <dt-bindings/mfd/arizona.h>
1213
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
1314
#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
1415

@@ -73,6 +74,16 @@
7374
};
7475
};
7576

77+
/* regulator-spk {
78+
compatible = "regulator-fixed";
79+
regulator-name = "spk_vreg";
80+
startup-delay-us = <0>;
81+
enable-active-high;
82+
regulator-boot-on;
83+
regulator-always-on;
84+
gpio = <&tlmm 101 GPIO_ACTIVE_HIGH>;
85+
};*/
86+
7687
reg_ts_vdd: regulator-vdd-ts {
7788
compatible = "regulator-fixed";
7889
regulator-name = "regulator-vdd-ts";
@@ -122,6 +133,81 @@
122133

123134
};
124135

136+
&blsp_i2c1 {
137+
status = "okay";
138+
139+
speaker_codec: audio-codec@1a {
140+
compatible = "wlf,wm8998";
141+
reg = <0x1a>;
142+
143+
reset-gpios = <&tlmm 120 GPIO_ACTIVE_HIGH>;
144+
wlf,ldoena-gpios = <&tlmm 114 GPIO_ACTIVE_HIGH>;
145+
146+
pinctrl-0 = <&wlf_int_active &speaker_codec_default &speaker_codec_reset_default>;
147+
pinctrl-1 = <&wlf_int_suspend &speaker_codec_sleep &speaker_codec_reset_sleep>;
148+
pinctrl-names = "default", "sleep";
149+
150+
// TODO add pinctl for 114?
151+
// TODO add pinctl for 101?
152+
153+
gpio-controller;
154+
#gpio-cells = <2>;
155+
156+
sound-name-prefix = "Speaker";
157+
#sound-dai-cells = <1>;
158+
159+
AVDD-supply = <&pm8916_l6>;
160+
DBVDD1-supply = <&pm8916_l6>;
161+
DBVDD2-supply = <&pm8916_l6>;
162+
DBVDD3-supply = <&pm8916_l6>;
163+
CPVDD-supply = <&pm8916_l6>;
164+
SPKVDDL-supply = <&pm8916_l6>;
165+
SPKVDDR-supply = <&pm8916_l6>;
166+
167+
interrupt-controller;
168+
#interrupt-cells = <2>;
169+
interrupts-extended = <&tlmm 69 IRQ_TYPE_LEVEL_LOW>;
170+
171+
clocks = <&rpmcc RPM_SMD_BB_CLK2>;
172+
clock-names = "mclk1";
173+
174+
wlf,gpio-defaults = <
175+
ARIZONA_GP_DEFAULT
176+
ARIZONA_GP_DEFAULT
177+
ARIZONA_GP_DEFAULT
178+
ARIZONA_GP_DEFAULT
179+
ARIZONA_GP_DEFAULT
180+
>;
181+
182+
wlf,inmode = <0 0 0>;
183+
wlf,micd-detect-debounce = <500>;
184+
wlf,micd-rate = <ARIZONA_MICD_TIME_8MS>;
185+
wlf,micd-configs = <0 ARIZONA_DMIC_MICBIAS2 1>;
186+
wlf,micd-bias-start-time = <ARIZONA_MICD_TIME_16MS>;
187+
188+
// TODO:
189+
// wlf,infinite_micd = <0x01>;
190+
// wlf,micbias1 = <0xaf0 0x01 0x00 0x01 0x00>;
191+
// wlf,micbias2 = <0xaf0 0x01 0x00 0x01 0x00>;
192+
// wlf,micbias3 = <0xaf0 0x01 0x00 0x01 0x00>;
193+
// wlf,ldo-enable = <0x77 28 0x00>;
194+
// wlf,ena-ldo = <0x77 114 0x00>;
195+
// wlf,clk-gpio = <0x77 116 0x00>;
196+
// wlf,ldospk = <0x77 0x00 0x00>; // gpio101? downstream spk_vreg
197+
// wlf,init-mic-delay = <0x1f4>;
198+
199+
ldo1 {
200+
regulator-boot-on;
201+
regulator-always-on;
202+
};
203+
204+
micvdd {
205+
regulator-min-microvolt = <3000000>;
206+
regulator-max-microvolt = <3000000>;
207+
};
208+
};
209+
};
210+
125211
&blsp_i2c2 {
126212
status = "okay";
127213

@@ -385,6 +471,18 @@
385471
status = "okay";
386472
};
387473

474+
&q6afedai {
475+
dai@18 {
476+
reg = <SECONDARY_MI2S_RX>;
477+
qcom,sd-lines = <0>;
478+
};
479+
480+
dai@22 {
481+
reg = <QUATERNARY_MI2S_RX>;
482+
qcom,sd-lines = <0>;
483+
};
484+
};
485+
388486
&sdhc_1 {
389487
status = "okay";
390488
};
@@ -400,7 +498,40 @@
400498
};
401499

402500
&sound {
403-
status = "disabled"; /* TODO */
501+
/* pinctrl-0 = <&ext_mclk_tlmm_lines_act &ext_sec_tlmm_lines_act>;*/
502+
/* pinctrl-1 = <&ext_mclk_tlmm_lines_sus &ext_sec_tlmm_lines_sus>;*/
503+
pinctrl-0 = <&pri_mi2s_mclk_default &sec_mi2s_default>;
504+
pinctrl-1 = <&pri_mi2s_mclk_sleep &sec_mi2s_sleep>;
505+
pinctrl-names = "default", "sleep";
506+
507+
model = "bq-piccolo";
508+
widgets =
509+
"Speaker", "Speaker",
510+
"Headphone", "Headphones";
511+
pin-switches = "Speaker";
512+
audio-routing =
513+
"Speaker IN1AL", "Speaker MICBIAS1",
514+
"Speaker IN1AR", "Speaker MICBIAS1",
515+
"Speaker IN2A", "Speaker MICBIAS2";
516+
517+
status = "okay";
518+
519+
/delete-node/ backend1-dai-link;
520+
};
521+
522+
&sound_link_backend0 {
523+
/* Primary MI2S is not used, replace with Quaternary MI2S */
524+
link-name = "Quaternary MI2S";
525+
526+
cpu {
527+
sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
528+
};
529+
platform {
530+
sound-dai = <&q6routing>;
531+
};
532+
codec {
533+
sound-dai = <&speaker_codec 0>;
534+
};
404535
};
405536

406537
&usb {
@@ -425,6 +556,18 @@
425556
status = "okay";
426557
};
427558

559+
&lpass {
560+
status = "okay";
561+
};
562+
563+
&pm8916_codec {
564+
qcom,micbias-lvl = <2800>;
565+
qcom,mbhc-vthreshold-low = <25 50 75 112 137>;
566+
qcom,mbhc-vthreshold-high = <25 50 75 112 137>;
567+
qcom,micbias1-ext-cap;
568+
//qcom,hphl-jack-type-normally-open;
569+
};
570+
428571
&tlmm {
429572
button_backlight_default: button-backlight-default-state {
430573
pins = "gpio17";
@@ -537,4 +680,77 @@
537680
drive-strength = <2>;
538681
output-high;
539682
};
683+
684+
speaker_codec_reset_default: speaker-codec-reset-default-state {
685+
pins = "gpio120";
686+
function = "ldo_update";
687+
688+
drive-strength = <6>;
689+
bias-pull-up;
690+
};
691+
692+
speaker_codec_reset_sleep: speaker-codec-reset-sleep-state {
693+
pins = "gpio120";
694+
function = "ldo_update";
695+
696+
drive-strength = <2>;
697+
bias-pull-down;
698+
};
699+
700+
speaker_codec_default: speaker-codec-default-state { // ldo_enable
701+
pins = "gpio28";
702+
function = "gpio";
703+
drive-strength = <6>;
704+
bias-pull-up;
705+
};
706+
707+
speaker_codec_sleep: speaker-codec-sleep-state { // ldo_enable
708+
pins = "gpio28";
709+
function = "gpio";
710+
drive-strength = <2>;
711+
bias-pull-down;
712+
};
713+
/*
714+
speaker_enaldo_default: speaker-ena-ldo-default-state { // ena_ldo
715+
pins = "gpio114";
716+
function = "gpio";
717+
drive-strength = <6>;
718+
bias-pull-up;
719+
};
720+
721+
speaker_enaldo_sleep: speaker-ena-ldo-sleep-state { // ena_ldo
722+
pins = "gpio114";
723+
function = "gpio";
724+
drive-strength = <2>;
725+
bias-pull-down;
726+
};*/
727+
728+
/* wlf_ldospk_pin {
729+
pins = "gpio101";
730+
label = "wlf_speaker_ldo";
731+
732+
wlf_ldospk_active {
733+
drive-strength = <6>;
734+
bias-pull-up;
735+
};
736+
737+
wlf_ldospk_suspend {
738+
drive-strength = <2>;
739+
bias-pull-down;
740+
};
741+
};*/
742+
743+
wlf_int_pin {
744+
/* wolfson codec */
745+
wlf_int_active: wlf-int-active {
746+
pins = "gpio69";
747+
drive-strength = <6>;
748+
bias-pull-up;
749+
};
750+
wlf_int_suspend: wlf-int-suspend {
751+
pins = "gpio69";
752+
drive-strength = <2>;
753+
bias-pull-down;
754+
};
755+
};
540756
};

0 commit comments

Comments
 (0)