]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
HDMI - use new Macro syntax
authorJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2022 11:33:24 +0000 (13:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 27 May 2022 08:16:58 +0000 (10:16 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/HDA/HDA.conf
ucm2/HDA/Hdmi.conf
ucm2/Intel/sof-essx8336/Hdmi.conf
ucm2/Intel/sof-essx8336/sof-essx8336.conf
ucm2/Intel/sof-hda-dsp/Hdmi.conf
ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf
ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf
ucm2/Tegra/tegra-hda/tegra-hda.conf
ucm2/codecs/hda/hdmi.conf
ucm2/sof-soundwire/Hdmi.conf
ucm2/sof-soundwire/sof-soundwire.conf

index 411f2e70ead175133224b9dd27c6e422762f5060..64ffe83621361fc965f7013c83feaf9f3f25f020 100644 (file)
@@ -1,4 +1,4 @@
-Syntax 4
+Syntax 6
 
 Define.Use ""  # a non-empty string to use UCM configuration for HDA devices
 Define.Done "" # a non-empty string to skip the end error
index c533e4933540de21ba90ac27f9f0c5319dfdd21a..e24c3c56883de1cb2ee8809708ba2e522ce403cc 100644 (file)
@@ -1,79 +1,57 @@
-# Use case Configuration for sof-hda-dsp
+# HDA HDMI devices
+
+Include.hdmi.File "/codecs/hda/hdmi.conf"
 
 If.hdmi1 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 1
-                       HdmiPCM 3
-                       HdmiCtlIndex 0
-                       HdmiPrio 1100
-               }
-               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 1
+               Device 3
+               Priority 1100
        }
 }
 
 If.hdmi2 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 2
-                       HdmiPCM 7
-                       HdmiCtlIndex 1
-                       HdmiPrio 1200
-               }
-               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi2.HDMI {
+               Number 2
+               Device 7
+               Priority 1200
        }
 }
 
 If.hdmi3 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 3
-                       HdmiPCM 8
-                       HdmiCtlIndex 2
-                       HdmiPrio 1300
-               }
-               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi3.HDMI {
+               Number 3
+               Device 8
+               Priority 1300
        }
 }
 
 If.hdmi4 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 4
-                       HdmiPCM 9
-                       HdmiCtlIndex 3
-                       HdmiPrio 1400
-               }
-               Include.hdmi4.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi4.HDMI {
+               Number 4
+               Device 9
+               Priority 1400
        }
 }
 
 If.hdmi5 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 5
-                       HdmiPCM 10
-                       HdmiCtlIndex 4
-                       HdmiPrio 1500
-               }
-               Include.hdmi5.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi5.HDMI {
+               Number 5
+               Device 10
+               Priority 1500
        }
 }
 
 If.hdmi6 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 6
-                       HdmiPCM 11
-                       HdmiCtlIndex 5
-                       HdmiPrio 1600
-               }
-               Include.hdmi6.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi5.HDMI {
+               Number 6
+               Device 11
+               Priority 1600
        }
 }
index 8912b4f9a5579eed8d046f55a0d997c1f71c509a..d77b92d88290062914658094b89daa188042f9b5 100644 (file)
@@ -1,40 +1,30 @@
 # Use case Configuration for sof-es8336
 
+Include.hdmi.File "/codecs/hda/hdmi.conf"
+
 If.hdmi1 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 1
-                       HdmiPCM 5
-                       HdmiCtlIndex 0
-                       HdmiPrio 500
-               }
-               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 1
+               Device 5
+               Priority 500
        }
 }
 
 If.hdmi2 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 2
-                       HdmiPCM 6
-                       HdmiCtlIndex 1
-                       HdmiPrio 600
-               }
-               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi2.HDMI {
+               Number 2
+               Device 6
+               Priority 600
        }
 }
 
 If.hdmi3 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 3
-                       HdmiPCM 7
-                       HdmiCtlIndex 2
-                       HdmiPrio 700
-               }
-               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi3.HDMI {
+               Number 3
+               Device 7
+               Priority 700
        }
 }
index da92e314aa1f71c959c1c3c5cf80c0afb1e96664..f74e0077d864c486efeceb4b71d50e7607830e24 100644 (file)
@@ -1,4 +1,4 @@
-Syntax 4
+Syntax 6
 
 BootSequence [
        # Setup muxes / switches
index 172656797518e42924da452540139173a5bf3190..2bf450b30bd12cb0edd180d3059e413c13e5c8ef 100644 (file)
@@ -1,40 +1,30 @@
 # Use case Configuration for sof-hda-dsp
 
+Include.hdmi.File "/codecs/hda/hdmi.conf"
+
 If.hdmi1 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 1
-                       HdmiPCM 3
-                       HdmiCtlIndex 0
-                       HdmiPrio 500
-               }
-               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 1
+               Device 3
+               Priority 500
        }
 }
 
 If.hdmi2 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 2
-                       HdmiPCM 4
-                       HdmiCtlIndex 1
-                       HdmiPrio 600
-               }
-               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 2
+               Device 4
+               Priority 600
        }
 }
 
 If.hdmi3 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 3
-                       HdmiPCM 5
-                       HdmiCtlIndex 2
-                       HdmiPrio 700
-               }
-               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 3
+               Device 5
+               Priority 700
        }
 }
index eb243d13bcf0b8d7ee4a9da562c37a5ee72cd4d1..e6a8a156d00690206a1ce244934d68118120dc01 100644 (file)
@@ -1,4 +1,4 @@
-Syntax 4
+Syntax 6
 
 Define.DeviceMic "Mic"
 Define.DeviceDmic ""
index 859c34f1c0156eb1eafada8bdb5692268c08c2ec..3277f6db6c67b926969f189716912ae8f6751575 100644 (file)
@@ -1,12 +1,10 @@
+Include.hdmi.File "/codecs/hda/hdmi.conf"
+
 If.hdmi {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 1
-                       HdmiPCM 3
-                       HdmiCtlIndex 0
-                       HdmiPrio 1100
-               }
-               Include.hdmi.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi.HDMI {
+               Number 1
+               Device 3
+               Priority 1100
        }
 }
index 410d97384f0f2af8a5de5104ffebeef4e22f94e3..fc6a83a51a35e000acaa9ef3221da8b2c05e7b37 100644 (file)
@@ -1,6 +1,6 @@
 # UCM for Nvidia Tegra30 HDMI Audio
 
-Syntax 4
+Syntax 6
 
 SectionUseCase."HiFi" {
        File "/Tegra/tegra-hda/tegra-hda-HiFi.conf"
index c7b7ba42dd28edca51c619558f7c8bda2b070b28..5bd9f03394fa465894d0af1fe75694d7fa9b8b2f 100644 (file)
@@ -1,24 +1,34 @@
-If.hdmi {
+#
+# Macro HDMI
+#
+# Arguments:
+#
+#   Number        HDMI number
+#   Device        PCM device number
+#   Priority      UCM device priority
+#
+
+DefineMacro.HDMI.If.hdmi {
        Condition {
                Type ControlExists
-               Control "iface=CARD,name='HDMI/DP,pcm=${var:HdmiPCM} Jack'"
+               Control "iface=CARD,name='HDMI/DP,pcm=${var:__Device} Jack'"
        }
        True {
-               SectionDevice."HDMI${var:HdmiNum}" {
-                       Comment "HDMI / DisplayPort ${var:HdmiNum} Output"
+               SectionDevice."HDMI${var:__Number}" {
+                       Comment "HDMI / DisplayPort ${var:__Number} Output"
 
                        EnableSequence [
-                               cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} on"
+                               cset "name='IEC958 Playback Switch',index=${eval:($__Number-1)} on"
                        ]
 
                        DisableSequence [
-                               cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} off"
+                               cset "name='IEC958 Playback Switch',index=${eval:($__Number-1)} off"
                        ]
 
                        Value {
-                               PlaybackPriority "${var:HdmiPrio}"
-                               PlaybackPCM "hw:${CardId},${var:HdmiPCM}"
-                               JackControl "HDMI/DP,pcm=${var:HdmiPCM} Jack"
+                               PlaybackPriority "${var:__Priority}"
+                               PlaybackPCM "hw:${CardId},${var:__Device}"
+                               JackControl "HDMI/DP,pcm=${var:__Device} Jack"
                        }
                }
        }
index d5ee9c6b4c490ec62652c2ccb9b68382ad13f79a..0507d8d9717b86f1173f0a8e7bd304bd254c2e72 100644 (file)
@@ -1,40 +1,30 @@
 # Use case Configuration for sof-soundwire
 
+Include.hdmi.File "/codecs/hda/hdmi.conf"
+
 If.hdmi1 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 1
-                       HdmiPCM 5
-                       HdmiCtlIndex 0
-                       HdmiPrio 500
-               }
-               Include.hdmi1.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi1.HDMI {
+               Number 1
+               Device 5
+               Priority 500
        }
 }
 
 If.hdmi2 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 2
-                       HdmiPCM 6
-                       HdmiCtlIndex 1
-                       HdmiPrio 600
-               }
-               Include.hdmi2.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi2.HDMI {
+               Number 2
+               Device 6
+               Priority 600
        }
 }
 
 If.hdmi3 {
-       Condition { Type String Empty "" }
-       True {
-               Define {
-                       HdmiNum 3
-                       HdmiPCM 7
-                       HdmiCtlIndex 2
-                       HdmiPrio 700
-               }
-               Include.hdmi3.File "/codecs/hda/hdmi.conf"
+       Condition { Type AlwaysTrue }
+       True.Macro.hdmi2.HDMI {
+               Number 3
+               Device 7
+               Priority 700
        }
 }
index 2442854b9f3aaf6dfa1da242e2ea3198cca96f08..03df16cf3264b637070b6f41f5ff06205ec637b4 100644 (file)
@@ -1,4 +1,4 @@
-Syntax 4
+Syntax 6
 
 SectionUseCase."HiFi" {
        File "/sof-soundwire/HiFi.conf"