aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2011-01-21 07:33:28 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-22 11:29:22 -0500
commita1d6906e2d2b4655e248f490ab088c27876a600a (patch)
tree950b6804e8d41978a4d02a5d8607c51c7d7e067a /sound/pci
parent02b6b5b640e773eb4d4d0685fa6c1fbc660b2834 (diff)
ALSA: HDA: Add a new model "asus" for Conexant 5066/205xx
BugLink: http://bugs.launchpad.net/bugs/701271 This new model, named "asus", is identical to the "hp_laptop" model, except for the location of the internal mic, which is at pin 0x1a. It is used for Asus K52JU and Lenovo G560. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_conexant.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7cd59b9f0e97..19f0daf6497d 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -127,6 +127,7 @@ struct conexant_spec {
127 unsigned int ideapad:1; 127 unsigned int ideapad:1;
128 unsigned int thinkpad:1; 128 unsigned int thinkpad:1;
129 unsigned int hp_laptop:1; 129 unsigned int hp_laptop:1;
130 unsigned int asus:1;
130 131
131 unsigned int ext_mic_present; 132 unsigned int ext_mic_present;
132 unsigned int recording; 133 unsigned int recording;
@@ -2312,6 +2313,19 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
2312 } 2313 }
2313} 2314}
2314 2315
2316
2317/* toggle input of built-in digital mic and mic jack appropriately */
2318static void cxt5066_asus_automic(struct hda_codec *codec)
2319{
2320 unsigned int present;
2321
2322 present = snd_hda_jack_detect(codec, 0x1b);
2323 snd_printdd("CXT5066: external microphone present=%d\n", present);
2324 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
2325 present ? 1 : 0);
2326}
2327
2328
2315/* toggle input of built-in digital mic and mic jack appropriately */ 2329/* toggle input of built-in digital mic and mic jack appropriately */
2316static void cxt5066_hp_laptop_automic(struct hda_codec *codec) 2330static void cxt5066_hp_laptop_automic(struct hda_codec *codec)
2317{ 2331{
@@ -2400,6 +2414,8 @@ static void cxt5066_automic(struct hda_codec *codec)
2400 cxt5066_thinkpad_automic(codec); 2414 cxt5066_thinkpad_automic(codec);
2401 else if (spec->hp_laptop) 2415 else if (spec->hp_laptop)
2402 cxt5066_hp_laptop_automic(codec); 2416 cxt5066_hp_laptop_automic(codec);
2417 else if (spec->asus)
2418 cxt5066_asus_automic(codec);
2403} 2419}
2404 2420
2405/* unsolicited event for jack sensing */ 2421/* unsolicited event for jack sensing */
@@ -3045,6 +3061,7 @@ enum {
3045 CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ 3061 CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */
3046 CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ 3062 CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */
3047 CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ 3063 CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */
3064 CXT5066_ASUS, /* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */
3048 CXT5066_HP_LAPTOP, /* HP Laptop */ 3065 CXT5066_HP_LAPTOP, /* HP Laptop */
3049 CXT5066_MODELS 3066 CXT5066_MODELS
3050}; 3067};
@@ -3056,6 +3073,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
3056 [CXT5066_DELL_VOSTRO] = "dell-vostro", 3073 [CXT5066_DELL_VOSTRO] = "dell-vostro",
3057 [CXT5066_IDEAPAD] = "ideapad", 3074 [CXT5066_IDEAPAD] = "ideapad",
3058 [CXT5066_THINKPAD] = "thinkpad", 3075 [CXT5066_THINKPAD] = "thinkpad",
3076 [CXT5066_ASUS] = "asus",
3059 [CXT5066_HP_LAPTOP] = "hp-laptop", 3077 [CXT5066_HP_LAPTOP] = "hp-laptop",
3060}; 3078};
3061 3079
@@ -3068,6 +3086,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3068 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3086 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
3069 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 3087 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
3070 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), 3088 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP),
3089 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS),
3071 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), 3090 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD),
3072 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), 3091 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
3073 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), 3092 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
@@ -3077,6 +3096,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3077 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), 3096 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
3078 SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), 3097 SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
3079 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3098 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
3099 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
3080 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ 3100 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
3081 {} 3101 {}
3082}; 3102};
@@ -3132,13 +3152,15 @@ static int patch_cxt5066(struct hda_codec *codec)
3132 spec->num_init_verbs++; 3152 spec->num_init_verbs++;
3133 spec->dell_automute = 1; 3153 spec->dell_automute = 1;
3134 break; 3154 break;
3155 case CXT5066_ASUS:
3135 case CXT5066_HP_LAPTOP: 3156 case CXT5066_HP_LAPTOP:
3136 codec->patch_ops.init = cxt5066_init; 3157 codec->patch_ops.init = cxt5066_init;
3137 codec->patch_ops.unsol_event = cxt5066_unsol_event; 3158 codec->patch_ops.unsol_event = cxt5066_unsol_event;
3138 spec->init_verbs[spec->num_init_verbs] = 3159 spec->init_verbs[spec->num_init_verbs] =
3139 cxt5066_init_verbs_hp_laptop; 3160 cxt5066_init_verbs_hp_laptop;
3140 spec->num_init_verbs++; 3161 spec->num_init_verbs++;
3141 spec->hp_laptop = 1; 3162 spec->hp_laptop = board_config == CXT5066_HP_LAPTOP;
3163 spec->asus = board_config == CXT5066_ASUS;
3142 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 3164 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
3143 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3165 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
3144 /* no S/PDIF out */ 3166 /* no S/PDIF out */