]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: led control - add sysfs kcontrol LED marking layer
authorJaroslav Kysela <perex@perex.cz>
Wed, 17 Mar 2021 17:29:45 +0000 (18:29 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 30 Mar 2021 13:41:30 +0000 (15:41 +0200)
commit4c57807d86be02ec2f959e2694a971a43a686ae6
tree40ec92d5e0fe0e15dde47499144e7d6ea7ad90da
parent2783e273050a9a1ae1ef06d8b31c78711f5bb2f1
ALSA: led control - add sysfs kcontrol LED marking layer

We need to manage the kcontrol entries association for the LED trigger
from the user space. This patch adds a layer to the sysfs tree like:

/sys/devices/virtual/sound/ctl-led/mic
   + card0
   |  + attach
   |  + detach
   |  ...
   + card1
      + attach
      ...

Operations:

  attach and detach
    - amixer style ID is accepted and easy strings for numid and
      simple names
  reset
    - reset all associated kcontrol entries
  list
    - list associated kcontrol entries (numid values only)

Additional symlinks:

/sys/devices/virtual/sound/ctl-led/mic/card0/card ->
  /sys/class/sound/card0

/sys/class/sound/card0/controlC0/led-mic ->
  /sys/devices/virtual/sound/ctl-led/mic/card0

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210317172945.842280-7-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control_led.c