Skip to content

Commit cd58d35

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

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

@@ -388,6 +474,18 @@
388474
status = "okay";
389475
};
390476

477+
&q6afedai {
478+
dai@18 {
479+
reg = <SECONDARY_MI2S_RX>;
480+
qcom,sd-lines = <0>;
481+
};
482+
483+
dai@22 {
484+
reg = <QUATERNARY_MI2S_RX>;
485+
qcom,sd-lines = <0>;
486+
};
487+
};
488+
391489
&sdhc_1 {
392490
status = "okay";
393491
};
@@ -403,7 +501,40 @@
403501
};
404502

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

409540
&usb {
@@ -428,6 +559,18 @@
428559
status = "okay";
429560
};
430561

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

0 commit comments

Comments
 (0)