aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-11-19 05:56:26 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:26 -0500
commitf673dc829bc8a9805d82df14a3e08b94f3d6fd50 (patch)
treefb1595e21541ede5e658151c28730cfab2142a91 /sound/pci
parente171613949e350966f5cc8c9b0023a5f746f7a5d (diff)
[ALSA] hda-codec - Revert volume knob controls in STAC codecs
Volume knob controls with STAC codecs seem to cause problems with some devices. Volumes change very slowly or silent suddenly. It's likely due to conflict between the software and the hardware volume knob setup. Since we'll have a virtual master control in future, it's safer to remove this control completely right now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 0817f42a7c86..d2996ad8a49a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -374,42 +374,6 @@ static int stac92xx_aloopback_put(struct snd_kcontrol *kcontrol,
374 return 1; 374 return 1;
375} 375}
376 376
377static int stac92xx_volknob_info(struct snd_kcontrol *kcontrol,
378 struct snd_ctl_elem_info *uinfo)
379{
380 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
381 uinfo->count = 1;
382 uinfo->value.integer.min = 0;
383 uinfo->value.integer.max = 127;
384 return 0;
385}
386
387static int stac92xx_volknob_get(struct snd_kcontrol *kcontrol,
388 struct snd_ctl_elem_value *ucontrol)
389{
390 ucontrol->value.integer.value[0] = kcontrol->private_value & 0xff;
391 return 0;
392}
393
394static int stac92xx_volknob_put(struct snd_kcontrol *kcontrol,
395 struct snd_ctl_elem_value *ucontrol)
396{
397 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
398 unsigned int oval = kcontrol->private_value & 0xff;
399 unsigned int val;
400
401 val = ucontrol->value.integer.value[0] & 0xff;
402 if (val == oval)
403 return 0;
404
405 kcontrol->private_value &= ~0xff;
406 kcontrol->private_value |= val;
407
408 snd_hda_codec_write_cache(codec, kcontrol->private_value >> 16, 0,
409 AC_VERB_SET_VOLUME_KNOB_CONTROL, val | 0x80);
410 return 1;
411}
412
413static struct hda_verb stac9200_core_init[] = { 377static struct hda_verb stac9200_core_init[] = {
414 /* set dac0mux for dac converter */ 378 /* set dac0mux for dac converter */
415 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, 379 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
@@ -507,17 +471,6 @@ static struct hda_verb stac9205_core_init[] = {
507 .private_value = verb_read | (verb_write << 16), \ 471 .private_value = verb_read | (verb_write << 16), \
508 } 472 }
509 473
510#define STAC_VOLKNOB(knob_nid) \
511 { \
512 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
513 .name = "Master Playback Volume", \
514 .count = 1, \
515 .info = stac92xx_volknob_info, \
516 .get = stac92xx_volknob_get, \
517 .put = stac92xx_volknob_put, \
518 .private_value = 127 | (knob_nid << 16), \
519 }
520
521static struct snd_kcontrol_new stac9200_mixer[] = { 474static struct snd_kcontrol_new stac9200_mixer[] = {
522 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), 475 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT),
523 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), 476 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT),
@@ -531,7 +484,6 @@ static struct snd_kcontrol_new stac9200_mixer[] = {
531static struct snd_kcontrol_new stac92hd71bxx_mixer[] = { 484static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
532 STAC_DIGITAL_INPUT_SOURCE(1), 485 STAC_DIGITAL_INPUT_SOURCE(1),
533 STAC_INPUT_SOURCE(2), 486 STAC_INPUT_SOURCE(2),
534 STAC_VOLKNOB(0x28),
535 487
536 /* hardware gain controls */ 488 /* hardware gain controls */
537 HDA_CODEC_VOLUME_IDX("Digital Mic Volume", 0x0, 0x18, 0x0, HDA_OUTPUT), 489 HDA_CODEC_VOLUME_IDX("Digital Mic Volume", 0x0, 0x18, 0x0, HDA_OUTPUT),