diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-16 03:44:56 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:11 -0400 |
commit | b40b04ad380ad641e5740486e4b9a56fd32b64cc (patch) | |
tree | 5b9551466af6950f4fd5b961f02ecd1083011a30 | |
parent | c5059259688ab76f14f2f69a93e13575a36b614b (diff) |
[ALSA] hda-codec - Add model=mobile for AD1884A & co
Added the new model mobile for AD1884A and compatible codecs.
It's a reduced version of model=laptop.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 48 |
2 files changed, 48 insertions, 1 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index bfc6d486ad9..2cfb8b469c5 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -915,6 +915,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
915 | AD1884A / AD1883 / AD1984A / AD1984B | 915 | AD1884A / AD1883 / AD1984A / AD1984B |
916 | desktop 3-stack desktop (default) | 916 | desktop 3-stack desktop (default) |
917 | laptop laptop with HP jack sensing | 917 | laptop laptop with HP jack sensing |
918 | mobile mobile devices with HP jack sensing | ||
918 | 919 | ||
919 | AD1884 | 920 | AD1884 |
920 | N/A | 921 | N/A |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index b037fca1b44..3f3905cc4e0 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3623,6 +3623,36 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { | |||
3623 | { } /* end */ | 3623 | { } /* end */ |
3624 | }; | 3624 | }; |
3625 | 3625 | ||
3626 | static struct hda_input_mux ad1884a_mobile_capture_source = { | ||
3627 | .num_items = 2, | ||
3628 | .items = { | ||
3629 | { "Mic", 0x1 }, /* port-C */ | ||
3630 | { "Mix", 0x3 }, | ||
3631 | }, | ||
3632 | }; | ||
3633 | |||
3634 | static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { | ||
3635 | HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), | ||
3636 | HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), | ||
3637 | HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), | ||
3638 | HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), | ||
3639 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), | ||
3640 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), | ||
3641 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT), | ||
3642 | HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT), | ||
3643 | HDA_CODEC_VOLUME("Mic Boost", 0x15, 0x0, HDA_INPUT), | ||
3644 | HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
3645 | HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), | ||
3646 | { | ||
3647 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
3648 | .name = "Capture Source", | ||
3649 | .info = ad198x_mux_enum_info, | ||
3650 | .get = ad198x_mux_enum_get, | ||
3651 | .put = ad198x_mux_enum_put, | ||
3652 | }, | ||
3653 | { } /* end */ | ||
3654 | }; | ||
3655 | |||
3626 | /* mute internal speaker if HP is plugged */ | 3656 | /* mute internal speaker if HP is plugged */ |
3627 | static void ad1884a_hp_automute(struct hda_codec *codec) | 3657 | static void ad1884a_hp_automute(struct hda_codec *codec) |
3628 | { | 3658 | { |
@@ -3677,12 +3707,19 @@ static struct hda_verb ad1884a_laptop_verbs[] = { | |||
3677 | enum { | 3707 | enum { |
3678 | AD1884A_DESKTOP, | 3708 | AD1884A_DESKTOP, |
3679 | AD1884A_LAPTOP, | 3709 | AD1884A_LAPTOP, |
3710 | AD1884A_MOBILE, | ||
3680 | AD1884A_MODELS | 3711 | AD1884A_MODELS |
3681 | }; | 3712 | }; |
3682 | 3713 | ||
3683 | static const char *ad1884a_models[AD1884A_MODELS] = { | 3714 | static const char *ad1884a_models[AD1884A_MODELS] = { |
3684 | [AD1884A_DESKTOP] = "desktop", | 3715 | [AD1884A_DESKTOP] = "desktop", |
3685 | [AD1884A_LAPTOP] = "laptop", | 3716 | [AD1884A_LAPTOP] = "laptop", |
3717 | [AD1884A_MOBILE] = "mobile", | ||
3718 | }; | ||
3719 | |||
3720 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { | ||
3721 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), | ||
3722 | {} | ||
3686 | }; | 3723 | }; |
3687 | 3724 | ||
3688 | static int patch_ad1884a(struct hda_codec *codec) | 3725 | static int patch_ad1884a(struct hda_codec *codec) |
@@ -3717,7 +3754,8 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
3717 | 3754 | ||
3718 | /* override some parameters */ | 3755 | /* override some parameters */ |
3719 | board_config = snd_hda_check_board_config(codec, AD1884A_MODELS, | 3756 | board_config = snd_hda_check_board_config(codec, AD1884A_MODELS, |
3720 | ad1884a_models, NULL); | 3757 | ad1884a_models, |
3758 | ad1884a_cfg_tbl); | ||
3721 | switch (board_config) { | 3759 | switch (board_config) { |
3722 | case AD1884A_LAPTOP: | 3760 | case AD1884A_LAPTOP: |
3723 | spec->mixers[0] = ad1884a_laptop_mixers; | 3761 | spec->mixers[0] = ad1884a_laptop_mixers; |
@@ -3727,6 +3765,14 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
3727 | codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; | 3765 | codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; |
3728 | codec->patch_ops.init = ad1884a_hp_init; | 3766 | codec->patch_ops.init = ad1884a_hp_init; |
3729 | break; | 3767 | break; |
3768 | case AD1884A_MOBILE: | ||
3769 | spec->mixers[0] = ad1884a_mobile_mixers; | ||
3770 | spec->init_verbs[spec->num_init_verbs++] = ad1884a_laptop_verbs; | ||
3771 | spec->multiout.dig_out_nid = 0; | ||
3772 | spec->input_mux = &ad1884a_mobile_capture_source; | ||
3773 | codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; | ||
3774 | codec->patch_ops.init = ad1884a_hp_init; | ||
3775 | break; | ||
3730 | } | 3776 | } |
3731 | 3777 | ||
3732 | return 0; | 3778 | return 0; |