OSDN Git Service

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)
commit792cf2fa2ea926c0c07277c0b67ab60745e8f898
treed12cdd2a131d77f6cfc31438e0141186cd885831
parent2f179721c4a2d1035a93e9c908740d87ac9952e2
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