Skip to content

Commit 9af0ec7

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

File tree

3 files changed

+237
-7
lines changed

3 files changed

+237
-7
lines changed

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

Lines changed: 230 additions & 0 deletions
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-mpp.h>
1314

1415
/ {
@@ -77,6 +78,26 @@
7778
};
7879
};
7980

81+
/* regulator-spk {
82+
compatible = "regulator-fixed";
83+
regulator-name = "spk_vreg";
84+
startup-delay-us = <0>;
85+
enable-active-high;
86+
regulator-boot-on;
87+
regulator-always-on;
88+
gpio = <&msmgpio 101 GPIO_ACTIVE_HIGH>;
89+
};*/
90+
91+
regulator-wm8998-ldo {
92+
compatible = "regulator-fixed";
93+
regulator-name = "wm8998_ldo";
94+
95+
enable-active-high;
96+
regulator-boot-on;
97+
regulator-always-on;
98+
gpio = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
99+
};
100+
80101
reg_ts_vdd: regulator-vdd-ts {
81102
compatible = "regulator-fixed";
82103
regulator-name = "regulator-vdd-ts";
@@ -126,6 +147,95 @@
126147

127148
};
128149

150+
&blsp_i2c1 {
151+
status = "okay";
152+
153+
speaker_codec: audio-codec@1a {
154+
compatible = "wlf,wm8998";
155+
reg = <0x1a>;
156+
157+
reset-gpios = <&msmgpio 120 GPIO_ACTIVE_HIGH>;
158+
wlf,ldoena = <&msmgpio 28 GPIO_ACTIVE_HIGH>;
159+
160+
pinctrl-names = "default", "sleep";
161+
pinctrl-0 = <&wlf_int_active &speaker_codec_default &speaker_codec_reset_default>;
162+
pinctrl-1 = <&wlf_int_suspend &speaker_codec_sleep &speaker_codec_reset_sleep>;
163+
164+
// TODO add pinctl for 114?
165+
// TODO add pinctl for 101?
166+
167+
gpio-controller;
168+
#gpio-cells = <2>;
169+
170+
sound-name-prefix = "Speaker";
171+
#sound-dai-cells = <1>;
172+
173+
AVDD-supply = <&pm8916_l6>;
174+
DBVDD1-supply = <&pm8916_l6>;
175+
DBVDD2-supply = <&pm8916_l6>;
176+
DBVDD3-supply = <&pm8916_l6>;
177+
CPVDD-supply = <&pm8916_l6>;
178+
SPKVDDL-supply = <&pm8916_l6>;
179+
SPKVDDR-supply = <&pm8916_l6>;
180+
181+
interrupt-controller;
182+
#interrupt-cells = <2>;
183+
interrupt-parent = <&msmgpio>;
184+
interrupts = <69 IRQ_TYPE_LEVEL_LOW>;
185+
186+
clocks = <&rpmcc RPM_SMD_BB_CLK2>;
187+
clock-names = "mclk2";
188+
189+
wlf,gpio-defaults = <
190+
ARIZONA_GP_DEFAULT
191+
ARIZONA_GP_DEFAULT
192+
ARIZONA_GP_DEFAULT
193+
ARIZONA_GP_DEFAULT
194+
ARIZONA_GP_DEFAULT
195+
>;
196+
197+
wlf,inmode = <0 0 0>;
198+
wlf,micd-detect-debounce = <500>;
199+
wlf,micd-rate = <ARIZONA_MICD_TIME_8MS>;
200+
wlf,micd-configs = <0 ARIZONA_DMIC_MICBIAS2 1>;
201+
wlf,micd-bias-start-time = <ARIZONA_MICD_TIME_16MS>;
202+
203+
// TODO:
204+
// wlf,infinite_micd = <0x01>;
205+
// wlf,micbias1 = <0xaf0 0x01 0x00 0x01 0x00>;
206+
// wlf,micbias2 = <0xaf0 0x01 0x00 0x01 0x00>;
207+
// wlf,micbias3 = <0xaf0 0x01 0x00 0x01 0x00>;
208+
// wlf,ldo-enable = <0x77 28 0x00>;
209+
// wlf,ena-ldo = <0x77 114 0x00>;
210+
// wlf,clk-gpio = <0x77 116 0x00>;
211+
// wlf,ldospk = <0x77 0x00 0x00>; // gpio101? downstream spk_vreg
212+
// wlf,init-mic-delay = <0x1f4>;
213+
214+
/* ldo1 {
215+
compatible = "regulator-gpio";
216+
217+
regulator-name = "wm8998-supply-ldo";
218+
regulator-min-microvolt = <1200000>;
219+
regulator-max-microvolt = <1800000>;
220+
regulator-boot-on;
221+
regulator-always-on;
222+
223+
gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
224+
states = <1200000 1>,
225+
<1800000 0>;
226+
227+
enable-active-high;
228+
229+
// pinctrl needed?
230+
};*/
231+
232+
micvdd {
233+
regulator-min-microvolt = <3000000>;
234+
regulator-max-microvolt = <3000000>;
235+
};
236+
};
237+
};
238+
129239
&blsp_i2c3 {
130240
status = "okay";
131241

@@ -313,6 +423,40 @@
313423
status = "okay";
314424
};
315425

426+
&sound {
427+
pinctrl-names = "default", "sleep";
428+
pinctrl-0 = <&ext_mclk_tlmm_lines_act &ext_sec_tlmm_lines_act>;
429+
pinctrl-1 = <&ext_mclk_tlmm_lines_sus &ext_sec_tlmm_lines_sus>;
430+
431+
model = "bq-piccolo";
432+
widgets =
433+
"Speaker", "Speaker",
434+
"Headphone", "Headphones";
435+
pin-switches = "Speaker";
436+
/*audio-routing =
437+
"IN1AL", "MICBIAS1",
438+
"IN1AR", "MICBIAS1",
439+
"IN2A", "MICBIAS2";*/
440+
441+
status = "okay";
442+
};
443+
444+
&sound_dai_primary {
445+
status = "disabled";
446+
};
447+
448+
&sound_dai_tertiary {
449+
status = "disabled";
450+
};
451+
452+
&sound_dai_quaternary {
453+
status = "okay";
454+
455+
codec {
456+
sound-dai = <&speaker_codec 0>;
457+
};
458+
};
459+
316460
&usb {
317461
extcon = <&charger>, <&usb_id>;
318462
vbus-supply = <&usb_otg_vbus>;
@@ -331,6 +475,19 @@
331475
compatible = "qcom,wcn3620";
332476
};
333477

478+
&lpass_codec {
479+
status = "disabled";
480+
};
481+
482+
&wcd_codec {
483+
status = "disabled";
484+
/* qcom,micbias-lvl = <2800>;
485+
qcom,mbhc-vthreshold-low = <25 50 75 112 137>;
486+
qcom,mbhc-vthreshold-high = <25 50 75 112 137>;
487+
//qcom,hphl-jack-type-normally-open;
488+
*/
489+
};
490+
334491
&smd_rpm_regulators {
335492
vdd_l1_l2_l3-supply = <&pm8916_s3>;
336493
vdd_l4_l5_l6-supply = <&pm8916_s4>;
@@ -530,6 +687,79 @@
530687
drive-strength = <2>;
531688
output-high;
532689
};
690+
691+
speaker_codec_reset_default: speaker-codec-reset-default-state {
692+
pins = "gpio120";
693+
function = "ldo_update";
694+
695+
drive-strength = <6>;
696+
bias-pull-up;
697+
};
698+
699+
speaker_codec_reset_sleep: speaker-codec-reset-sleep-state {
700+
pins = "gpio120";
701+
function = "ldo_update";
702+
703+
drive-strength = <2>;
704+
bias-pull-down;
705+
};
706+
707+
speaker_codec_default: speaker-codec-default-state { // ldo_enable
708+
pins = "gpio28";
709+
function = "gpio";
710+
drive-strength = <6>;
711+
bias-pull-up;
712+
};
713+
714+
speaker_codec_sleep: speaker-codec-sleep-state { // ldo_enable
715+
pins = "gpio28";
716+
function = "gpio";
717+
drive-strength = <2>;
718+
bias-pull-down;
719+
};
720+
/*
721+
speaker_enaldo_default: speaker-ena-ldo-default-state { // ena_ldo
722+
pins = "gpio114";
723+
function = "gpio";
724+
drive-strength = <6>;
725+
bias-pull-up;
726+
};
727+
728+
speaker_enaldo_sleep: speaker-ena-ldo-sleep-state { // ena_ldo
729+
pins = "gpio114";
730+
function = "gpio";
731+
drive-strength = <2>;
732+
bias-pull-down;
733+
};*/
734+
735+
/* wlf_ldospk_pin {
736+
pins = "gpio101";
737+
label = "wlf_speaker_ldo";
738+
739+
wlf_ldospk_active {
740+
drive-strength = <6>;
741+
bias-pull-up;
742+
};
743+
744+
wlf_ldospk_suspend {
745+
drive-strength = <2>;
746+
bias-pull-down;
747+
};
748+
};*/
749+
750+
wlf_int_pin {
751+
/* wolfson codec */
752+
wlf_int_active: wlf-int-active {
753+
pins = "gpio69";
754+
drive-strength = <6>;
755+
bias-pull-up;
756+
};
757+
wlf_int_suspend: wlf-int-suspend {
758+
pins = "gpio69";
759+
drive-strength = <2>;
760+
bias-pull-down;
761+
};
762+
};
533763
};
534764

535765
&pm8916_mpps {

sound/soc/codecs/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,7 @@ config SND_SOC_WM8997
20532053
depends on MFD_WM8997 && MFD_ARIZONA
20542054

20552055
config SND_SOC_WM8998
2056-
tristate
2056+
tristate "Wolfson Microelectronics WM8998 codec driver"
20572057
depends on MFD_WM8998 && MFD_ARIZONA
20582058

20592059
config SND_SOC_WM9081

sound/soc/qcom/apq8016_sbc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ static int apq8016_dai_init(struct snd_soc_pcm_runtime *rtd, int mi2s)
119119

120120
component = codec_dai->component;
121121
/* Set default mclk for internal codec */
122-
rval = snd_soc_component_set_sysclk(component, 0, 0, DEFAULT_MCLK_RATE,
123-
SND_SOC_CLOCK_IN);
124-
if (rval != 0 && rval != -ENOTSUPP) {
125-
dev_warn(card->dev, "Failed to set mclk: %d\n", rval);
126-
return rval;
127-
}
122+
/* rval = snd_soc_component_set_sysclk(component, 0, 0, DEFAULT_MCLK_RATE,*/
123+
/* SND_SOC_CLOCK_IN);*/
124+
/* if (rval != 0 && rval != -ENOTSUPP) {*/
125+
/* dev_warn(card->dev, "Failed to set mclk: %d\n", rval);*/
126+
/* return rval;*/
127+
/* }*/
128128
rval = snd_soc_component_set_jack(component, &pdata->jack, NULL);
129129
if (rval != 0 && rval != -ENOTSUPP) {
130130
dev_warn(card->dev, "Failed to set jack: %d\n", rval);

0 commit comments

Comments
 (0)