aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 11:12:15 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:45 -0400
commitcca3b3718ca96dca51daf1129ac03003bcede751 (patch)
tree32dc0ee54e783fe0021f26061dfbdd37beef4d1f /sound/pci/hda/patch_analog.c
parent47fd830acf0b6b5bc75db55d0f2cc64f59a23b5f (diff)
[ALSA] hda-codec - Clean up bind-controls
We have already a generic bind-control helper, so let's clean up the codes using it. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index febc2053f08e..f9390a544ea4 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1127,23 +1127,14 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol,
1127} 1127}
1128 1128
1129/* bind volumes of both NID 0x05 and 0x06 */ 1129/* bind volumes of both NID 0x05 and 0x06 */
1130static int ad1981_hp_master_vol_put(struct snd_kcontrol *kcontrol, 1130static struct hda_bind_ctls ad1981_hp_bind_master_vol = {
1131 struct snd_ctl_elem_value *ucontrol) 1131 .ops = &snd_hda_bind_vol,
1132{ 1132 .values = {
1133 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 1133 HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT),
1134 long *valp = ucontrol->value.integer.value; 1134 HDA_COMPOSE_AMP_VAL(0x06, 3, 0, HDA_OUTPUT),
1135 int change; 1135 0
1136 1136 },
1137 change = snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0, 1137};
1138 HDA_AMP_VOLMASK, valp[0]);
1139 change |= snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0,
1140 HDA_AMP_VOLMASK, valp[1]);
1141 snd_hda_codec_amp_update(codec, 0x06, 0, HDA_OUTPUT, 0,
1142 HDA_AMP_VOLMASK, valp[0]);
1143 snd_hda_codec_amp_update(codec, 0x06, 1, HDA_OUTPUT, 0,
1144 HDA_AMP_VOLMASK, valp[1]);
1145 return change;
1146}
1147 1138
1148/* mute internal speaker if HP is plugged */ 1139/* mute internal speaker if HP is plugged */
1149static void ad1981_hp_automute(struct hda_codec *codec) 1140static void ad1981_hp_automute(struct hda_codec *codec)
@@ -1204,14 +1195,7 @@ static struct hda_input_mux ad1981_hp_capture_source = {
1204}; 1195};
1205 1196
1206static struct snd_kcontrol_new ad1981_hp_mixers[] = { 1197static struct snd_kcontrol_new ad1981_hp_mixers[] = {
1207 { 1198 HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol),
1208 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1209 .name = "Master Playback Volume",
1210 .info = snd_hda_mixer_amp_volume_info,
1211 .get = snd_hda_mixer_amp_volume_get,
1212 .put = ad1981_hp_master_vol_put,
1213 .private_value = HDA_COMPOSE_AMP_VAL(0x05, 3, 0, HDA_OUTPUT),
1214 },
1215 { 1199 {
1216 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1200 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1217 .name = "Master Playback Switch", 1201 .name = "Master Playback Switch",