]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: sof-soundwire: Use the HdmiDevice macro for hdmi device creation
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tue, 30 Apr 2024 11:06:25 +0000 (14:06 +0300)
committerJaroslav Kysela <perex@perex.cz>
Fri, 2 Aug 2024 14:32:38 +0000 (16:32 +0200)
The duplicated code for the hdmi device creation can be removed by using
the HdmiDevice macro.

The macro needs Syntax 7 to work (variable as parameter support), update
the Syntax version of the file as well.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/413
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-soundwire/sof-soundwire.conf

index 2ede1cd2898a619251c77a80512b6d417f26a04c..864251560e50a7aca3c2df96570991af2bbef6e8 100644 (file)
@@ -1,4 +1,4 @@
-Syntax 6
+Syntax 7
 
 SectionUseCase."HiFi" {
        File "/sof-soundwire/HiFi.conf"
@@ -164,32 +164,9 @@ If.mics-array {
 
 Include.hdmi-pcm.File "/common/pcm/hdmi.conf"
 
-If.Hdmi5-iec61937 {
-       Condition {
-               Type RegexMatch
-               Regex "((^|,)[5](,|$))"
-               String "${var:Iec61937Pcms1}"
-       }
-       True.Macro.hdmi5.HdmiPCM { Device 5 Index 0 }
-}
-
-If.Hdmi6-iec61937 {
-       Condition {
-               Type RegexMatch
-               Regex "((^|,)[6](,|$))"
-               String "${var:Iec61937Pcms1}"
-       }
-       True.Macro.hdmi6.HdmiPCM { Device 6 Index 1 }
-}
-
-If.Hdmi7-iec61937 {
-       Condition {
-               Type RegexMatch
-               Regex "((^|,)[7](,|$))"
-               String "${var:Iec61937Pcms1}"
-       }
-       True.Macro.hdmi7.HdmiPCM { Device 7 Index 2 }
-}
+Macro.0.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 5 Idx 0 }
+Macro.1.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 6 Idx 1 }
+Macro.2.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 7 Idx 2 }
 
 If.HdmiIec61937 {
        Condition {