From: David Heidelberg <[email protected]>

OnePlus 6 uses NXP TFA9894 audio codec. Enable it.

Signed-off-by: David Heidelberg <[email protected]>
---
 arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts 
b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
index 0542333a83579..cb08aab4740a4 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
@@ -35,17 +35,26 @@ &display_panel {
        compatible = "samsung,s6e3fc2x01-ams641rw", "samsung,s6e3fc2x01";
 };
 
 &framebuffer {
        height = <2340>;
 };
 
 &i2c4 {
-       /* nxp,tfa9894 @ 0x34 */
+       clock-frequency = <400000>;
+
+       status = "okay";
+
+       tfa9894_codec: audio-codec@34 {
+               compatible = "nxp,tfa9894";
+               reg = <0x34>;
+               reset-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>;
+               #sound-dai-cells = <0>;
+       };
 };
 
 &bq27441_fg {
        monitored-battery = <&battery>;
 };
 
 &sound {
        model = "OnePlus 6T";
@@ -56,22 +65,21 @@ &sound {
                        "AMIC4", "MIC BIAS1",
                        "AMIC5", "MIC BIAS3";
 };
 
 &pmi8998_charger {
        monitored-battery = <&battery>;
 };
 
-/*
- * The TFA9894 codec is currently unsupported.
- * We need to delete the node to allow the soundcard
- * to probe for headphones/earpiece.
- */
-/delete-node/ &speaker_playback_dai;
+&speaker_playback_dai {
+       codec {
+               sound-dai = <&tfa9894_codec>;
+       };
+};
 
 &rmi4_f12 {
        touchscreen-y-mm = <148>;
 };
 
 &wcd9340 {
        qcom,micbias1-microvolt = <2700000>;
        qcom,micbias2-microvolt = <2700000>;

-- 
2.53.0



Reply via email to