From c2d5f60c32bb85f4e907032427cde509e8f7bc38 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 1 Jul 2026 16:15:24 +0200 Subject: [PATCH] HDA: introduce HDA and NoACP open arguments For debugging purposes, it is useful to force a UCM configuration for all HDA configurations. Note that these arguments are not supposed to be used as part of the stable UCM API; they are solely for debugging. Example: alsaucm -c "<<>>hw:0" dump text Signed-off-by: Jaroslav Kysela --- ucm2/HDA/HDA.conf | 38 +++++++++++++++++++++++++++----------- ucm2/HDA/HiFi.conf | 7 ++++--- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ucm2/HDA/HDA.conf b/ucm2/HDA/HDA.conf index 0069ef4..4b189d3 100644 --- a/ucm2/HDA/HDA.conf +++ b/ucm2/HDA/HDA.conf @@ -1,7 +1,7 @@ Syntax 8 -Define.Use "" # a non-empty string to use UCM configuration for HDA devices -Define.Done "" # a non-empty string to skip the end error +Define.Use "${var:@HDA}" # a non-empty string to use UCM configuration for HDA devices +Define.Done "" # a non-empty string to skip the end error Define.AcpCardId "$${find-card:field=name,return=id,regex='^acp(|6[23x]|-pdm-mach)$'}" Define.MicType "hda" @@ -24,9 +24,15 @@ If.acp { Type String Empty "${var:AcpCardId}" } - False { - Define.Use y - Define.MicType "acp" + False.If.noacp { + Condition { + Type String + Empty "${var:@NoACP}" + } + True { + Define.Use y + Define.MicType "acp" + } } } @@ -49,14 +55,24 @@ If.use { Control "name='Master Playback Switch'" } True { - Include.led.File "/common/ctl/led.conf" Include.init.File "/HDA/init.conf" - Macro [ - { CtlNew { Arg="name='Mic ACP LED Capture Switch' type=bool,count=1 off" } } - { SetLED { LED="mic" Action="attach" CtlId="Mic ACP LED Capture Switch" } } - { SetLED { LED="mic" Action="detach" CtlId="Capture Switch" } } - ] + If.acp { + Condition { + Type String + String1 "${var:MicType}" + String2 "acp" + } + True { + Include.led.File "/common/ctl/led.conf" + + Macro [ + { CtlNew { Arg="name='Mic ACP LED Capture Switch' type=bool,count=1 off" } } + { SetLED { LED="mic" Action="attach" CtlId="Mic ACP LED Capture Switch" } } + { SetLED { LED="mic" Action="detach" CtlId="Capture Switch" } } + ] + } + } } } } diff --git a/ucm2/HDA/HiFi.conf b/ucm2/HDA/HiFi.conf index 9e567f6..61937db 100644 --- a/ucm2/HDA/HiFi.conf +++ b/ucm2/HDA/HiFi.conf @@ -17,10 +17,11 @@ If.analog { If.acp { Condition { Type String - Empty "${var:AcpCardId}" + String1 "${var:MicType}" + String2 "acp" } - True.Include.analog.File "/HDA/HiFi-analog.conf" - False.Include { + False.Include.analog.File "/HDA/HiFi-analog.conf" + True.Include { acp.File "/HDA/HiFi-acp.conf" analog.File "/HDA/HiFi-analog.conf" } -- 2.52.0