diff options
author | Matthew Ranostay <mranostay@embeddedalley.com> | 2007-12-17 05:58:13 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:36 -0500 |
commit | 8e9068b1c7a154246f4cee93fd68c862b81b04e1 (patch) | |
tree | f9b28670fa4b0524f2b81b5cbcd21e19adaad26e /sound/pci | |
parent | 38fcaf8efcac6f89dd3dafa3df17f49fcf3403ba (diff) |
[ALSA] hda: STAC927x DMIC Cleanup
Cleaned up STAC927x and added several subsystem id's for more laptops.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
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.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 8598951005d8..1e2d3bfe4a62 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -107,6 +107,7 @@ enum { | |||
107 | STAC_D965_3ST, | 107 | STAC_D965_3ST, |
108 | STAC_D965_5ST, | 108 | STAC_D965_5ST, |
109 | STAC_DELL_3ST, | 109 | STAC_DELL_3ST, |
110 | STAC_DELL_BIOS, | ||
110 | STAC_927X_MODELS | 111 | STAC_927X_MODELS |
111 | }; | 112 | }; |
112 | 113 | ||
@@ -1408,22 +1409,24 @@ static unsigned int d965_5st_pin_configs[14] = { | |||
1408 | static unsigned int dell_3st_pin_configs[14] = { | 1409 | static unsigned int dell_3st_pin_configs[14] = { |
1409 | 0x02211230, 0x02a11220, 0x01a19040, 0x01114210, | 1410 | 0x02211230, 0x02a11220, 0x01a19040, 0x01114210, |
1410 | 0x01111212, 0x01116211, 0x01813050, 0x01112214, | 1411 | 0x01111212, 0x01116211, 0x01813050, 0x01112214, |
1411 | 0x403003fa, 0x40000100, 0x40000100, 0x404003fb, | 1412 | 0x403003fa, 0x90a60040, 0x90a60040, 0x404003fb, |
1412 | 0x40c003fc, 0x40000100 | 1413 | 0x40c003fc, 0x40000100 |
1413 | }; | 1414 | }; |
1414 | 1415 | ||
1415 | static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { | 1416 | static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { |
1416 | [STAC_D965_REF] = ref927x_pin_configs, | 1417 | [STAC_D965_REF] = ref927x_pin_configs, |
1417 | [STAC_D965_3ST] = d965_3st_pin_configs, | 1418 | [STAC_D965_3ST] = d965_3st_pin_configs, |
1418 | [STAC_D965_5ST] = d965_5st_pin_configs, | 1419 | [STAC_D965_5ST] = d965_5st_pin_configs, |
1419 | [STAC_DELL_3ST] = dell_3st_pin_configs, | 1420 | [STAC_DELL_3ST] = dell_3st_pin_configs, |
1421 | [STAC_DELL_BIOS] = NULL, | ||
1420 | }; | 1422 | }; |
1421 | 1423 | ||
1422 | static const char *stac927x_models[STAC_927X_MODELS] = { | 1424 | static const char *stac927x_models[STAC_927X_MODELS] = { |
1423 | [STAC_D965_REF] = "ref", | 1425 | [STAC_D965_REF] = "ref", |
1424 | [STAC_D965_3ST] = "3stack", | 1426 | [STAC_D965_3ST] = "3stack", |
1425 | [STAC_D965_5ST] = "5stack", | 1427 | [STAC_D965_5ST] = "5stack", |
1426 | [STAC_DELL_3ST] = "dell-3stack", | 1428 | [STAC_DELL_3ST] = "dell-3stack", |
1429 | [STAC_DELL_BIOS] = "dell-bios", | ||
1427 | }; | 1430 | }; |
1428 | 1431 | ||
1429 | static struct snd_pci_quirk stac927x_cfg_tbl[] = { | 1432 | static struct snd_pci_quirk stac927x_cfg_tbl[] = { |
@@ -1450,13 +1453,21 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = { | |||
1450 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST), | 1453 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST), |
1451 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST), | 1454 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST), |
1452 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST), | 1455 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST), |
1453 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_D965_3ST), | ||
1454 | /* Dell 3 stack systems */ | 1456 | /* Dell 3 stack systems */ |
1457 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_3ST), | ||
1458 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_3ST), | ||
1455 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST), | 1459 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST), |
1456 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST), | 1460 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST), |
1457 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST), | 1461 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST), |
1462 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_3ST), | ||
1463 | /* Dell 3 stack systems with verb table in BIOS */ | ||
1464 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell ", STAC_DELL_BIOS), | ||
1465 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), | ||
1466 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), | ||
1467 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), | ||
1468 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), | ||
1469 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS), | ||
1458 | /* 965 based 5 stack systems */ | 1470 | /* 965 based 5 stack systems */ |
1459 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_D965_5ST), | ||
1460 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST), | 1471 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST), |
1461 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST), | 1472 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST), |
1462 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST), | 1473 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST), |
@@ -1992,6 +2003,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf | |||
1992 | for (i = 0; i < codec->num_nodes; i++) { | 2003 | for (i = 0; i < codec->num_nodes; i++) { |
1993 | wcaps = codec->wcaps[i]; | 2004 | wcaps = codec->wcaps[i]; |
1994 | wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | 2005 | wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; |
2006 | |||
1995 | if (wtype == AC_WID_AUD_OUT && !(wcaps & AC_WCAP_DIGITAL)) | 2007 | if (wtype == AC_WID_AUD_OUT && !(wcaps & AC_WCAP_DIGITAL)) |
1996 | num_dacs++; | 2008 | num_dacs++; |
1997 | } | 2009 | } |
@@ -2079,7 +2091,6 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, | |||
2079 | wcaps = snd_hda_param_read(codec, conn[j], | 2091 | wcaps = snd_hda_param_read(codec, conn[j], |
2080 | AC_PAR_AUDIO_WIDGET_CAP); | 2092 | AC_PAR_AUDIO_WIDGET_CAP); |
2081 | wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | 2093 | wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; |
2082 | |||
2083 | if (wtype != AC_WID_AUD_OUT || | 2094 | if (wtype != AC_WID_AUD_OUT || |
2084 | (wcaps & AC_WCAP_DIGITAL)) | 2095 | (wcaps & AC_WCAP_DIGITAL)) |
2085 | continue; | 2096 | continue; |
@@ -3293,72 +3304,61 @@ static int patch_stac927x(struct hda_codec *codec) | |||
3293 | stac927x_models, | 3304 | stac927x_models, |
3294 | stac927x_cfg_tbl); | 3305 | stac927x_cfg_tbl); |
3295 | again: | 3306 | again: |
3296 | if (spec->board_config < 0) { | 3307 | if (spec->board_config < 0 || !stac927x_brd_tbl[spec->board_config]) { |
3297 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); | 3308 | if (spec->board_config < 0) |
3309 | snd_printdd(KERN_INFO "hda_codec: Unknown model for" | ||
3310 | "STAC927x, using BIOS defaults\n"); | ||
3298 | err = stac92xx_save_bios_config_regs(codec); | 3311 | err = stac92xx_save_bios_config_regs(codec); |
3299 | if (err < 0) { | 3312 | if (err < 0) { |
3300 | stac92xx_free(codec); | 3313 | stac92xx_free(codec); |
3301 | return err; | 3314 | return err; |
3302 | } | 3315 | } |
3303 | spec->pin_configs = spec->bios_pin_configs; | 3316 | spec->pin_configs = spec->bios_pin_configs; |
3304 | } else if (stac927x_brd_tbl[spec->board_config] != NULL) { | 3317 | } else { |
3305 | spec->pin_configs = stac927x_brd_tbl[spec->board_config]; | 3318 | spec->pin_configs = stac927x_brd_tbl[spec->board_config]; |
3306 | stac92xx_set_config_regs(codec); | 3319 | stac92xx_set_config_regs(codec); |
3307 | } | 3320 | } |
3308 | 3321 | ||
3322 | spec->adc_nids = stac927x_adc_nids; | ||
3323 | spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids); | ||
3324 | spec->mux_nids = stac927x_mux_nids; | ||
3325 | spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids); | ||
3326 | spec->multiout.dac_nids = spec->dac_nids; | ||
3327 | |||
3309 | switch (spec->board_config) { | 3328 | switch (spec->board_config) { |
3310 | case STAC_D965_3ST: | 3329 | case STAC_D965_3ST: |
3311 | spec->adc_nids = stac927x_adc_nids; | ||
3312 | spec->mux_nids = stac927x_mux_nids; | ||
3313 | spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids); | ||
3314 | spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids); | ||
3315 | spec->init = d965_core_init; | ||
3316 | spec->mixer = stac927x_mixer; | ||
3317 | break; | ||
3318 | case STAC_D965_5ST: | 3330 | case STAC_D965_5ST: |
3319 | spec->adc_nids = stac927x_adc_nids; | 3331 | /* GPIO0 High = Enable EAPD */ |
3320 | spec->mux_nids = stac927x_mux_nids; | 3332 | spec->gpio_mask = spec->gpio_data = 0x00000001; |
3321 | spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids); | 3333 | spec->num_dmics = 0; |
3322 | spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids); | 3334 | |
3323 | spec->init = d965_core_init; | 3335 | spec->init = d965_core_init; |
3324 | spec->mixer = stac927x_mixer; | 3336 | spec->mixer = stac927x_mixer; |
3325 | break; | 3337 | break; |
3326 | default: | 3338 | case STAC_DELL_BIOS: |
3327 | spec->adc_nids = stac927x_adc_nids; | 3339 | case STAC_DELL_3ST: |
3328 | spec->mux_nids = stac927x_mux_nids; | 3340 | /* GPIO2 High = Enable EAPD */ |
3329 | spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids); | 3341 | spec->gpio_mask = spec->gpio_data = 0x00000004; |
3330 | spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids); | ||
3331 | spec->init = stac927x_core_init; | ||
3332 | spec->mixer = stac927x_mixer; | ||
3333 | } | ||
3334 | |||
3335 | switch (codec->subsystem_id) { | ||
3336 | case 0x10280242: /* STAC 9228 */ | ||
3337 | case 0x102801f3: | ||
3338 | case 0x1028020A: | ||
3339 | case 0x10280209: | ||
3340 | spec->dmic_nids = stac927x_dmic_nids; | 3342 | spec->dmic_nids = stac927x_dmic_nids; |
3341 | spec->num_dmics = STAC927X_NUM_DMICS; | 3343 | spec->num_dmics = STAC927X_NUM_DMICS; |
3342 | spec->dmux_nids = stac927x_dmux_nids; | ||
3343 | 3344 | ||
3344 | /* Enable DMIC0 */ | 3345 | spec->init = d965_core_init; |
3345 | stac92xx_set_config_reg(codec, 0x13, 0x90a60040); | 3346 | spec->mixer = stac927x_mixer; |
3346 | 3347 | spec->dmux_nids = stac927x_dmux_nids; | |
3347 | /* GPIO2 High = Enable EAPD */ | ||
3348 | spec->gpio_mask = spec->gpio_data = 0x00000004; | ||
3349 | break; | 3348 | break; |
3350 | default: | 3349 | default: |
3351 | spec->num_dmics = 0; | ||
3352 | |||
3353 | /* GPIO0 High = Enable EAPD */ | 3350 | /* GPIO0 High = Enable EAPD */ |
3354 | spec->gpio_mask = spec->gpio_data = 0x00000001; | 3351 | spec->gpio_mask = spec->gpio_data = 0x00000001; |
3352 | spec->num_dmics = 0; | ||
3353 | |||
3354 | spec->init = stac927x_core_init; | ||
3355 | spec->mixer = stac927x_mixer; | ||
3355 | } | 3356 | } |
3356 | 3357 | ||
3357 | spec->multiout.dac_nids = spec->dac_nids; | ||
3358 | spec->aloopback_mask = 0x40; | 3358 | spec->aloopback_mask = 0x40; |
3359 | spec->aloopback_shift = 0; | 3359 | spec->aloopback_shift = 0; |
3360 | |||
3360 | stac92xx_enable_gpio_mask(codec); | 3361 | stac92xx_enable_gpio_mask(codec); |
3361 | |||
3362 | err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); | 3362 | err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); |
3363 | if (!err) { | 3363 | if (!err) { |
3364 | if (spec->board_config < 0) { | 3364 | if (spec->board_config < 0) { |