diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-12-10 07:57:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2009-12-15 03:33:32 -0500 |
commit | 5e26dfd0615868872cb44842f1e1428c7b414ab0 (patch) | |
tree | 75472db826d948edde152969045a819653ac54b3 /sound/pci/hda/patch_realtek.c | |
parent | 9e3fd8719f624a43575b56a4777b1552399a8be8 (diff) |
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/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 87bf7bd6292a..cb7679551bdc 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2482,8 +2482,7 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2482 | if (!kctl) | 2482 | if (!kctl) |
2483 | return -ENOMEM; | 2483 | return -ENOMEM; |
2484 | kctl->private_value = spec->beep_amp; | 2484 | kctl->private_value = spec->beep_amp; |
2485 | err = snd_hda_ctl_add(codec, | 2485 | err = snd_hda_ctl_add(codec, 0, kctl); |
2486 | get_amp_nid_(spec->beep_amp), kctl); | ||
2487 | if (err < 0) | 2486 | if (err < 0) |
2488 | return err; | 2487 | return err; |
2489 | } | 2488 | } |
@@ -4414,9 +4413,7 @@ static int add_control(struct alc_spec *spec, int type, const char *name, | |||
4414 | if (!knew->name) | 4413 | if (!knew->name) |
4415 | return -ENOMEM; | 4414 | return -ENOMEM; |
4416 | if (get_amp_nid_(val)) | 4415 | if (get_amp_nid_(val)) |
4417 | knew->subdevice = HDA_SUBDEV_NID_FLAG | | 4416 | knew->subdevice = HDA_SUBDEV_AMP_FLAG; |
4418 | HDA_SUBDEV_AMP_FLAG | | ||
4419 | get_amp_nid_(val); | ||
4420 | knew->private_value = val; | 4417 | knew->private_value = val; |
4421 | return 0; | 4418 | return 0; |
4422 | } | 4419 | } |
@@ -10921,7 +10918,7 @@ static struct snd_kcontrol_new alc262_fujitsu_mixer[] = { | |||
10921 | { | 10918 | { |
10922 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 10919 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
10923 | .name = "Master Playback Switch", | 10920 | .name = "Master Playback Switch", |
10924 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 10921 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
10925 | .info = snd_hda_mixer_amp_switch_info, | 10922 | .info = snd_hda_mixer_amp_switch_info, |
10926 | .get = snd_hda_mixer_amp_switch_get, | 10923 | .get = snd_hda_mixer_amp_switch_get, |
10927 | .put = alc262_fujitsu_master_sw_put, | 10924 | .put = alc262_fujitsu_master_sw_put, |
@@ -10962,7 +10959,7 @@ static struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = { | |||
10962 | { | 10959 | { |
10963 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 10960 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
10964 | .name = "Master Playback Switch", | 10961 | .name = "Master Playback Switch", |
10965 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x1b, | 10962 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
10966 | .info = snd_hda_mixer_amp_switch_info, | 10963 | .info = snd_hda_mixer_amp_switch_info, |
10967 | .get = snd_hda_mixer_amp_switch_get, | 10964 | .get = snd_hda_mixer_amp_switch_get, |
10968 | .put = alc262_lenovo_3000_master_sw_put, | 10965 | .put = alc262_lenovo_3000_master_sw_put, |
@@ -12139,7 +12136,7 @@ static struct snd_kcontrol_new alc268_acer_aspire_one_mixer[] = { | |||
12139 | { | 12136 | { |
12140 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12137 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12141 | .name = "Master Playback Switch", | 12138 | .name = "Master Playback Switch", |
12142 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 12139 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
12143 | .info = snd_hda_mixer_amp_switch_info, | 12140 | .info = snd_hda_mixer_amp_switch_info, |
12144 | .get = snd_hda_mixer_amp_switch_get, | 12141 | .get = snd_hda_mixer_amp_switch_get, |
12145 | .put = alc268_acer_master_sw_put, | 12142 | .put = alc268_acer_master_sw_put, |
@@ -12155,7 +12152,7 @@ static struct snd_kcontrol_new alc268_acer_mixer[] = { | |||
12155 | { | 12152 | { |
12156 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12153 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12157 | .name = "Master Playback Switch", | 12154 | .name = "Master Playback Switch", |
12158 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 12155 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
12159 | .info = snd_hda_mixer_amp_switch_info, | 12156 | .info = snd_hda_mixer_amp_switch_info, |
12160 | .get = snd_hda_mixer_amp_switch_get, | 12157 | .get = snd_hda_mixer_amp_switch_get, |
12161 | .put = alc268_acer_master_sw_put, | 12158 | .put = alc268_acer_master_sw_put, |
@@ -12173,7 +12170,7 @@ static struct snd_kcontrol_new alc268_acer_dmic_mixer[] = { | |||
12173 | { | 12170 | { |
12174 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12171 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12175 | .name = "Master Playback Switch", | 12172 | .name = "Master Playback Switch", |
12176 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 12173 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
12177 | .info = snd_hda_mixer_amp_switch_info, | 12174 | .info = snd_hda_mixer_amp_switch_info, |
12178 | .get = snd_hda_mixer_amp_switch_get, | 12175 | .get = snd_hda_mixer_amp_switch_get, |
12179 | .put = alc268_acer_master_sw_put, | 12176 | .put = alc268_acer_master_sw_put, |
@@ -13126,7 +13123,7 @@ static struct snd_kcontrol_new alc269_quanta_fl1_mixer[] = { | |||
13126 | { | 13123 | { |
13127 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 13124 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
13128 | .name = "Master Playback Switch", | 13125 | .name = "Master Playback Switch", |
13129 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 13126 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
13130 | .info = snd_hda_mixer_amp_switch_info, | 13127 | .info = snd_hda_mixer_amp_switch_info, |
13131 | .get = snd_hda_mixer_amp_switch_get, | 13128 | .get = snd_hda_mixer_amp_switch_get, |
13132 | .put = alc268_acer_master_sw_put, | 13129 | .put = alc268_acer_master_sw_put, |
@@ -13147,7 +13144,7 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = { | |||
13147 | { | 13144 | { |
13148 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 13145 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
13149 | .name = "Master Playback Switch", | 13146 | .name = "Master Playback Switch", |
13150 | .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, | 13147 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
13151 | .info = snd_hda_mixer_amp_switch_info, | 13148 | .info = snd_hda_mixer_amp_switch_info, |
13152 | .get = snd_hda_mixer_amp_switch_get, | 13149 | .get = snd_hda_mixer_amp_switch_get, |
13153 | .put = alc268_acer_master_sw_put, | 13150 | .put = alc268_acer_master_sw_put, |