Skip to content

Commit 6fa5e50

Browse files
committed
common: add led.conf with SetLED macro to hide implementation details
Closes: alsa-project#517 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
1 parent 99a8066 commit 6fa5e50

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

ucm2/common/ctl/led.conf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Macro SetLED - attach or detach speaker or microphone LED to given control element
3+
#
4+
# Arguments:
5+
# LED - LED selection - "speaker" or "mic"
6+
# Action - action for given control - "attach" or "detach"
7+
# CtlId - control identifier (as for amixer, e.g. "Capture Switch" or "name='CaptureSwitch',index=1")
8+
#
9+
10+
DefineMacro.SetLED {
11+
If.0 {
12+
Condition {
13+
Type String
14+
Empty "${var:-SndCtlLedModprobe}"
15+
}
16+
True {
17+
FixedBootSequence [
18+
exec "-/sbin/modprobe snd_ctl_led"
19+
]
20+
Define.SndCtlLedModprobe ok
21+
}
22+
}
23+
If.1 {
24+
Condition { Type AlwaysTrue }
25+
True.FixedBootSequence [
26+
sysw "-/class/sound/ctl-led/${var:__LED}/card${CardNumber}/${var:__Action}:${var:__CtlId}"
27+
]
28+
}
29+
}
30+
31+
#
32+
# Macro CtlNew - helper to create new control elemend
33+
#
34+
# Arguments:
35+
# Arg - string for cset-new
36+
#
37+
38+
DefineMacro.CtlNew.FixedBootSequence [
39+
cset-new "${var:__Arg}"
40+
]

0 commit comments

Comments
 (0)