Skip to content

Commit 4186ea4

Browse files
author
André Apitzsch
committed
WIP: bq-piccolo: Add sound support
Signed-off-by: André Apitzsch <[email protected]>
1 parent b738c14 commit 4186ea4

File tree

1 file changed

+209
-1
lines changed

1 file changed

+209
-1
lines changed

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

Lines changed: 209 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,26 @@
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+
87+
regulator-wm8998-ldo {
88+
compatible = "regulator-fixed";
89+
regulator-name = "wm8998_ldo";
90+
91+
enable-active-high;
92+
regulator-boot-on;
93+
regulator-always-on;
94+
gpio = <&tlmm 114 GPIO_ACTIVE_HIGH>;
95+
};
96+
7697
reg_ts_vdd: regulator-vdd-ts {
7798
compatible = "regulator-fixed";
7899
regulator-name = "regulator-vdd-ts";
@@ -122,6 +143,76 @@
122143

123144
};
124145

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

@@ -400,7 +491,40 @@
400491
};
401492

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

406530
&usb {
@@ -425,6 +549,17 @@
425549
status = "okay";
426550
};
427551

552+
&lpass {
553+
status = "okay";
554+
};
555+
556+
&pm8916_codec {
557+
qcom,micbias-lvl = <2800>;
558+
qcom,mbhc-vthreshold-low = <25 50 75 112 137>;
559+
qcom,mbhc-vthreshold-high = <25 50 75 112 137>;
560+
//qcom,hphl-jack-type-normally-open;
561+
};
562+
428563
&tlmm {
429564
button_backlight_default: button-backlight-default-state {
430565
pins = "gpio17";
@@ -537,4 +672,77 @@
537672
drive-strength = <2>;
538673
output-high;
539674
};
675+
676+
speaker_codec_reset_default: speaker-codec-reset-default-state {
677+
pins = "gpio120";
678+
function = "ldo_update";
679+
680+
drive-strength = <6>;
681+
bias-pull-up;
682+
};
683+
684+
speaker_codec_reset_sleep: speaker-codec-reset-sleep-state {
685+
pins = "gpio120";
686+
function = "ldo_update";
687+
688+
drive-strength = <2>;
689+
bias-pull-down;
690+
};
691+
692+
speaker_codec_default: speaker-codec-default-state { // ldo_enable
693+
pins = "gpio28";
694+
function = "gpio";
695+
drive-strength = <6>;
696+
bias-pull-up;
697+
};
698+
699+
speaker_codec_sleep: speaker-codec-sleep-state { // ldo_enable
700+
pins = "gpio28";
701+
function = "gpio";
702+
drive-strength = <2>;
703+
bias-pull-down;
704+
};
705+
/*
706+
speaker_enaldo_default: speaker-ena-ldo-default-state { // ena_ldo
707+
pins = "gpio114";
708+
function = "gpio";
709+
drive-strength = <6>;
710+
bias-pull-up;
711+
};
712+
713+
speaker_enaldo_sleep: speaker-ena-ldo-sleep-state { // ena_ldo
714+
pins = "gpio114";
715+
function = "gpio";
716+
drive-strength = <2>;
717+
bias-pull-down;
718+
};*/
719+
720+
/* wlf_ldospk_pin {
721+
pins = "gpio101";
722+
label = "wlf_speaker_ldo";
723+
724+
wlf_ldospk_active {
725+
drive-strength = <6>;
726+
bias-pull-up;
727+
};
728+
729+
wlf_ldospk_suspend {
730+
drive-strength = <2>;
731+
bias-pull-down;
732+
};
733+
};*/
734+
735+
wlf_int_pin {
736+
/* wolfson codec */
737+
wlf_int_active: wlf-int-active {
738+
pins = "gpio69";
739+
drive-strength = <6>;
740+
bias-pull-up;
741+
};
742+
wlf_int_suspend: wlf-int-suspend {
743+
pins = "gpio69";
744+
drive-strength = <2>;
745+
bias-pull-down;
746+
};
747+
};
540748
};

0 commit comments

Comments
 (0)