All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ALSA: control - add generic LED trigger code
@ 2021-02-11 11:13 Jaroslav Kysela
  2021-02-11 11:13 ` [PATCH 1/5] ALSA: control - introduce snd_ctl_notify_one() helper Jaroslav Kysela
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Jaroslav Kysela @ 2021-02-11 11:13 UTC (permalink / raw)
  To: ALSA development; +Cc: Takashi Iwai, Hans de Goede, Perry Yuan

This patchset tries to resolve the diversity in the audio LED
control among the ALSA drivers.

A new control layer registration is introduced which allows
to run additional operations on top of the elementary ALSA
sound controls.

A new control access group (three bits in the access flags)
was introduced to carry the LED group information for
the sound controls. The low-level sound drivers can just
mark those controls using this access group. This information
is exported to the user space and eventually the user space
can create sound controls which can belong to a LED group.

The actual state ('route') evaluation is really easy
(the minimal value check for all channels / controls / cards).
If there's more complicated logic for a given hardware,
the card driver may eventually export a new read-only
sound control for the LED group and do the logic itself.

The new LED trigger control code is completely separated
and possibly optional (there's no symbol dependency).
The full code separation allows eventually to move this
LED trigger control to the user space in future.
Actually it replaces the already present functionality
in the kernel space (HDA drivers) and allows a quick adoption
for the recent hardware (SoundWire ASoC codecs).

# lsmod | grep snd_ctl_led
snd_ctl_led            16384  0

The sound driver implementation is really easy:

1) call snd_ctl_led_request() when control LED layer should be
   automatically activated
   / it calls module_request("snd-ctl-led") on demand /
2) mark all related kcontrols with
	SNDRV_CTL_ELEM_ACCESS_SPK_LED or
	SNDRV_CTL_ELEM_ACCESS_MIC_LED

Original RFC: https://lore.kernel.org/alsa-devel/20210207201157.869972-1-perex@perex.cz/

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Perry Yuan <Perry.Yuan@dell.com>

Jaroslav Kysela (5):
  ALSA: control - introduce snd_ctl_notify_one() helper
  ALSA: control - add layer registration routines
  ALSA: control - add generic LED trigger module as the new control
    layer
  ALSA: HDA - remove the custom implementation for the audio LED trigger
  ALSA: control - add sysfs support to the LED trigger module

 include/sound/control.h         |  27 ++-
 include/uapi/sound/asound.h     |   6 +-
 sound/core/Kconfig              |   6 +
 sound/core/Makefile             |   2 +
 sound/core/control.c            | 173 ++++++++++++--
 sound/core/control_led.c        | 407 ++++++++++++++++++++++++++++++++
 sound/pci/hda/Kconfig           |   4 +-
 sound/pci/hda/hda_codec.c       |  69 +-----
 sound/pci/hda/hda_generic.c     | 162 ++-----------
 sound/pci/hda/hda_generic.h     |  15 +-
 sound/pci/hda/hda_local.h       |  16 +-
 sound/pci/hda/patch_ca0132.c    |   4 +-
 sound/pci/hda/patch_realtek.c   |   2 +-
 sound/pci/hda/patch_sigmatel.c  |   6 +-
 sound/pci/hda/thinkpad_helper.c |   2 +-
 15 files changed, 638 insertions(+), 263 deletions(-)
 create mode 100644 sound/core/control_led.c

-- 
2.29.2

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-02-25 11:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 11:13 [PATCH 0/5] ALSA: control - add generic LED trigger code Jaroslav Kysela
2021-02-11 11:13 ` [PATCH 1/5] ALSA: control - introduce snd_ctl_notify_one() helper Jaroslav Kysela
2021-02-11 11:13 ` [PATCH 2/5] ALSA: control - add layer registration routines Jaroslav Kysela
2021-02-11 11:13 ` [PATCH 3/5] ALSA: control - add generic LED trigger module as the new control layer Jaroslav Kysela
2021-02-11 11:13 ` [PATCH 4/5] ALSA: HDA - remove the custom implementation for the audio LED trigger Jaroslav Kysela
2021-02-11 12:19   ` kernel test robot
2021-02-11 12:19     ` kernel test robot
2021-02-11 13:03     ` Jaroslav Kysela
2021-02-22  7:28   ` [ALSA] a7fc56df5a: WARNING:possible_circular_locking_dependency_detected kernel test robot
2021-02-22  7:28     ` kernel test robot
2021-02-11 11:14 ` [PATCH 5/5] ALSA: control - add sysfs support to the LED trigger module Jaroslav Kysela
2021-02-11 12:43   ` kernel test robot
2021-02-11 12:43     ` kernel test robot
2021-02-11 17:15 ` [PATCH 0/5] ALSA: control - add generic LED trigger code Takashi Iwai
2021-02-11 17:53   ` Jaroslav Kysela
2021-02-12  9:23     ` Takashi Iwai
2021-02-12 10:32       ` Jaroslav Kysela
2021-02-12 12:28         ` Takashi Iwai
2021-02-14 18:55           ` Jaroslav Kysela
2021-02-15  7:50             ` Takashi Iwai
2021-02-15 17:49               ` Jaroslav Kysela
2021-02-12 20:31 ` Hans de Goede
2021-02-15 12:02   ` Hans de Goede
2021-02-15 12:35     ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.