Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fairphone 3 speaker support #137

Draft
wants to merge 4 commits into
base: 6.4.7/main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8953.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2868,9 +2868,11 @@
"quin-iomux";

audio-routing =
#if 0
"AMIC1", "MIC BIAS External1",
"AMIC2", "MIC BIAS External2",
"AMIC3", "MIC BIAS External1",
#endif
"MM_DL1", "MultiMedia1 Playback",
"MM_DL3", "MultiMedia3 Playback",
"MM_DL4", "MultiMedia4 Playback",
Expand Down Expand Up @@ -2913,6 +2915,7 @@
};
};

#if 0
primary-mi2s-dai-link {
link-name = "Primary MI2S";
cpu {
Expand Down Expand Up @@ -2942,6 +2945,7 @@
sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
};
};
#endif
};

lpass_codec: codec@c0f0000 {
Expand Down
77 changes: 77 additions & 0 deletions arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@
};
};

&i2c_6 {
status = "okay";

/* Speaker amp AW8898 @ 34 */
/* Speaker amp TAS2557 @ 4c */
// sudo gpioset gpiochip0 21=1

aw8898: audio-amplifier@34 {
compatible = "awinic,aw8898_smartpa";
reg = <0x34>;

reset-gpio = <&tlmm 21 GPIO_ACTIVE_HIGH>;
irq-gpio = <&tlmm 20 GPIO_ACTIVE_HIGH>;

#sound-dai-cells = <0>;
};
};

&lpass {
status = "okay";
};
Expand Down Expand Up @@ -288,6 +306,33 @@
* 135-138: fingerprint reader (SPI)
*/
gpio-reserved-ranges = <0 4>, <135 4>;

tlmm_pri_act: tlmm_quin_default {
pins = "gpio88", "gpio91", "gpio93";
function = "pri_mi2s";
drive-strength = <8>;
/* bias-disable; */
};

tlmm_pri_sus: tlmm_quin_sleep {
pins = "gpio88", "gpio91", "gpio93";
function = "pri_mi2s";
drive-strength = <2>;
bias-pull-down;
};

tlmm_pri_ws_act: tlmm_pri_ws_default {
pins = "gpio92";
function = "pri_mi2s_ws";
drive-strength = <8>;
};

tlmm_pri_ws_sus: tlmm_pri_ws_sleep {
pins = "gpio92";
function = "pri_mi2s_ws";
drive-strength = <2>;
bias-pull-down;
};
};

&uart_0 {
Expand All @@ -314,3 +359,35 @@
vddpa-supply = <&pm8953_l9>;
vdddig-supply = <&pm8953_l5>;
};

&sound_card {
model = "fairphone-fp3";

pinctrl-names = "default", "sleep";
pinctrl-0 = <&cdc_pdm_lines_act &cdc_pdm_lines_2_act &cdc_pdm_comp_lines_act &tlmm_pri_act &tlmm_pri_ws_act>;
pinctrl-1 = <&cdc_pdm_lines_sus &cdc_pdm_lines_2_sus &cdc_pdm_comp_lines_act &tlmm_pri_sus &tlmm_pri_ws_sus>;

status = "okay";

quinary-mi2s-dai-link {
link-name = "Quinary MI2S";
cpu {
sound-dai = <&q6afedai QUINARY_MI2S_RX>;
};

platform {
sound-dai = <&q6routing>;
};

codec {
sound-dai = <&aw8898>;
};
};
};

&q6afedai {
dai@127 {
reg = <QUINARY_MI2S_RX>;
qcom,sd-lines = <0 1>;
};
};
1 change: 1 addition & 0 deletions arch/arm64/configs/fp3.config
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_DRM_PANEL_FAIRPHONE_FP3_HX83112B=m
CONFIG_TOUCHSCREEN_HIMAX_HX83112B=m
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -750,3 +750,5 @@ obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO) += snd-soc-lpass-tx-macro.o

# Mux
obj-$(CONFIG_SND_SOC_SIMPLE_MUX) += snd-soc-simple-mux.o

obj-y += aw/aw8898.o
Loading