From 455a83c58f1164017e6d581f00c94384a007ec25 Mon Sep 17 00:00:00 2001 From: Shuming Fan Date: Wed, 14 Oct 2026 15:22:38 +0800 Subject: [PATCH] ucm2: soundwire: add rt766 device Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/885 Signed-off-by: Shuming Fan Signed-off-by: Jaroslav Kysela --- ucm2/codecs/rt766/init.conf | 16 ++++ ucm2/sof-soundwire/rt766.conf | 112 ++++++++++++++++++++++++++ ucm2/sof-soundwire/sof-soundwire.conf | 3 +- 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 ucm2/codecs/rt766/init.conf create mode 100644 ucm2/sof-soundwire/rt766.conf diff --git a/ucm2/codecs/rt766/init.conf b/ucm2/codecs/rt766/init.conf new file mode 100644 index 0000000..2154975 --- /dev/null +++ b/ucm2/codecs/rt766/init.conf @@ -0,0 +1,16 @@ +# RT766 specific volume control settings + +BootSequence [ + cset "name='rt766 FU41 Playback Volume' 127" + cset "name='rt766 FU21 Playback Volume' 87" + cset "name='rt766 FU36 Capture Volume' 57" + cset "name='rt766 FU36 Capture Switch' 1" + cset "name='rt766 FU113 Capture Switch' 1" + cset "name='rt766 FU113 Capture Volume' 63" +] + +Macro [ + { SetLED { LED="mic" Action="attach" CtlId="rt766 FU113 Capture Switch" } } + { SetLED { LED="speaker" Action="attach" CtlId="rt766 FU21 Playback Switch" } } +] + diff --git a/ucm2/sof-soundwire/rt766.conf b/ucm2/sof-soundwire/rt766.conf new file mode 100644 index 0000000..cd51651 --- /dev/null +++ b/ucm2/sof-soundwire/rt766.conf @@ -0,0 +1,112 @@ +# Use case Configuration for sof-soundwire card + +If.codecspk { + Condition { + Type RegexMatch + Regex "rt766" + String "${var:SpeakerCodec1}" + } + True { + SectionDevice."Speaker" { + Comment "Speaker" + + EnableSequence [ + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + ] + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},2" + PlaybackMixerElem "rt766 FU21" + PlaybackSwitch "rt766 FU21 Playback Switch" + } + } + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + EnableSequence [ + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId}" + JackControl "Headphone Jack" + } +} + +SectionDevice."Headset" { + Comment "Headset Microphone" + + EnableSequence [ + cset "name='rt766 FU36 Capture Switch' 1" + ] + + DisableSequence [ + cset "name='rt766 FU36 Capture Switch' 0" + ] + + If.hsmicsw { + Condition { + Type ControlExists + Control "name='Headset Mic Switch'" + } + True { + EnableSequence [ + cset "name='Headset Mic Switch' on" + ] + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + } + } + + Value { + CapturePriority 300 + CapturePCM "hw:${CardId},1" + CaptureSwitch "rt766 FU36 Capture Switch" + CaptureVolume "rt766 FU36 Capture Volume" + CaptureMixerElem "rt766 FU36" + JackControl "Headset Mic Jack" + } +} + +If.codecmic { + Condition { + Type RegexMatch + Regex "rt766" + String "${var:MicCodec1}" + } + True { + SectionDevice."Mic" { + Comment "SoundWire Microphones" + + EnableSequence [ + cset "name='rt766 FU113 Capture Switch' 1" + ] + + DisableSequence [ + cset "name='rt766 FU113 Capture Switch' 0" + ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},4" + CaptureSwitch "rt766 FU113 Capture Switch" + CaptureVolume "rt766 FU113 Capture Volume" + CaptureMixerElem "rt766 FU113" + } + } + } +} diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf index f12cd41..6b862a7 100644 --- a/ucm2/sof-soundwire/sof-soundwire.conf +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -19,7 +19,7 @@ Define { Mics1 "0" Iec61937Pcms1 "" MultiCodec1 "" - MultiCodecRegex "rt712|rt713|rt721|rt722|rt1320|es9356|tac5572" + MultiCodecRegex "rt712|rt713|rt721|rt722|rt766|rt1320|es9356|tac5572" } DefineRegex { @@ -136,6 +136,7 @@ If.multi_init { Macro.rt713.MultiCodecInit "CodecId=rt713" Macro.rt721.MultiCodecInit "CodecId=rt721" Macro.rt722.MultiCodecInit "CodecId=rt722" + Macro.rt766.MultiCodecInit "CodecId=rt766" Macro.rt1320.MultiCodecInit "CodecId=rt1320" Macro.es9356.MultiCodecInit "CodecId=es9356" Macro.tac5572.MultiCodecInit "CodecId=tac5572" -- 2.52.0