aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.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_realtek.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_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 29119fd4017..ebbabeb3293 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7408,23 +7408,14 @@ static void alc262_fujitsu_unsol_event(struct hda_codec *codec,
7408} 7408}
7409 7409
7410/* bind volumes of both NID 0x0c and 0x0d */ 7410/* bind volumes of both NID 0x0c and 0x0d */
7411static int alc262_fujitsu_master_vol_put(struct snd_kcontrol *kcontrol, 7411static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = {
7412 struct snd_ctl_elem_value *ucontrol) 7412 .ops = &snd_hda_bind_vol,
7413{ 7413 .values = {
7414 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 7414 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT),
7415 long *valp = ucontrol->value.integer.value; 7415 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT),
7416 int change; 7416 0
7417 7417 },
7418 change = snd_hda_codec_amp_update(codec, 0x0c, 0, HDA_OUTPUT, 0, 7418};
7419 HDA_AMP_VOLMASK, valp[0]);
7420 change |= snd_hda_codec_amp_update(codec, 0x0c, 1, HDA_OUTPUT, 0,
7421 HDA_AMP_VOLMASK, valp[1]);
7422 snd_hda_codec_amp_update(codec, 0x0d, 0, HDA_OUTPUT, 0,
7423 HDA_AMP_VOLMASK, valp[0]);
7424 snd_hda_codec_amp_update(codec, 0x0d, 1, HDA_OUTPUT, 0,
7425 HDA_AMP_VOLMASK, valp[1]);
7426 return change;
7427}
7428 7419
7429/* bind hp and internal speaker mute (with plug check) */ 7420/* bind hp and internal speaker mute (with plug check) */
7430static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, 7421static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
@@ -7446,15 +7437,7 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
7446} 7437}
7447 7438
7448static struct snd_kcontrol_new alc262_fujitsu_mixer[] = { 7439static struct snd_kcontrol_new alc262_fujitsu_mixer[] = {
7449 { 7440 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
7450 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7451 .name = "Master Playback Volume",
7452 .info = snd_hda_mixer_amp_volume_info,
7453 .get = snd_hda_mixer_amp_volume_get,
7454 .put = alc262_fujitsu_master_vol_put,
7455 .tlv = { .c = snd_hda_mixer_amp_tlv },
7456 .private_value = HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT),
7457 },
7458 { 7441 {
7459 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 7442 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7460 .name = "Master Playback Switch", 7443 .name = "Master Playback Switch",