aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_sigmatel.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f9b2c435a130..04012237096c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -111,7 +111,6 @@ struct sigmatel_spec {
111 unsigned int alt_switch: 1; 111 unsigned int alt_switch: 1;
112 unsigned int hp_detect: 1; 112 unsigned int hp_detect: 1;
113 unsigned int gpio_mute: 1; 113 unsigned int gpio_mute: 1;
114 unsigned int no_vol_knob :1;
115 114
116 unsigned int gpio_mask, gpio_data; 115 unsigned int gpio_mask, gpio_data;
117 116
@@ -342,42 +341,6 @@ static int stac92xx_aloopback_put(struct snd_kcontrol *kcontrol,
342 return 1; 341 return 1;
343} 342}
344 343
345static int stac92xx_volknob_info(struct snd_kcontrol *kcontrol,
346 struct snd_ctl_elem_info *uinfo)
347{
348 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
349 uinfo->count = 1;
350 uinfo->value.integer.min = 0;
351 uinfo->value.integer.max = 127;
352 return 0;
353}
354
355static int stac92xx_volknob_get(struct snd_kcontrol *kcontrol,
356 struct snd_ctl_elem_value *ucontrol)
357{
358 ucontrol->value.integer.value[0] = kcontrol->private_value & 0xff;
359 return 0;
360}
361
362static int stac92xx_volknob_put(struct snd_kcontrol *kcontrol,
363 struct snd_ctl_elem_value *ucontrol)
364{
365 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
366 unsigned int val = kcontrol->private_value & 0xff;
367
368 if (val == ucontrol->value.integer.value[0])
369 return 0;
370
371 val = ucontrol->value.integer.value[0];
372 kcontrol->private_value &= ~0xff;
373 kcontrol->private_value |= val;
374
375 snd_hda_codec_write_cache(codec, kcontrol->private_value >> 16, 0,
376 AC_VERB_SET_VOLUME_KNOB_CONTROL, val | 0x80);
377 return 1;
378}
379
380
381static struct hda_verb stac9200_core_init[] = { 344static struct hda_verb stac9200_core_init[] = {
382 /* set dac0mux for dac converter */ 345 /* set dac0mux for dac converter */
383 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, 346 { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
@@ -446,18 +409,6 @@ static struct hda_verb stac9205_core_init[] = {
446 .private_value = verb_read | (verb_write << 16), \ 409 .private_value = verb_read | (verb_write << 16), \
447 } 410 }
448 411
449#define STAC_VOLKNOB(knob_nid) \
450 { \
451 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
452 .name = "Master Playback Volume", \
453 .count = 1, \
454 .info = stac92xx_volknob_info, \
455 .get = stac92xx_volknob_get, \
456 .put = stac92xx_volknob_put, \
457 .private_value = 127 | (knob_nid << 16), \
458 }
459
460
461static struct snd_kcontrol_new stac9200_mixer[] = { 412static struct snd_kcontrol_new stac9200_mixer[] = {
462 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), 413 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT),
463 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), 414 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT),
@@ -487,7 +438,6 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
487 }, 438 },
488 STAC_INPUT_SOURCE(2), 439 STAC_INPUT_SOURCE(2),
489 STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0), 440 STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0),
490 STAC_VOLKNOB(0x24),
491 441
492 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1b, 0x0, HDA_INPUT), 442 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1b, 0x0, HDA_INPUT),
493 HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1d, 0x0, HDA_OUTPUT), 443 HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1d, 0x0, HDA_OUTPUT),
@@ -503,7 +453,6 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
503/* This needs to be generated dynamically based on sequence */ 453/* This needs to be generated dynamically based on sequence */
504static struct snd_kcontrol_new stac922x_mixer[] = { 454static struct snd_kcontrol_new stac922x_mixer[] = {
505 STAC_INPUT_SOURCE(2), 455 STAC_INPUT_SOURCE(2),
506 STAC_VOLKNOB(0x16),
507 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_INPUT), 456 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_INPUT),
508 HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_INPUT), 457 HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_INPUT),
509 HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x12, 0x0, HDA_OUTPUT), 458 HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x0, 0x12, 0x0, HDA_OUTPUT),
@@ -517,7 +466,6 @@ static struct snd_kcontrol_new stac922x_mixer[] = {
517 466
518static struct snd_kcontrol_new stac927x_mixer[] = { 467static struct snd_kcontrol_new stac927x_mixer[] = {
519 STAC_INPUT_SOURCE(3), 468 STAC_INPUT_SOURCE(3),
520 STAC_VOLKNOB(0x24),
521 STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB), 469 STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB),
522 470
523 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x18, 0x0, HDA_INPUT), 471 HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x18, 0x0, HDA_INPUT),
@@ -1931,8 +1879,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
1931 } 1879 }
1932 if (spec->multiout.hp_nid) { 1880 if (spec->multiout.hp_nid) {
1933 const char *pfx; 1881 const char *pfx;
1934 if (old_num_dacs == spec->multiout.num_dacs && 1882 if (old_num_dacs == spec->multiout.num_dacs)
1935 spec->no_vol_knob)
1936 pfx = "Master"; 1883 pfx = "Master";
1937 else 1884 else
1938 pfx = "Headphone"; 1885 pfx = "Headphone";
@@ -2489,7 +2436,6 @@ static int patch_stac9200(struct hda_codec *codec)
2489 codec->spec = spec; 2436 codec->spec = spec;
2490 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); 2437 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
2491 spec->pin_nids = stac9200_pin_nids; 2438 spec->pin_nids = stac9200_pin_nids;
2492 spec->no_vol_knob = 1;
2493 spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, 2439 spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
2494 stac9200_models, 2440 stac9200_models,
2495 stac9200_cfg_tbl); 2441 stac9200_cfg_tbl);
@@ -2544,7 +2490,6 @@ static int patch_stac925x(struct hda_codec *codec)
2544 codec->spec = spec; 2490 codec->spec = spec;
2545 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); 2491 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
2546 spec->pin_nids = stac925x_pin_nids; 2492 spec->pin_nids = stac925x_pin_nids;
2547 spec->no_vol_knob = 1;
2548 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, 2493 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
2549 stac925x_models, 2494 stac925x_models,
2550 stac925x_cfg_tbl); 2495 stac925x_cfg_tbl);