]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: sof-soundwire: add rt712 VA device
authorShuming Fan <shumingf@realtek.com>
Thu, 1 Aug 2024 07:35:24 +0000 (15:35 +0800)
committerJaroslav Kysela <perex@perex.cz>
Tue, 15 Oct 2024 13:15:19 +0000 (15:15 +0200)
Add support headphone/headset mic/speaker/dmic for rt712 VA

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/435
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/rt712-dmic/init.conf [new file with mode: 0644]
ucm2/codecs/rt712/init.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt712-dmic.conf [new file with mode: 0644]
ucm2/sof-soundwire/rt712.conf [new file with mode: 0644]
ucm2/sof-soundwire/sof-soundwire.conf

diff --git a/ucm2/codecs/rt712-dmic/init.conf b/ucm2/codecs/rt712-dmic/init.conf
new file mode 100644 (file)
index 0000000..26a83b5
--- /dev/null
@@ -0,0 +1,6 @@
+# RT712-dmic specific volume control settings
+
+BootSequence [
+       cset "name='rt712-dmic ADC 25 Mux' 'DMIC1'"
+       cset "name='rt712-dmic FU1E Capture Switch' 1"
+]
diff --git a/ucm2/codecs/rt712/init.conf b/ucm2/codecs/rt712/init.conf
new file mode 100644 (file)
index 0000000..e09bf7f
--- /dev/null
@@ -0,0 +1,8 @@
+# RT712 specific volume control settings
+
+BootSequence [
+       cset "name='rt712 FU05 Playback Volume' 87"
+       cset "name='rt712 ADC 23 Mux' 'MIC2'"
+       cset "name='rt712 FU0F Capture Volume' 57"
+       cset "name='rt712 FU0F Capture Switch' 1"
+]
diff --git a/ucm2/sof-soundwire/rt712-dmic.conf b/ucm2/sof-soundwire/rt712-dmic.conf
new file mode 100644 (file)
index 0000000..c6abfab
--- /dev/null
@@ -0,0 +1,21 @@
+# Use case Configuration for sof-soundwire card
+
+SectionDevice."Mic" {
+       Comment "SoundWire microphones"
+
+       EnableSequence [
+               cset "name='rt712-dmic FU1E Capture Switch' 1"
+       ]
+
+       DisableSequence [
+               cset "name='rt712-dmic FU1E Capture Switch' 0"
+       ]
+
+       Value {
+               CapturePriority 100
+               CapturePCM "hw:${CardId},4"
+               CaptureSwitch "rt712-dmic FU1E Capture Switch"
+               CaptureVolume "rt712-dmic FU1E Capture Volume"
+               CaptureMixerElem "rt712-dmic FU1E"
+       }
+}
diff --git a/ucm2/sof-soundwire/rt712.conf b/ucm2/sof-soundwire/rt712.conf
new file mode 100644 (file)
index 0000000..409bef9
--- /dev/null
@@ -0,0 +1,87 @@
+# Use case Configuration for sof-soundwire card
+
+If.codecspk {
+       Condition {
+               Type RegexMatch
+               Regex "(rt712(-sdca)?)"
+               String "${var:MultiSpeakerShadow}"
+       }
+       True {
+               SectionDevice."Speaker" {
+                       Comment "Speaker"
+
+                       If.lrswitch {
+                               Condition {
+                                       Type ControlExists
+                                       Control "name='rt712 OT23 L Switch'"
+                               }
+                               True {
+                                       EnableSequence [
+                                               cset "name='rt712 OT23 L Switch' on"
+                                               cset "name='rt712 OT23 R Switch' on"
+                                               cset "name='Speaker Switch' on"
+                                       ]
+                                       DisableSequence [
+                                               cset "name='rt712 OT23 L Switch' off"
+                                               cset "name='rt712 OT23 R Switch' off"
+                                               cset "name='Speaker Switch' off"
+                                       ]
+                               }
+                               False {
+                                       EnableSequence [
+                                               cset "name='rt712 FU06 Switch' on"
+                                               cset "name='Speaker Switch' on"
+                                       ]
+                                       DisableSequence [
+                                               cset "name='rt712 FU06 Switch' off"
+                                               cset "name='Speaker Switch' off"
+                                       ]
+                               }
+                       }
+
+                       Value {
+                               PlaybackPriority 100
+                               PlaybackPCM "hw:${CardId},2"
+                       }
+               }
+       }
+}
+
+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 Mono Microphone"
+
+       EnableSequence [
+               cset "name='rt712 FU0F Capture Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='rt712 FU0F Capture Switch' off"
+       ]
+
+       Value {
+               CapturePriority 300
+               CapturePCM "hw:${CardId},1"
+               CaptureSwitch "rt712 FU0F Capture Switch"
+               CaptureVolume "rt712 FU0F Capture Volume"
+               CaptureMixerElem "rt712 FU0F"
+               JackControl "Headset Mic Jack"
+       }
+}
index 864251560e50a7aca3c2df96570991af2bbef6e8..34f966196d59571bc114ce4b05551779bf76cda4 100644 (file)
@@ -49,7 +49,7 @@ DefineRegex {
                String "${CardComponents}"
        }
        MultiCodec {
-               Regex "(rt722(-sdca)?)"
+               Regex "(rt712|rt722(-sdca)?)"
                String "${var:SpeakerCodec1} ${var:HeadsetCodec1} ${var:MicCodec1}"
        }
 }
@@ -114,7 +114,7 @@ If.hs_init {
 If.mic_init {
        Condition {
                Type RegexMatch
-               Regex "(rt713-dmic|rt715(-sdca)?)"
+               Regex "(rt712-dmic|rt713-dmic|rt715(-sdca)?)"
                String "${var:MicCodec1}"
        }
        True.Include.mic_init.File "/codecs/${var:MicCodec1}/init.conf"