ucm2: use new SetLED macro to hide the implementation details
Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/517 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
31fadae40c
commit
0915b27aac
10 changed files with 34 additions and 49 deletions
|
|
@ -1,5 +1,7 @@
|
|||
Syntax 6
|
||||
|
||||
Include.led.File "/common/ctl/led.conf"
|
||||
|
||||
Define.Use "" # a non-empty string to use UCM configuration for HDA devices
|
||||
Define.Done "" # a non-empty string to skip the end error
|
||||
|
||||
|
|
@ -51,11 +53,10 @@ If.use {
|
|||
True {
|
||||
Include.init.File "/HDA/init.conf"
|
||||
|
||||
FixedBootSequence [
|
||||
cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off"
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch"
|
||||
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" } }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
Syntax 4
|
||||
Syntax 6
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "/Intel/bytcr-rt5640/HiFi.conf"
|
||||
Comment "Play HiFi quality Music"
|
||||
}
|
||||
|
||||
Include.led.File "/common/ctl/led.conf"
|
||||
Include.card-init.File "/lib/card-init.conf"
|
||||
Include.ctl-remap.File "/lib/ctl-remap.conf"
|
||||
Include.codec-init.File "/codecs/rt5640/init.conf"
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:Speaker Channel Switch"
|
||||
sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:HP Channel Switch"
|
||||
Macro [
|
||||
{ SetLED { LED="speaker" Action="attach" CtlId="Speaker Channel Switch" } }
|
||||
{ SetLED { LED="speaker" Action="attach" CtlId="HP Channel Switch" } }
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# Adapted from https://github.com/plbossart/UCM/tree/master/cht-bsw-rt5672
|
||||
|
||||
Syntax 3
|
||||
Syntax 6
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "/Intel/cht-bsw-rt5672/HiFi.conf"
|
||||
Comment "Play HiFi quality Music"
|
||||
}
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:DAC1 Playback Switch"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:ADC Capture Switch"
|
||||
Include.led.File "/common/ctl/led.conf"
|
||||
|
||||
Macro [
|
||||
{ SetLED { LED="speaker" Action="attach" CtlId="DAC1 Playback Switch" } }
|
||||
{ SetLED { LED="mic" Action="attach" CtlId="ADC Capture Switch" } }
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
Syntax 7
|
||||
|
||||
Include.led.File "/common/ctl/led.conf"
|
||||
Include.card-init.File "/lib/card-init.conf"
|
||||
Include.dsp-variables.File "dsp.conf"
|
||||
|
||||
|
|
@ -25,13 +26,13 @@ If.devdmic {
|
|||
True {
|
||||
Define.DeviceDmic "Mic1"
|
||||
Define.DeviceMic "Mic2"
|
||||
#
|
||||
# users expect to turn the LED on when only internal
|
||||
# mic is off, but it makes sense to turn this LED
|
||||
# when all internal inputs are off
|
||||
#
|
||||
Macro [{ SetLED { LED="mic" Action="detach" CtlId="Capture Switch" } }]
|
||||
FixedBootSequence [
|
||||
#
|
||||
# users expect to turn the LED on when only internal
|
||||
# mic is off, but it makes sense to turn this LED
|
||||
# when all internal inputs are off
|
||||
#
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch"
|
||||
# dmic array info
|
||||
exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json"
|
||||
]
|
||||
|
|
@ -82,11 +83,7 @@ If.DellMuteLed {
|
|||
Haystack "$${sys:class/leds/platform::mute/device}"
|
||||
Needle "dell-laptop"
|
||||
}
|
||||
True {
|
||||
FixedBootSequence [
|
||||
sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:Master Playback Switch"
|
||||
]
|
||||
}
|
||||
True.Macro [{ SetLED { LED="speaker" Action="detach" CtlId="Master Playback Switch" } }]
|
||||
}
|
||||
|
||||
If.headphone {
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ BootSequence [
|
|||
cset "name='cs42l43 Decimator 4 Switch' 0"
|
||||
]
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 3 Switch"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 4 Switch"
|
||||
Macro [
|
||||
{ SetLED { LED="mic" Action="attach" CtlId="cs42l43 Decimator 3 Switch" } }
|
||||
{ SetLED { LED="mic" Action="attach" CtlId="cs42l43 Decimator 4 Switch" } }
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,4 @@ BootSequence [
|
|||
cset "name='cs42l43 Decimator 1 Switch' 0"
|
||||
]
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 1 Switch"
|
||||
]
|
||||
Macro [{ SetLED { LED="mic" Action="attach" CtlId="cs42l43 Decimator 1 Switch" } }]
|
||||
|
|
|
|||
|
|
@ -8,7 +8,4 @@ BootSequence [
|
|||
cset "name='rt714 FU02 Capture Volume' 47"
|
||||
]
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:rt714 FU02 Capture Switch"
|
||||
]
|
||||
Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt714 FU02 Capture Switch" } }]
|
||||
|
|
|
|||
|
|
@ -24,8 +24,5 @@ If.capturesw {
|
|||
Type ControlExists
|
||||
Control "name='rt715 Capture Switch'"
|
||||
}
|
||||
True.FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:rt715 Capture Switch"
|
||||
]
|
||||
Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt715 Capture Switch" } }]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,4 @@ BootSequence [
|
|||
cset "name='rt722 FU0F Capture Volume' 63"
|
||||
]
|
||||
|
||||
FixedBootSequence [
|
||||
exec "-/sbin/modprobe snd_ctl_led"
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:rt722 FU1E Capture Switch"
|
||||
]
|
||||
Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt722 FU1E Capture Switch" } }]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ SectionUseCase."HiFi" {
|
|||
Comment "Play HiFi quality Music"
|
||||
}
|
||||
|
||||
Include.led.File "/common/ctl/led.conf"
|
||||
Include.card-init.File "/lib/card-init.conf"
|
||||
Include.ctl-remap.File "/lib/ctl-remap.conf"
|
||||
|
||||
|
|
@ -126,9 +127,7 @@ If.mic_init_rt715 {
|
|||
Needle "rt715"
|
||||
Haystack "${var:MicCodec1}"
|
||||
}
|
||||
True.BootSequence [
|
||||
sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:PGA5.0 5 Master Capture Switch"
|
||||
]
|
||||
True.Macro [{ SetLED { LED="mic" Action="detach" CtlId="PGA5.0 5 Master Capture Switch" } }]
|
||||
}
|
||||
|
||||
If.pga_init_pga2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue