]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
sof-soundwire: rt1316 - DAC L and R is replaced by DAC
authorHui Wang <hui.wang@canonical.com>
Fri, 23 Jul 2021 03:13:02 +0000 (11:13 +0800)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 Aug 2021 14:24:32 +0000 (16:24 +0200)
In the latest codec driver rt1316-sdw.c, the DAC L and DAC R are
replaced by DAC, so we change the ucm to add the condition checking,
if 'DAC L' exists, will set those mixers in the old way, otherwise,
set the mixers with new name.

The codec rt1316 is used on a Dell TGL soundwire audio machine.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-soundwire/rt1316-1.conf
ucm2/sof-soundwire/rt1316-2.conf

index f442a798f2f6c3881e56853c970c0d8b5f389562..aa277dd20abf6ee6a04bcc18d871e62ec91cf151 100644 (file)
@@ -3,17 +3,36 @@
 SectionDevice."Speaker" {
        Comment "Speaker"
 
-       EnableSequence [
-               cset "name='rt1316-1 DAC L Switch' 1"
-               cset "name='rt1316-1 DAC R Switch' 1"
-               cset "name='Speaker Switch' on"
-       ]
+       If.lrswitch {
+               Condition {
+                       Type ControlExists
+                       Control "name='rt1316-1 DAC L Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='rt1316-1 DAC L Switch' 1"
+                               cset "name='rt1316-1 DAC R Switch' 1"
+                               cset "name='Speaker Switch' on"
+                       ]
 
-       DisableSequence [
-               cset "name='rt1316-1 DAC L Switch' 0"
-               cset "name='rt1316-1 DAC R Switch' 0"
-               cset "name='Speaker Switch' off"
-       ]
+                       DisableSequence [
+                               cset "name='rt1316-1 DAC L Switch' 0"
+                               cset "name='rt1316-1 DAC R Switch' 0"
+                               cset "name='Speaker Switch' off"
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               cset "name='rt1316-1 DAC Switch' 1"
+                               cset "name='Speaker Switch' on"
+                       ]
+
+                       DisableSequence [
+                               cset "name='rt1316-1 DAC Switch' 0"
+                               cset "name='Speaker Switch' off"
+                       ]
+               }
+       }
 
        Value {
              PlaybackPriority 100
index f2fd9ab14427719ca9773d0508319a4e8e2a92a2..94223e1ff1b793cc90d6aa2289cc41d24726d71f 100644 (file)
@@ -3,24 +3,46 @@
 SectionDevice."Speaker" {
        Comment "Speaker"
 
-       EnableSequence [
-               cset "name='rt1316-1 RX Channel Select' L,L"
-               cset "name='rt1316-2 RX Channel Select' R,R"
+       If.lrswitch {
+               Condition {
+                       Type ControlExists
+                       Control "name='rt1316-1 DAC L Switch'"
+               }
+               True {
+                       EnableSequence [
+                               cset "name='rt1316-1 RX Channel Select' L,L"
+                               cset "name='rt1316-2 RX Channel Select' R,R"
+                               cset "name='rt1316-1 DAC L Switch' 1"
+                               cset "name='rt1316-1 DAC R Switch' 1"
+                               cset "name='rt1316-2 DAC L Switch' 1"
+                               cset "name='rt1316-2 DAC R Switch' 1"
+                               cset "name='Speaker Switch' on"
+                       ]
 
-               cset "name='rt1316-1 DAC L Switch' 1"
-               cset "name='rt1316-1 DAC R Switch' 1"
-               cset "name='rt1316-2 DAC L Switch' 1"
-               cset "name='rt1316-2 DAC R Switch' 1"
-               cset "name='Speaker Switch' on"
-       ]
+                       DisableSequence [
+                               cset "name='rt1316-1 DAC L Switch' 0"
+                               cset "name='rt1316-1 DAC R Switch' 0"
+                               cset "name='rt1316-2 DAC L Switch' 0"
+                               cset "name='rt1316-2 DAC R Switch' 0"
+                               cset "name='Speaker Switch' off"
+                       ]
+               }
+               False {
+                       EnableSequence [
+                               cset "name='rt1316-1 RX Channel Select' L,L"
+                               cset "name='rt1316-2 RX Channel Select' R,R"
+                               cset "name='rt1316-1 DAC Switch' 1"
+                               cset "name='rt1316-2 DAC Switch' 1"
+                               cset "name='Speaker Switch' on"
+                       ]
 
-       DisableSequence [
-               cset "name='rt1316-1 DAC L Switch' 0"
-               cset "name='rt1316-1 DAC R Switch' 0"
-               cset "name='rt1316-2 DAC L Switch' 0"
-               cset "name='rt1316-2 DAC R Switch' 0"
-               cset "name='Speaker Switch' off"
-       ]
+                       DisableSequence [
+                               cset "name='rt1316-1 DAC Switch' 0"
+                               cset "name='rt1316-2 DAC Switch' 0"
+                               cset "name='Speaker Switch' off"
+                       ]
+               }
+       }
 
        Value {
              PlaybackPriority 100