ucm2: Add setting LED Mode in SetLED macro
Add 'Mode' argument to SetLED macro in order to allow setting a different LED mode. This will allow mute switches with inverted values to control the LEDs with 'follow-route' option instead of default 'follow-mute'. The Mode argument is optional. Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/637 Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d6a783d329
commit
2e090676c9
2 changed files with 11 additions and 1 deletions
|
|
@ -5,5 +5,5 @@ BootSequence [
|
|||
]
|
||||
|
||||
Macro [
|
||||
{ SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Mute Switch" } }
|
||||
{ SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Mute Switch" Mode="follow-route"} }
|
||||
]
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
# LED - LED selection - "speaker" or "mic"
|
||||
# Action - action for given control - "attach" or "detach"
|
||||
# CtlId - control identifier (as for amixer, e.g. "Capture Switch" or "name='CaptureSwitch',index=1")
|
||||
# Mode - (optional) LED mode - "on", "off", "follow-mute" or "follow-route"
|
||||
#
|
||||
|
||||
DefineMacro.SetLED {
|
||||
|
|
@ -46,6 +47,15 @@ DefineMacro.SetLED {
|
|||
}
|
||||
}
|
||||
If.1 {
|
||||
Condition {
|
||||
Type String
|
||||
Empty "${var:-__Mode}"
|
||||
}
|
||||
False.FixedBootSequence [
|
||||
sysw "-/class/sound/ctl-led/${var:__LED}/mode:${var:__Mode}"
|
||||
]
|
||||
}
|
||||
If.2 {
|
||||
Condition { Type AlwaysTrue }
|
||||
True.FixedBootSequence [
|
||||
sysw "-/class/sound/ctl-led/${var:__LED}/card${CardNumber}/${var:__Action}:${var:__CtlId}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue