]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
ucm2: MediaTek: mt8370-evk: Add dynamic configuration for
authorZoran Zhan <zoran.zhan@mediatek.com>
Fri, 2 Aug 2024 06:03:04 +0000 (14:03 +0800)
committerJaroslav Kysela <perex@perex.cz>
Thu, 7 Nov 2024 11:42:09 +0000 (12:42 +0100)
If mt8370-evk doesn't load the HDMI/DP dtbo, the 'unknown'
available status will be shown on the Ubuntu GNOME.
To solve this issue, add the dynamic configuration to detect
whether the system is loading HDMI/DP dtbo or not.
The HDMI/DP device would be configured only if the related
dtbo has been loaded by the system.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456
Signed-off-by: Zoran Zhan <zoran.zhan@mediatek.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/MediaTek/mt8370-evk/HiFi.conf

index 42a4582ea73ea6d92c0a4cb7bf631b6f774599a9..65f83048a08e565cfafc384506e2488606e737eb 100644 (file)
@@ -1,37 +1,53 @@
-SectionDevice."HDMI1" {
-       Comment "HDMI output"
-
-       Value {
-               PlaybackPriority 300
-               PlaybackPCM "hw:${CardId},5"
-               JackControl "HDMI Jack"
+If.HDMI {
+       Condition {
+               Type ControlExists
+               Control "iface=CARD,name='HDMI Jack'"
+       }
+       True {
+               SectionDevice."HDMI1" {
+                       Comment "HDMI output"
+
+                       EnableSequence [
+                               cset "name='HDMI_OUT_MUX' 1"
+                       ]
+
+                       DisableSequence [
+                               cset "name='HDMI_OUT_MUX' 0"
+                       ]
+
+                       Value {
+                               PlaybackPriority 300
+                               PlaybackPCM "hw:${CardId},5"
+                               JackControl "HDMI Jack"
+                       }
+               }
        }
-
-       EnableSequence [
-               cset "name='HDMI_OUT_MUX' 1"
-       ]
-
-       DisableSequence [
-               cset "name='HDMI_OUT_MUX' 0"
-       ]
 }
 
-SectionDevice."HDMI2" {
-       Comment "DP output"
-
-       Value {
-               PlaybackPriority 300
-               PlaybackPCM "hw:${CardId},5"
-               JackControl "DP Jack"
+If.DP {
+       Condition {
+               Type ControlExists
+               Control "iface=CARD,name='DP Jack'"
+       }
+       True {
+               SectionDevice."HDMI2" {
+                       Comment "DP output"
+
+                       EnableSequence [
+                               cset "name='DPTX_OUT_MUX' 1"
+                       ]
+
+                       DisableSequence [
+                               cset "name='DPTX_OUT_MUX' 0"
+                       ]
+
+                       Value {
+                               PlaybackPriority 300
+                               PlaybackPCM "hw:${CardId},5"
+                               JackControl "DP Jack"
+                       }
+               }
        }
-
-       EnableSequence [
-               cset "name='DPTX_OUT_MUX' 1"
-       ]
-
-       DisableSequence [
-               cset "name='DPTX_OUT_MUX' 0"
-       ]
 }
 
 SectionDevice."Speaker" {