diff options
author | Matthew Ranostay <mranostay@embeddedalley.com> | 2007-11-06 05:53:55 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:16 -0500 |
commit | e035b841015251062316cb60b47d1f11d2703f6d (patch) | |
tree | 2d88e2a3c68e485ddc6eb2987b7d4a54f21724e3 /sound/pci/hda/patch_sigmatel.c | |
parent | 2797f724cdde5b3c630f6422a1cc3a21772728dd (diff) |
[ALSA] hda: Added new IDT codec family
Added initial support for the STAC92HD71BXX family of codecs.
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/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 4dc09ef899bf..f6e00c4ff325 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -62,6 +62,11 @@ enum { | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | enum { | 64 | enum { |
65 | STAC_92HD71BXX_REF, | ||
66 | STAC_92HD71BXX_MODELS | ||
67 | }; | ||
68 | |||
69 | enum { | ||
65 | STAC_925x_REF, | 70 | STAC_925x_REF, |
66 | STAC_M2_2, | 71 | STAC_M2_2, |
67 | STAC_MA6, | 72 | STAC_MA6, |
@@ -171,6 +176,23 @@ static hda_nid_t stac9200_dac_nids[1] = { | |||
171 | 0x02, | 176 | 0x02, |
172 | }; | 177 | }; |
173 | 178 | ||
179 | static hda_nid_t stac92hd71bxx_adc_nids[2] = { | ||
180 | 0x12, 0x13, | ||
181 | }; | ||
182 | |||
183 | static hda_nid_t stac92hd71bxx_mux_nids[2] = { | ||
184 | 0x1a, 0x1b | ||
185 | }; | ||
186 | |||
187 | static hda_nid_t stac92hd71bxx_dac_nids[2] = { | ||
188 | 0x10, /*0x11, */ | ||
189 | }; | ||
190 | |||
191 | #define STAC92HD71BXX_NUM_DMICS 2 | ||
192 | static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = { | ||
193 | 0x18, 0x19, 0 | ||
194 | }; | ||
195 | |||
174 | static hda_nid_t stac925x_adc_nids[1] = { | 196 | static hda_nid_t stac925x_adc_nids[1] = { |
175 | 0x03, | 197 | 0x03, |
176 | }; | 198 | }; |
@@ -237,6 +259,11 @@ static hda_nid_t stac922x_pin_nids[10] = { | |||
237 | 0x0f, 0x10, 0x11, 0x15, 0x1b, | 259 | 0x0f, 0x10, 0x11, 0x15, 0x1b, |
238 | }; | 260 | }; |
239 | 261 | ||
262 | static hda_nid_t stac92hd71bxx_pin_nids[10] = { | ||
263 | 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, | ||
264 | 0x0f, 0x14, 0x18, 0x19, 0x1e, | ||
265 | }; | ||
266 | |||
240 | static hda_nid_t stac927x_pin_nids[14] = { | 267 | static hda_nid_t stac927x_pin_nids[14] = { |
241 | 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, | 268 | 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, |
242 | 0x0f, 0x10, 0x11, 0x12, 0x13, | 269 | 0x0f, 0x10, 0x11, 0x12, 0x13, |
@@ -359,6 +386,20 @@ static struct hda_verb stac9200_eapd_init[] = { | |||
359 | {} | 386 | {} |
360 | }; | 387 | }; |
361 | 388 | ||
389 | static struct hda_verb stac92hd71bxx_core_init[] = { | ||
390 | /* set master volume and direct control */ | ||
391 | { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, | ||
392 | /* connect headphone jack to dac1 */ | ||
393 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
394 | /* unmute right and left channels for nodes 0x0a, 0xd, 0x0f */ | ||
395 | { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
396 | { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
397 | { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
398 | /* unmute mono out node */ | ||
399 | { 0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
400 | {} | ||
401 | }; | ||
402 | |||
362 | static struct hda_verb stac925x_core_init[] = { | 403 | static struct hda_verb stac925x_core_init[] = { |
363 | /* set dac0mux for dac converter */ | 404 | /* set dac0mux for dac converter */ |
364 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, | 405 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, |
@@ -434,6 +475,21 @@ static struct snd_kcontrol_new stac9200_mixer[] = { | |||
434 | { } /* end */ | 475 | { } /* end */ |
435 | }; | 476 | }; |
436 | 477 | ||
478 | static struct snd_kcontrol_new stac92hd71bxx_mixer[] = { | ||
479 | STAC_DIGITAL_INPUT_SOURCE(1), | ||
480 | STAC_INPUT_SOURCE(2), | ||
481 | STAC_VOLKNOB(0x28), | ||
482 | |||
483 | /* hardware gain controls */ | ||
484 | HDA_CODEC_VOLUME("Digital Mic 1 Volume", 0x18, 0, HDA_OUTPUT), | ||
485 | HDA_CODEC_VOLUME("Digital Mic 2 Volume", 0x19, 0, HDA_OUTPUT), | ||
486 | |||
487 | HDA_CODEC_VOLUME("Capture Volume", 0x1c, 0, HDA_OUTPUT), | ||
488 | HDA_CODEC_MUTE("Capture Switch", 0x1c, 0, HDA_OUTPUT), | ||
489 | HDA_CODEC_VOLUME("Capture Mux Volume", 0x1a, 0, HDA_OUTPUT), | ||
490 | { } /* end */ | ||
491 | }; | ||
492 | |||
437 | static struct snd_kcontrol_new stac925x_mixer[] = { | 493 | static struct snd_kcontrol_new stac925x_mixer[] = { |
438 | STAC_INPUT_SOURCE(1), | 494 | STAC_INPUT_SOURCE(1), |
439 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), | 495 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), |
@@ -786,6 +842,27 @@ static struct snd_pci_quirk stac925x_cfg_tbl[] = { | |||
786 | {} /* terminator */ | 842 | {} /* terminator */ |
787 | }; | 843 | }; |
788 | 844 | ||
845 | static unsigned int ref92hd71bxx_pin_configs[10] = { | ||
846 | 0x02214030, 0x02a19040, 0x01a19020, 0x01014010, | ||
847 | 0x0181302e, 0x01114010, 0x01a19020, 0x90a000f0, | ||
848 | 0x90a000f0, 0x01452050, | ||
849 | }; | ||
850 | |||
851 | static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { | ||
852 | [STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs, | ||
853 | }; | ||
854 | |||
855 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | ||
856 | [STAC_92HD71BXX_REF] = "ref", | ||
857 | }; | ||
858 | |||
859 | static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | ||
860 | /* SigmaTel reference board */ | ||
861 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, | ||
862 | "DFI LanParty", STAC_92HD71BXX_REF), | ||
863 | {} /* terminator */ | ||
864 | }; | ||
865 | |||
789 | static unsigned int ref922x_pin_configs[10] = { | 866 | static unsigned int ref922x_pin_configs[10] = { |
790 | 0x01014010, 0x01016011, 0x01012012, 0x0221401f, | 867 | 0x01014010, 0x01016011, 0x01012012, 0x0221401f, |
791 | 0x01813122, 0x01011014, 0x01441030, 0x01c41030, | 868 | 0x01813122, 0x01011014, 0x01441030, 0x01c41030, |
@@ -2560,6 +2637,77 @@ static int patch_stac925x(struct hda_codec *codec) | |||
2560 | return 0; | 2637 | return 0; |
2561 | } | 2638 | } |
2562 | 2639 | ||
2640 | static int patch_stac92hd71bxx(struct hda_codec *codec) | ||
2641 | { | ||
2642 | struct sigmatel_spec *spec; | ||
2643 | int err = 0; | ||
2644 | |||
2645 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | ||
2646 | if (spec == NULL) | ||
2647 | return -ENOMEM; | ||
2648 | |||
2649 | codec->spec = spec; | ||
2650 | spec->num_pins = ARRAY_SIZE(stac92hd71bxx_pin_nids); | ||
2651 | spec->pin_nids = stac92hd71bxx_pin_nids; | ||
2652 | spec->board_config = snd_hda_check_board_config(codec, | ||
2653 | STAC_92HD71BXX_MODELS, | ||
2654 | stac92hd71bxx_models, | ||
2655 | stac92hd71bxx_cfg_tbl); | ||
2656 | again: | ||
2657 | if (spec->board_config < 0) { | ||
2658 | snd_printdd(KERN_INFO "hda_codec: Unknown model for" | ||
2659 | " STAC92HD71BXX, using BIOS defaults\n"); | ||
2660 | err = stac92xx_save_bios_config_regs(codec); | ||
2661 | if (err < 0) { | ||
2662 | stac92xx_free(codec); | ||
2663 | return err; | ||
2664 | } | ||
2665 | spec->pin_configs = spec->bios_pin_configs; | ||
2666 | } else { | ||
2667 | spec->pin_configs = stac92hd71bxx_brd_tbl[spec->board_config]; | ||
2668 | stac92xx_set_config_regs(codec); | ||
2669 | } | ||
2670 | |||
2671 | spec->gpio_mask = spec->gpio_data = 0x00000001; /* GPIO0 High = EAPD */ | ||
2672 | stac92xx_enable_gpio_mask(codec); | ||
2673 | |||
2674 | spec->init = stac92hd71bxx_core_init; | ||
2675 | spec->mixer = stac92hd71bxx_mixer; | ||
2676 | |||
2677 | spec->mux_nids = stac92hd71bxx_mux_nids; | ||
2678 | spec->adc_nids = stac92hd71bxx_adc_nids; | ||
2679 | spec->dmic_nids = stac92hd71bxx_dmic_nids; | ||
2680 | spec->dmux_nid = 0x1c; | ||
2681 | |||
2682 | spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids); | ||
2683 | spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids); | ||
2684 | spec->num_dmics = STAC92HD71BXX_NUM_DMICS; | ||
2685 | |||
2686 | spec->multiout.num_dacs = 2; | ||
2687 | spec->multiout.hp_nid = 0x11; | ||
2688 | spec->multiout.dac_nids = stac92hd71bxx_dac_nids; | ||
2689 | |||
2690 | err = stac92xx_parse_auto_config(codec, 0x21, 0x23); | ||
2691 | if (!err) { | ||
2692 | if (spec->board_config < 0) { | ||
2693 | printk(KERN_WARNING "hda_codec: No auto-config is " | ||
2694 | "available, default to model=ref\n"); | ||
2695 | spec->board_config = STAC_92HD71BXX_REF; | ||
2696 | goto again; | ||
2697 | } | ||
2698 | err = -EINVAL; | ||
2699 | } | ||
2700 | |||
2701 | if (err < 0) { | ||
2702 | stac92xx_free(codec); | ||
2703 | return err; | ||
2704 | } | ||
2705 | |||
2706 | codec->patch_ops = stac92xx_patch_ops; | ||
2707 | |||
2708 | return 0; | ||
2709 | }; | ||
2710 | |||
2563 | static int patch_stac922x(struct hda_codec *codec) | 2711 | static int patch_stac922x(struct hda_codec *codec) |
2564 | { | 2712 | { |
2565 | struct sigmatel_spec *spec; | 2713 | struct sigmatel_spec *spec; |
@@ -3128,5 +3276,6 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = { | |||
3128 | { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 }, | 3276 | { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 }, |
3129 | { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 }, | 3277 | { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 }, |
3130 | { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, | 3278 | { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, |
3279 | { .id = 0x111d76b0, .name = "92HD71BXX", .patch = patch_stac92hd71bxx }, | ||
3131 | {} /* terminator */ | 3280 | {} /* terminator */ |
3132 | }; | 3281 | }; |