From 274968c0fdfae4d03a5f401b505f0e5d4d661676 Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Wed, 17 Jan 2024 11:28:04 -0500 Subject: [PATCH] mt8183/mt8183_mt6358: Add headphone support Krane doesn't have a headphone jack so a check is needed to disable the headphones on Krane --- mt8183/mt8183_mt6358_t/HiFi.conf | 77 +++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/mt8183/mt8183_mt6358_t/HiFi.conf b/mt8183/mt8183_mt6358_t/HiFi.conf index fceec7d..396672d 100644 --- a/mt8183/mt8183_mt6358_t/HiFi.conf +++ b/mt8183/mt8183_mt6358_t/HiFi.conf @@ -1,12 +1,25 @@ SectionVerb { EnableSequence [ - cset "name='Headphone Volume' 0" + # Speakers cset "name='I2S3_CH1 DL1_CH1' 1" - cset "name='I2S3_CH2 DL1_CH2' 1" - cset "name='MTKAIF_DMIC' 1" - cset "name='Mic Type Mux' 2" - cset "name='UL3_CH1 ADDA_UL_CH1' 1" - cset "name='UL3_CH2 ADDA_UL_CH2' 1" + cset "name='I2S3_CH2 DL1_CH2' 1" + # Headphones + cset "name='Headphone Volume' 17" + cset "name='ADDA_DL_CH1 DL1_CH1' 0" + cset "name='ADDA_DL_CH2 DL1_CH2' 0" + cset "name='HPL Mux' 0" + cset "name='HPR Mux' 0" + # Internal Mic + cset "name='MTKAIF_DMIC' 1" + cset "name='Mic Type Mux' 2" + cset "name='UL3_CH1 ADDA_UL_CH1' 1" + cset "name='UL3_CH2 ADDA_UL_CH2' 1" + # Headset Mic + cset "name='PGA L Mux' 0" + cset "name='ADC L Mux' 0" + cset "name='Mic Type Mux' 0" + cset "name='PGA Volume' 0" + cset "name='UL3_CH1 ADDA_UL_CH1' 0" ] } @@ -44,3 +57,55 @@ SectionDevice."Mic" { cset "name='UL3_CH2 ADDA_UL_CH2' 0" ] } + +If.krane { + Condition { + Type String + Haystack "${sys:firmware/devicetree/base/compatible}" + Needle "google,krane" + } + False { + SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackPCM "hw:${CardId},0" + } + EnableSequence [ + cset "name='ADDA_DL_CH1 DL1_CH1' 1" + cset "name='ADDA_DL_CH2 DL1_CH2' 1" + cset "name='HPL Mux' 2" + cset "name='HPR Mux' 2" + ] + DisableSequence [ + cset "name='ADDA_DL_CH1 DL1_CH1' 0" + cset "name='ADDA_DL_CH2 DL1_CH2' 0" + cset "name='HPL Mux' 0" + cset "name='HPR Mux' 0" + ] + } + + SectionDevice."Headset" { + Comment "Headset Microphone" + + Value { + CapturePCM "hw:${CardId},5" + } + EnableSequence [ + cset "name='PGA L Mux' 2" + cset "name='ADC L Mux' 2" + cset "name='Mic Type Mux' 1" + cset "name='PGA Volume' 4" + cset "name='UL3_CH1 ADDA_UL_CH1' 1" + ] + DisableSequence [ + cset "name='PGA L Mux' 0" + cset "name='ADC L Mux' 0" + cset "name='Mic Type Mux' 0" + cset "name='PGA Volume' 0" + cset "name='UL3_CH1 ADDA_UL_CH1' 0" + + ] + } + } +}