]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda/realtek - Reduce vol/mute ctl lookups at parsing codec
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Dec 2012 15:04:30 +0000 (16:04 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Jan 2013 09:34:27 +0000 (10:34 +0100)
commite55cdd0609e8a50da5e58aa4f3e7d5febe7ad3a0
treed12cdd2a131d77f6cfc31438e0141186cd885831
parentf81063487cebbc2048827cde0bfa9dde7deb6aec
ALSA: hda/realtek - Reduce vol/mute ctl lookups at parsing codec

So far, Realtek codec driver evaluates the NIDs for volume and mute
controls twice, once while parsing the DACs and evaluating the
assignment, and another while creating the mixer elements.  This is
utterly redundant and even fragile, as it's assuming that the ctl
element evaluation is identical between both parsing DACs and creating
mixer elements.

This patch simplifies the code flow by doing the volume / mute
controls evaluation only once while parsing the DACs.  The patch ended
up in larger changes than expected because of some cleanups became
mandatory.

As a gratis bonus, this patch also fixes some cases where the stereo
channels are used wrongly for mono amps.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c