diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-12-10 13:57:01 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2009-12-15 09:33:32 +0100 |
commit | 5e26dfd0615868872cb44842f1e1428c7b414ab0 (patch) | |
tree | 75472db826d948edde152969045a819653ac54b3 /sound/pci/hda/hda_codec.c | |
parent | 9e3fd8719f624a43575b56a4777b1552399a8be8 (diff) | |
download | lwn-5e26dfd0615868872cb44842f1e1428c7b414ab0.tar.gz lwn-5e26dfd0615868872cb44842f1e1428c7b414ab0.zip |
ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAG
The HDA_SUBDEV_NID_FLAG is duplicate for amplifier control elements. Move
get_amp_nid_() call to the snd_hda_ctl_add() function.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index c9af15ed7f10..c848ec0f085e 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1733,11 +1733,14 @@ int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, unsigned short flags = 0; struct hda_nid_item *item; - if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) + if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) { flags |= HDA_NID_ITEM_AMP; + if (nid == 0) + nid = get_amp_nid_(kctl->private_value); + } if ((kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) != 0 && nid == 0) nid = kctl->id.subdevice & 0xffff; - if (kctl->id.subdevice & 0xf0000000) + if (kctl->id.subdevice & (HDA_SUBDEV_NID_FLAG|HDA_SUBDEV_AMP_FLAG)) kctl->id.subdevice = 0; err = snd_ctl_add(codec->bus->card, kctl); if (err < 0) |