From c3314b9ca29861d19164d2b3987745b7170dab06 Mon Sep 17 00:00:00 2001 From: WeirdTreeThing Date: Sat, 25 Jan 2025 15:21:21 -0500 Subject: [PATCH] ucm2: add mt8183_mt6358_ts3a227_max98357 Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/502 Signed-off-by: WeirdTreeThing Signed-off-by: Jaroslav Kysela --- .../mt8183_mt6358_ts3a227_max98357/HiFi.conf | 84 +++++++++++++++++++ .../mt8183_mt6358_ts3a227_max98357.conf | 31 +++++++ .../mt8183_mt6358_t/mt8183_mt6358_t.conf | 1 + 3 files changed, 116 insertions(+) create mode 100644 ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/HiFi.conf create mode 100644 ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/mt8183_mt6358_ts3a227_max98357.conf create mode 120000 ucm2/conf.d/mt8183_mt6358_t/mt8183_mt6358_t.conf diff --git a/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/HiFi.conf b/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/HiFi.conf new file mode 100644 index 0000000..a49febe --- /dev/null +++ b/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/HiFi.conf @@ -0,0 +1,84 @@ +SectionDevice."Speaker" { + Comment "Speaker" + Value { + PlaybackPCM "hw:${CardId},0" + } + EnableSequence [ + cset "name='I2S3_CH1 DL1_CH1' 1" + cset "name='I2S3_CH2 DL1_CH2' 1" + ] + DisableSequence [ + cset "name='I2S3_CH1 DL1_CH1' 0" + cset "name='I2S3_CH2 DL1_CH2' 0" + ] +} + +SectionDevice."Mic" { + Comment "Internal Microphone" + Value { + CapturePCM "hw:${CardId},5" + } + EnableSequence [ + 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" + ] + DisableSequence [ + cset "name='MTKAIF_DMIC' 0" + cset "name='UL3_CH1 ADDA_UL_CH1' 0" + cset "name='UL3_CH2 ADDA_UL_CH2' 0" + ] +} + +# The krane device doesn't have a headphone jack + +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" + + ] + } + } +} diff --git a/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/mt8183_mt6358_ts3a227_max98357.conf b/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/mt8183_mt6358_ts3a227_max98357.conf new file mode 100644 index 0000000..f627715 --- /dev/null +++ b/ucm2/MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/mt8183_mt6358_ts3a227_max98357.conf @@ -0,0 +1,31 @@ +Syntax 6 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} + +BootSequence [ + # Speakers + cset "name='I2S3_CH1 DL1_CH1' 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='PGA Volume' 0" + cset "name='UL3_CH1 ADDA_UL_CH1' 0" +] diff --git a/ucm2/conf.d/mt8183_mt6358_t/mt8183_mt6358_t.conf b/ucm2/conf.d/mt8183_mt6358_t/mt8183_mt6358_t.conf new file mode 120000 index 0000000..415c81f --- /dev/null +++ b/ucm2/conf.d/mt8183_mt6358_t/mt8183_mt6358_t.conf @@ -0,0 +1 @@ +../../MediaTek/mt8183/mt8183_mt6358_ts3a227_max98357/mt8183_mt6358_ts3a227_max98357.conf \ No newline at end of file -- 2.47.1