]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: sof-soundwire: add RT1320 amplifier
authorShuming Fan <shumingf@realtek.com>
Tue, 4 Jun 2024 07:52:27 +0000 (15:52 +0800)
committerJaroslav Kysela <perex@perex.cz>
Tue, 15 Oct 2024 13:18:30 +0000 (15:18 +0200)
Add support for rt1320 amplifier

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

diff --git a/ucm2/sof-soundwire/rt1320.conf b/ucm2/sof-soundwire/rt1320.conf
new file mode 100644 (file)
index 0000000..fa48d9c
--- /dev/null
@@ -0,0 +1,47 @@
+# Use case Configuration for sof-soundwire card
+
+#
+# Arguments:
+#   ForAmps - regex filter for var:SpeakerAmps
+#   Amp - amplifier number (1,2 etc.)
+#   Sel - channel selection (L,R R,L L,L R,R L,L+R R,L+R L+R,L L+R,R L+R,L+R)
+#
+DefineMacro.rt1320spk.If.0 {
+       Condition {
+               Type RegexMatch
+               Regex "${var:__ForAmps}"
+               String "${var:SpeakerAmps}"
+       }
+       True {
+               EnableSequence [
+                       cset "name='rt1320-${var:__Amp} RX Channel Select' ${var:__Sel}"
+                       cset "name='rt1320-${var:__Amp} OT23 L Switch' 1"
+                       cset "name='rt1320-${var:__Amp} OT23 R Switch' 1"
+               ]
+               DisableSequence [
+                       cset "name='rt1320-${var:__Amp} OT23 L Switch' 0"
+                       cset "name='rt1320-${var:__Amp} OT23 R Switch' 0"
+               ]
+       }
+}
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+       
+       Macro.num1.rt1320spk { ForAmps "1" Amp 1 Sel "L,R" }
+       Macro.num2.rt1320spk { ForAmps "2" Amp 1 Sel "L,L" }
+       Macro.num3.rt1320spk { ForAmps "2" Amp 2 Sel "R,R" }
+
+       EnableSequence [
+               cset "name='Speaker Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Speaker Switch' off"
+       ]
+
+       Value {
+             PlaybackPriority 100
+             PlaybackPCM "hw:${CardId},2"
+       }
+}