From 1b5de60bee2ab8bbc48f7a7adb1c646726c26650 Mon Sep 17 00:00:00 2001 From: Zoran Zhan Date: Fri, 2 Aug 2024 14:12:18 +0800 Subject: [PATCH] ucm2: MediaTek: mt8395-evk: Add dynamic configuration for If mt8395-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 Signed-off-by: Jaroslav Kysela --- ucm2/MediaTek/mt8395-evk/HiFi.conf | 76 ++++++++++++++++++------------ 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/ucm2/MediaTek/mt8395-evk/HiFi.conf b/ucm2/MediaTek/mt8395-evk/HiFi.conf index 5c25cfb..b9a8a42 100644 --- a/ucm2/MediaTek/mt8395-evk/HiFi.conf +++ b/ucm2/MediaTek/mt8395-evk/HiFi.conf @@ -1,37 +1,53 @@ -SectionDevice."HDMI1" { - Comment "HDMI output" - - Value { - PlaybackPriority 200 - 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 200 + 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 200 - 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 200 + PlaybackPCM "hw:${CardId},5" + JackControl "DP Jack" + } + } } - - EnableSequence [ - cset "name='DPTX_OUT_MUX' 1" - ] - - DisableSequence [ - cset "name='DPTX_OUT_MUX' 0" - ] } SectionDevice."HDMI3" { -- 2.47.1