diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 192 |
1 files changed, 167 insertions, 25 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index da34095c707f..f628c33d80b3 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -338,7 +338,7 @@ struct alc_spec { | |||
338 | void (*init_hook)(struct hda_codec *codec); | 338 | void (*init_hook)(struct hda_codec *codec); |
339 | void (*unsol_event)(struct hda_codec *codec, unsigned int res); | 339 | void (*unsol_event)(struct hda_codec *codec, unsigned int res); |
340 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 340 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
341 | void (*power_hook)(struct hda_codec *codec, int power); | 341 | void (*power_hook)(struct hda_codec *codec); |
342 | #endif | 342 | #endif |
343 | 343 | ||
344 | /* for pin sensing */ | 344 | /* for pin sensing */ |
@@ -391,7 +391,7 @@ struct alc_config_preset { | |||
391 | void (*init_hook)(struct hda_codec *); | 391 | void (*init_hook)(struct hda_codec *); |
392 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 392 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
393 | struct hda_amp_list *loopbacks; | 393 | struct hda_amp_list *loopbacks; |
394 | void (*power_hook)(struct hda_codec *codec, int power); | 394 | void (*power_hook)(struct hda_codec *codec); |
395 | #endif | 395 | #endif |
396 | }; | 396 | }; |
397 | 397 | ||
@@ -633,6 +633,7 @@ static int alc_pin_mode_put(struct snd_kcontrol *kcontrol, | |||
633 | 633 | ||
634 | #define ALC_PIN_MODE(xname, nid, dir) \ | 634 | #define ALC_PIN_MODE(xname, nid, dir) \ |
635 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ | 635 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ |
636 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
636 | .info = alc_pin_mode_info, \ | 637 | .info = alc_pin_mode_info, \ |
637 | .get = alc_pin_mode_get, \ | 638 | .get = alc_pin_mode_get, \ |
638 | .put = alc_pin_mode_put, \ | 639 | .put = alc_pin_mode_put, \ |
@@ -684,6 +685,7 @@ static int alc_gpio_data_put(struct snd_kcontrol *kcontrol, | |||
684 | } | 685 | } |
685 | #define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \ | 686 | #define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \ |
686 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ | 687 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ |
688 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
687 | .info = alc_gpio_data_info, \ | 689 | .info = alc_gpio_data_info, \ |
688 | .get = alc_gpio_data_get, \ | 690 | .get = alc_gpio_data_get, \ |
689 | .put = alc_gpio_data_put, \ | 691 | .put = alc_gpio_data_put, \ |
@@ -738,6 +740,7 @@ static int alc_spdif_ctrl_put(struct snd_kcontrol *kcontrol, | |||
738 | } | 740 | } |
739 | #define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \ | 741 | #define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \ |
740 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ | 742 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ |
743 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
741 | .info = alc_spdif_ctrl_info, \ | 744 | .info = alc_spdif_ctrl_info, \ |
742 | .get = alc_spdif_ctrl_get, \ | 745 | .get = alc_spdif_ctrl_get, \ |
743 | .put = alc_spdif_ctrl_put, \ | 746 | .put = alc_spdif_ctrl_put, \ |
@@ -791,6 +794,7 @@ static int alc_eapd_ctrl_put(struct snd_kcontrol *kcontrol, | |||
791 | 794 | ||
792 | #define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \ | 795 | #define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \ |
793 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ | 796 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ |
797 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
794 | .info = alc_eapd_ctrl_info, \ | 798 | .info = alc_eapd_ctrl_info, \ |
795 | .get = alc_eapd_ctrl_get, \ | 799 | .get = alc_eapd_ctrl_get, \ |
796 | .put = alc_eapd_ctrl_put, \ | 800 | .put = alc_eapd_ctrl_put, \ |
@@ -1840,14 +1844,6 @@ static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) | |||
1840 | spec->autocfg.speaker_pins[2] = 0x1b; | 1844 | spec->autocfg.speaker_pins[2] = 0x1b; |
1841 | } | 1845 | } |
1842 | 1846 | ||
1843 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
1844 | static void alc889_power_eapd(struct hda_codec *codec, int power) | ||
1845 | { | ||
1846 | set_eapd(codec, 0x14, power); | ||
1847 | set_eapd(codec, 0x15, power); | ||
1848 | } | ||
1849 | #endif | ||
1850 | |||
1851 | /* | 1847 | /* |
1852 | * ALC880 3-stack model | 1848 | * ALC880 3-stack model |
1853 | * | 1849 | * |
@@ -2450,6 +2446,15 @@ static const char *alc_slave_sws[] = { | |||
2450 | * build control elements | 2446 | * build control elements |
2451 | */ | 2447 | */ |
2452 | 2448 | ||
2449 | #define NID_MAPPING (-1) | ||
2450 | |||
2451 | #define SUBDEV_SPEAKER_ (0 << 6) | ||
2452 | #define SUBDEV_HP_ (1 << 6) | ||
2453 | #define SUBDEV_LINE_ (2 << 6) | ||
2454 | #define SUBDEV_SPEAKER(x) (SUBDEV_SPEAKER_ | ((x) & 0x3f)) | ||
2455 | #define SUBDEV_HP(x) (SUBDEV_HP_ | ((x) & 0x3f)) | ||
2456 | #define SUBDEV_LINE(x) (SUBDEV_LINE_ | ((x) & 0x3f)) | ||
2457 | |||
2453 | static void alc_free_kctls(struct hda_codec *codec); | 2458 | static void alc_free_kctls(struct hda_codec *codec); |
2454 | 2459 | ||
2455 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 2460 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
@@ -2464,8 +2469,11 @@ static struct snd_kcontrol_new alc_beep_mixer[] = { | |||
2464 | static int alc_build_controls(struct hda_codec *codec) | 2469 | static int alc_build_controls(struct hda_codec *codec) |
2465 | { | 2470 | { |
2466 | struct alc_spec *spec = codec->spec; | 2471 | struct alc_spec *spec = codec->spec; |
2467 | int err; | 2472 | struct snd_kcontrol *kctl; |
2468 | int i; | 2473 | struct snd_kcontrol_new *knew; |
2474 | int i, j, err; | ||
2475 | unsigned int u; | ||
2476 | hda_nid_t nid; | ||
2469 | 2477 | ||
2470 | for (i = 0; i < spec->num_mixers; i++) { | 2478 | for (i = 0; i < spec->num_mixers; i++) { |
2471 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); | 2479 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); |
@@ -2506,8 +2514,7 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2506 | if (!kctl) | 2514 | if (!kctl) |
2507 | return -ENOMEM; | 2515 | return -ENOMEM; |
2508 | kctl->private_value = spec->beep_amp; | 2516 | kctl->private_value = spec->beep_amp; |
2509 | err = snd_hda_ctl_add(codec, | 2517 | err = snd_hda_ctl_add(codec, 0, kctl); |
2510 | get_amp_nid_(spec->beep_amp), kctl); | ||
2511 | if (err < 0) | 2518 | if (err < 0) |
2512 | return err; | 2519 | return err; |
2513 | } | 2520 | } |
@@ -2534,6 +2541,75 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2534 | } | 2541 | } |
2535 | 2542 | ||
2536 | alc_free_kctls(codec); /* no longer needed */ | 2543 | alc_free_kctls(codec); /* no longer needed */ |
2544 | |||
2545 | /* assign Capture Source enums to NID */ | ||
2546 | kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); | ||
2547 | if (!kctl) | ||
2548 | kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); | ||
2549 | for (i = 0; kctl && i < kctl->count; i++) { | ||
2550 | hda_nid_t *nids = spec->capsrc_nids; | ||
2551 | if (!nids) | ||
2552 | nids = spec->adc_nids; | ||
2553 | err = snd_hda_add_nid(codec, kctl, i, nids[i]); | ||
2554 | if (err < 0) | ||
2555 | return err; | ||
2556 | } | ||
2557 | if (spec->cap_mixer) { | ||
2558 | const char *kname = kctl ? kctl->id.name : NULL; | ||
2559 | for (knew = spec->cap_mixer; knew->name; knew++) { | ||
2560 | if (kname && strcmp(knew->name, kname) == 0) | ||
2561 | continue; | ||
2562 | kctl = snd_hda_find_mixer_ctl(codec, knew->name); | ||
2563 | for (i = 0; kctl && i < kctl->count; i++) { | ||
2564 | err = snd_hda_add_nid(codec, kctl, i, | ||
2565 | spec->adc_nids[i]); | ||
2566 | if (err < 0) | ||
2567 | return err; | ||
2568 | } | ||
2569 | } | ||
2570 | } | ||
2571 | |||
2572 | /* other nid->control mapping */ | ||
2573 | for (i = 0; i < spec->num_mixers; i++) { | ||
2574 | for (knew = spec->mixers[i]; knew->name; knew++) { | ||
2575 | if (knew->iface != NID_MAPPING) | ||
2576 | continue; | ||
2577 | kctl = snd_hda_find_mixer_ctl(codec, knew->name); | ||
2578 | if (kctl == NULL) | ||
2579 | continue; | ||
2580 | u = knew->subdevice; | ||
2581 | for (j = 0; j < 4; j++, u >>= 8) { | ||
2582 | nid = u & 0x3f; | ||
2583 | if (nid == 0) | ||
2584 | continue; | ||
2585 | switch (u & 0xc0) { | ||
2586 | case SUBDEV_SPEAKER_: | ||
2587 | nid = spec->autocfg.speaker_pins[nid]; | ||
2588 | break; | ||
2589 | case SUBDEV_LINE_: | ||
2590 | nid = spec->autocfg.line_out_pins[nid]; | ||
2591 | break; | ||
2592 | case SUBDEV_HP_: | ||
2593 | nid = spec->autocfg.hp_pins[nid]; | ||
2594 | break; | ||
2595 | default: | ||
2596 | continue; | ||
2597 | } | ||
2598 | err = snd_hda_add_nid(codec, kctl, 0, nid); | ||
2599 | if (err < 0) | ||
2600 | return err; | ||
2601 | } | ||
2602 | u = knew->private_value; | ||
2603 | for (j = 0; j < 4; j++, u >>= 8) { | ||
2604 | nid = u & 0xff; | ||
2605 | if (nid == 0) | ||
2606 | continue; | ||
2607 | err = snd_hda_add_nid(codec, kctl, 0, nid); | ||
2608 | if (err < 0) | ||
2609 | return err; | ||
2610 | } | ||
2611 | } | ||
2612 | } | ||
2537 | return 0; | 2613 | return 0; |
2538 | } | 2614 | } |
2539 | 2615 | ||
@@ -3616,6 +3692,11 @@ static int alc_build_pcms(struct hda_codec *codec) | |||
3616 | return 0; | 3692 | return 0; |
3617 | } | 3693 | } |
3618 | 3694 | ||
3695 | static inline void alc_shutup(struct hda_codec *codec) | ||
3696 | { | ||
3697 | snd_hda_shutup_pins(codec); | ||
3698 | } | ||
3699 | |||
3619 | static void alc_free_kctls(struct hda_codec *codec) | 3700 | static void alc_free_kctls(struct hda_codec *codec) |
3620 | { | 3701 | { |
3621 | struct alc_spec *spec = codec->spec; | 3702 | struct alc_spec *spec = codec->spec; |
@@ -3636,17 +3717,47 @@ static void alc_free(struct hda_codec *codec) | |||
3636 | if (!spec) | 3717 | if (!spec) |
3637 | return; | 3718 | return; |
3638 | 3719 | ||
3720 | alc_shutup(codec); | ||
3639 | alc_free_kctls(codec); | 3721 | alc_free_kctls(codec); |
3640 | kfree(spec); | 3722 | kfree(spec); |
3641 | snd_hda_detach_beep_device(codec); | 3723 | snd_hda_detach_beep_device(codec); |
3642 | } | 3724 | } |
3643 | 3725 | ||
3644 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3726 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
3727 | static void alc_power_eapd(struct hda_codec *codec) | ||
3728 | { | ||
3729 | /* We currently only handle front, HP */ | ||
3730 | switch (codec->vendor_id) { | ||
3731 | case 0x10ec0260: | ||
3732 | snd_hda_codec_write(codec, 0x0f, 0, | ||
3733 | AC_VERB_SET_EAPD_BTLENABLE, 0x00); | ||
3734 | snd_hda_codec_write(codec, 0x10, 0, | ||
3735 | AC_VERB_SET_EAPD_BTLENABLE, 0x00); | ||
3736 | break; | ||
3737 | case 0x10ec0262: | ||
3738 | case 0x10ec0267: | ||
3739 | case 0x10ec0268: | ||
3740 | case 0x10ec0269: | ||
3741 | case 0x10ec0272: | ||
3742 | case 0x10ec0660: | ||
3743 | case 0x10ec0662: | ||
3744 | case 0x10ec0663: | ||
3745 | case 0x10ec0862: | ||
3746 | case 0x10ec0889: | ||
3747 | snd_hda_codec_write(codec, 0x14, 0, | ||
3748 | AC_VERB_SET_EAPD_BTLENABLE, 0x00); | ||
3749 | snd_hda_codec_write(codec, 0x15, 0, | ||
3750 | AC_VERB_SET_EAPD_BTLENABLE, 0x00); | ||
3751 | break; | ||
3752 | } | ||
3753 | } | ||
3754 | |||
3645 | static int alc_suspend(struct hda_codec *codec, pm_message_t state) | 3755 | static int alc_suspend(struct hda_codec *codec, pm_message_t state) |
3646 | { | 3756 | { |
3647 | struct alc_spec *spec = codec->spec; | 3757 | struct alc_spec *spec = codec->spec; |
3758 | alc_shutup(codec); | ||
3648 | if (spec && spec->power_hook) | 3759 | if (spec && spec->power_hook) |
3649 | spec->power_hook(codec, 0); | 3760 | spec->power_hook(codec); |
3650 | return 0; | 3761 | return 0; |
3651 | } | 3762 | } |
3652 | #endif | 3763 | #endif |
@@ -3654,16 +3765,9 @@ static int alc_suspend(struct hda_codec *codec, pm_message_t state) | |||
3654 | #ifdef SND_HDA_NEEDS_RESUME | 3765 | #ifdef SND_HDA_NEEDS_RESUME |
3655 | static int alc_resume(struct hda_codec *codec) | 3766 | static int alc_resume(struct hda_codec *codec) |
3656 | { | 3767 | { |
3657 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
3658 | struct alc_spec *spec = codec->spec; | ||
3659 | #endif | ||
3660 | codec->patch_ops.init(codec); | 3768 | codec->patch_ops.init(codec); |
3661 | snd_hda_codec_resume_amp(codec); | 3769 | snd_hda_codec_resume_amp(codec); |
3662 | snd_hda_codec_resume_cache(codec); | 3770 | snd_hda_codec_resume_cache(codec); |
3663 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
3664 | if (spec && spec->power_hook) | ||
3665 | spec->power_hook(codec, 1); | ||
3666 | #endif | ||
3667 | return 0; | 3771 | return 0; |
3668 | } | 3772 | } |
3669 | #endif | 3773 | #endif |
@@ -3683,6 +3787,7 @@ static struct hda_codec_ops alc_patch_ops = { | |||
3683 | .suspend = alc_suspend, | 3787 | .suspend = alc_suspend, |
3684 | .check_power_status = alc_check_power_status, | 3788 | .check_power_status = alc_check_power_status, |
3685 | #endif | 3789 | #endif |
3790 | .reboot_notify = alc_shutup, | ||
3686 | }; | 3791 | }; |
3687 | 3792 | ||
3688 | 3793 | ||
@@ -3839,6 +3944,7 @@ static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol, | |||
3839 | #define PIN_CTL_TEST(xname,nid) { \ | 3944 | #define PIN_CTL_TEST(xname,nid) { \ |
3840 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3945 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3841 | .name = xname, \ | 3946 | .name = xname, \ |
3947 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
3842 | .info = alc_test_pin_ctl_info, \ | 3948 | .info = alc_test_pin_ctl_info, \ |
3843 | .get = alc_test_pin_ctl_get, \ | 3949 | .get = alc_test_pin_ctl_get, \ |
3844 | .put = alc_test_pin_ctl_put, \ | 3950 | .put = alc_test_pin_ctl_put, \ |
@@ -3848,6 +3954,7 @@ static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol, | |||
3848 | #define PIN_SRC_TEST(xname,nid) { \ | 3954 | #define PIN_SRC_TEST(xname,nid) { \ |
3849 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3955 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3850 | .name = xname, \ | 3956 | .name = xname, \ |
3957 | .subdevice = HDA_SUBDEV_NID_FLAG | nid, \ | ||
3851 | .info = alc_test_pin_src_info, \ | 3958 | .info = alc_test_pin_src_info, \ |
3852 | .get = alc_test_pin_src_get, \ | 3959 | .get = alc_test_pin_src_get, \ |
3853 | .put = alc_test_pin_src_put, \ | 3960 | .put = alc_test_pin_src_put, \ |
@@ -4387,7 +4494,7 @@ static int add_control(struct alc_spec *spec, int type, const char *name, | |||
4387 | if (!knew->name) | 4494 | if (!knew->name) |
4388 | return -ENOMEM; | 4495 | return -ENOMEM; |
4389 | if (get_amp_nid_(val)) | 4496 | if (get_amp_nid_(val)) |
4390 | knew->subdevice = HDA_SUBDEV_NID_FLAG | get_amp_nid_(val); | 4497 | knew->subdevice = HDA_SUBDEV_AMP_FLAG; |
4391 | knew->private_value = val; | 4498 | knew->private_value = val; |
4392 | return 0; | 4499 | return 0; |
4393 | } | 4500 | } |
@@ -5182,6 +5289,7 @@ static struct snd_kcontrol_new alc260_hp_output_mixer[] = { | |||
5182 | { | 5289 | { |
5183 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 5290 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
5184 | .name = "Master Playback Switch", | 5291 | .name = "Master Playback Switch", |
5292 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x11, | ||
5185 | .info = snd_ctl_boolean_mono_info, | 5293 | .info = snd_ctl_boolean_mono_info, |
5186 | .get = alc260_hp_master_sw_get, | 5294 | .get = alc260_hp_master_sw_get, |
5187 | .put = alc260_hp_master_sw_put, | 5295 | .put = alc260_hp_master_sw_put, |
@@ -5220,6 +5328,7 @@ static struct snd_kcontrol_new alc260_hp_3013_mixer[] = { | |||
5220 | { | 5328 | { |
5221 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 5329 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
5222 | .name = "Master Playback Switch", | 5330 | .name = "Master Playback Switch", |
5331 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x11, | ||
5223 | .info = snd_ctl_boolean_mono_info, | 5332 | .info = snd_ctl_boolean_mono_info, |
5224 | .get = alc260_hp_master_sw_get, | 5333 | .get = alc260_hp_master_sw_get, |
5225 | .put = alc260_hp_master_sw_put, | 5334 | .put = alc260_hp_master_sw_put, |
@@ -9528,7 +9637,7 @@ static struct alc_config_preset alc882_presets[] = { | |||
9528 | .setup = alc889_acer_aspire_8930g_setup, | 9637 | .setup = alc889_acer_aspire_8930g_setup, |
9529 | .init_hook = alc_automute_amp, | 9638 | .init_hook = alc_automute_amp, |
9530 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 9639 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
9531 | .power_hook = alc889_power_eapd, | 9640 | .power_hook = alc_power_eapd, |
9532 | #endif | 9641 | #endif |
9533 | }, | 9642 | }, |
9534 | [ALC888_ACER_ASPIRE_7730G] = { | 9643 | [ALC888_ACER_ASPIRE_7730G] = { |
@@ -10324,8 +10433,14 @@ static int alc262_hp_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10324 | .info = snd_ctl_boolean_mono_info, \ | 10433 | .info = snd_ctl_boolean_mono_info, \ |
10325 | .get = alc262_hp_master_sw_get, \ | 10434 | .get = alc262_hp_master_sw_get, \ |
10326 | .put = alc262_hp_master_sw_put, \ | 10435 | .put = alc262_hp_master_sw_put, \ |
10436 | }, \ | ||
10437 | { \ | ||
10438 | .iface = NID_MAPPING, \ | ||
10439 | .name = "Master Playback Switch", \ | ||
10440 | .private_value = 0x15 | (0x16 << 8) | (0x1b << 16), \ | ||
10327 | } | 10441 | } |
10328 | 10442 | ||
10443 | |||
10329 | static struct snd_kcontrol_new alc262_HP_BPC_mixer[] = { | 10444 | static struct snd_kcontrol_new alc262_HP_BPC_mixer[] = { |
10330 | ALC262_HP_MASTER_SWITCH, | 10445 | ALC262_HP_MASTER_SWITCH, |
10331 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | 10446 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), |
@@ -10483,6 +10598,12 @@ static int alc262_hippo_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10483 | .info = snd_ctl_boolean_mono_info, \ | 10598 | .info = snd_ctl_boolean_mono_info, \ |
10484 | .get = alc262_hippo_master_sw_get, \ | 10599 | .get = alc262_hippo_master_sw_get, \ |
10485 | .put = alc262_hippo_master_sw_put, \ | 10600 | .put = alc262_hippo_master_sw_put, \ |
10601 | }, \ | ||
10602 | { \ | ||
10603 | .iface = NID_MAPPING, \ | ||
10604 | .name = "Master Playback Switch", \ | ||
10605 | .subdevice = SUBDEV_HP(0) | (SUBDEV_LINE(0) << 8) | \ | ||
10606 | (SUBDEV_SPEAKER(0) << 16), \ | ||
10486 | } | 10607 | } |
10487 | 10608 | ||
10488 | static struct snd_kcontrol_new alc262_hippo_mixer[] = { | 10609 | static struct snd_kcontrol_new alc262_hippo_mixer[] = { |
@@ -10963,11 +11084,17 @@ static struct snd_kcontrol_new alc262_fujitsu_mixer[] = { | |||
10963 | { | 11084 | { |
10964 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 11085 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
10965 | .name = "Master Playback Switch", | 11086 | .name = "Master Playback Switch", |
11087 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
10966 | .info = snd_hda_mixer_amp_switch_info, | 11088 | .info = snd_hda_mixer_amp_switch_info, |
10967 | .get = snd_hda_mixer_amp_switch_get, | 11089 | .get = snd_hda_mixer_amp_switch_get, |
10968 | .put = alc262_fujitsu_master_sw_put, | 11090 | .put = alc262_fujitsu_master_sw_put, |
10969 | .private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), | 11091 | .private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), |
10970 | }, | 11092 | }, |
11093 | { | ||
11094 | .iface = NID_MAPPING, | ||
11095 | .name = "Master Playback Switch", | ||
11096 | .private_value = 0x1b, | ||
11097 | }, | ||
10971 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), | 11098 | HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), |
10972 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), | 11099 | HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), |
10973 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), | 11100 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), |
@@ -10998,6 +11125,7 @@ static struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = { | |||
10998 | { | 11125 | { |
10999 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 11126 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
11000 | .name = "Master Playback Switch", | 11127 | .name = "Master Playback Switch", |
11128 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
11001 | .info = snd_hda_mixer_amp_switch_info, | 11129 | .info = snd_hda_mixer_amp_switch_info, |
11002 | .get = snd_hda_mixer_amp_switch_get, | 11130 | .get = snd_hda_mixer_amp_switch_get, |
11003 | .put = alc262_lenovo_3000_master_sw_put, | 11131 | .put = alc262_lenovo_3000_master_sw_put, |
@@ -11152,6 +11280,11 @@ static struct snd_kcontrol_new alc262_ultra_capture_mixer[] = { | |||
11152 | .get = alc_mux_enum_get, | 11280 | .get = alc_mux_enum_get, |
11153 | .put = alc262_ultra_mux_enum_put, | 11281 | .put = alc262_ultra_mux_enum_put, |
11154 | }, | 11282 | }, |
11283 | { | ||
11284 | .iface = NID_MAPPING, | ||
11285 | .name = "Capture Source", | ||
11286 | .private_value = 0x15, | ||
11287 | }, | ||
11155 | { } /* end */ | 11288 | { } /* end */ |
11156 | }; | 11289 | }; |
11157 | 11290 | ||
@@ -12170,6 +12303,7 @@ static struct snd_kcontrol_new alc268_acer_aspire_one_mixer[] = { | |||
12170 | { | 12303 | { |
12171 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12304 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12172 | .name = "Master Playback Switch", | 12305 | .name = "Master Playback Switch", |
12306 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
12173 | .info = snd_hda_mixer_amp_switch_info, | 12307 | .info = snd_hda_mixer_amp_switch_info, |
12174 | .get = snd_hda_mixer_amp_switch_get, | 12308 | .get = snd_hda_mixer_amp_switch_get, |
12175 | .put = alc268_acer_master_sw_put, | 12309 | .put = alc268_acer_master_sw_put, |
@@ -12185,6 +12319,7 @@ static struct snd_kcontrol_new alc268_acer_mixer[] = { | |||
12185 | { | 12319 | { |
12186 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12320 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12187 | .name = "Master Playback Switch", | 12321 | .name = "Master Playback Switch", |
12322 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
12188 | .info = snd_hda_mixer_amp_switch_info, | 12323 | .info = snd_hda_mixer_amp_switch_info, |
12189 | .get = snd_hda_mixer_amp_switch_get, | 12324 | .get = snd_hda_mixer_amp_switch_get, |
12190 | .put = alc268_acer_master_sw_put, | 12325 | .put = alc268_acer_master_sw_put, |
@@ -12202,6 +12337,7 @@ static struct snd_kcontrol_new alc268_acer_dmic_mixer[] = { | |||
12202 | { | 12337 | { |
12203 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 12338 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
12204 | .name = "Master Playback Switch", | 12339 | .name = "Master Playback Switch", |
12340 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
12205 | .info = snd_hda_mixer_amp_switch_info, | 12341 | .info = snd_hda_mixer_amp_switch_info, |
12206 | .get = snd_hda_mixer_amp_switch_get, | 12342 | .get = snd_hda_mixer_amp_switch_get, |
12207 | .put = alc268_acer_master_sw_put, | 12343 | .put = alc268_acer_master_sw_put, |
@@ -13155,6 +13291,7 @@ static struct snd_kcontrol_new alc269_quanta_fl1_mixer[] = { | |||
13155 | { | 13291 | { |
13156 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 13292 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
13157 | .name = "Master Playback Switch", | 13293 | .name = "Master Playback Switch", |
13294 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
13158 | .info = snd_hda_mixer_amp_switch_info, | 13295 | .info = snd_hda_mixer_amp_switch_info, |
13159 | .get = snd_hda_mixer_amp_switch_get, | 13296 | .get = snd_hda_mixer_amp_switch_get, |
13160 | .put = alc268_acer_master_sw_put, | 13297 | .put = alc268_acer_master_sw_put, |
@@ -13175,6 +13312,7 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = { | |||
13175 | { | 13312 | { |
13176 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 13313 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
13177 | .name = "Master Playback Switch", | 13314 | .name = "Master Playback Switch", |
13315 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
13178 | .info = snd_hda_mixer_amp_switch_info, | 13316 | .info = snd_hda_mixer_amp_switch_info, |
13179 | .get = snd_hda_mixer_amp_switch_get, | 13317 | .get = snd_hda_mixer_amp_switch_get, |
13180 | .put = alc268_acer_master_sw_put, | 13318 | .put = alc268_acer_master_sw_put, |
@@ -14939,9 +15077,13 @@ static int patch_alc861(struct hda_codec *codec) | |||
14939 | spec->vmaster_nid = 0x03; | 15077 | spec->vmaster_nid = 0x03; |
14940 | 15078 | ||
14941 | codec->patch_ops = alc_patch_ops; | 15079 | codec->patch_ops = alc_patch_ops; |
14942 | if (board_config == ALC861_AUTO) | 15080 | if (board_config == ALC861_AUTO) { |
14943 | spec->init_hook = alc861_auto_init; | 15081 | spec->init_hook = alc861_auto_init; |
14944 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 15082 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
15083 | spec->power_hook = alc_power_eapd; | ||
15084 | #endif | ||
15085 | } | ||
15086 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
14945 | if (!spec->loopback.amplist) | 15087 | if (!spec->loopback.amplist) |
14946 | spec->loopback.amplist = alc861_loopbacks; | 15088 | spec->loopback.amplist = alc861_loopbacks; |
14947 | #endif | 15089 | #endif |