aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaliy Kulikov <Vitaliy.Kulikov@idt.com>2010-09-08 03:00:17 -0400
committerTakashi Iwai <tiwai@suse.de>2010-09-08 03:00:17 -0400
commitab5a6ebee38f3ed311f0565ecd3fba5cf111564a (patch)
tree8f6ec7d99f3f0c0580ee4db166f74cc411306cf0
parent83c0de892d5018e45c5c0cd12affdee3c8add8a9 (diff)
ALSA: hda - Adding support for new IDT 92HD90BXX and 92HD91BXX codecs
Adding support for digital MIC in 92HD83/90/91XXX codecs family. Signed-off-by: Vitaliy Kulikov <Vitaliy.Kulikov@idt.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_sigmatel.c79
1 files changed, 46 insertions, 33 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index d226edd1e143..82d1e4378621 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -382,6 +382,11 @@ static unsigned int stac92hd83xxx_pwr_mapping[4] = {
382 0x03, 0x0c, 0x20, 0x40, 382 0x03, 0x0c, 0x20, 0x40,
383}; 383};
384 384
385#define STAC92HD83XXX_NUM_DMICS 2
386static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
387 0x11, 0x20, 0
388};
389
385#define STAC92HD83XXX_NUM_CAPS 2 390#define STAC92HD83XXX_NUM_CAPS 2
386static unsigned long stac92hd83xxx_capvols[] = { 391static unsigned long stac92hd83xxx_capvols[] = {
387 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), 392 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
@@ -4695,6 +4700,36 @@ static void stac92xx_report_jack(struct hda_codec *codec, hda_nid_t nid)
4695 } 4700 }
4696} 4701}
4697 4702
4703/* get the pin connection (fixed, none, etc) */
4704static unsigned int stac_get_defcfg_connect(struct hda_codec *codec, int idx)
4705{
4706 struct sigmatel_spec *spec = codec->spec;
4707 unsigned int cfg;
4708
4709 cfg = snd_hda_codec_get_pincfg(codec, spec->pin_nids[idx]);
4710 return get_defcfg_connect(cfg);
4711}
4712
4713static int stac92xx_connected_ports(struct hda_codec *codec,
4714 hda_nid_t *nids, int num_nids)
4715{
4716 struct sigmatel_spec *spec = codec->spec;
4717 int idx, num;
4718 unsigned int def_conf;
4719
4720 for (num = 0; num < num_nids; num++) {
4721 for (idx = 0; idx < spec->num_pins; idx++)
4722 if (spec->pin_nids[idx] == nids[num])
4723 break;
4724 if (idx >= spec->num_pins)
4725 break;
4726 def_conf = stac_get_defcfg_connect(codec, idx);
4727 if (def_conf == AC_JACK_PORT_NONE)
4728 break;
4729 }
4730 return num;
4731}
4732
4698static void stac92xx_mic_detect(struct hda_codec *codec) 4733static void stac92xx_mic_detect(struct hda_codec *codec)
4699{ 4734{
4700 struct sigmatel_spec *spec = codec->spec; 4735 struct sigmatel_spec *spec = codec->spec;
@@ -5325,6 +5360,8 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
5325 spec->linear_tone_beep = 1; 5360 spec->linear_tone_beep = 1;
5326 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; 5361 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
5327 spec->digbeep_nid = 0x21; 5362 spec->digbeep_nid = 0x21;
5363 spec->dmic_nids = stac92hd83xxx_dmic_nids;
5364 spec->dmux_nids = stac92hd83xxx_mux_nids;
5328 spec->mux_nids = stac92hd83xxx_mux_nids; 5365 spec->mux_nids = stac92hd83xxx_mux_nids;
5329 spec->num_muxes = ARRAY_SIZE(stac92hd83xxx_mux_nids); 5366 spec->num_muxes = ARRAY_SIZE(stac92hd83xxx_mux_nids);
5330 spec->adc_nids = stac92hd83xxx_adc_nids; 5367 spec->adc_nids = stac92hd83xxx_adc_nids;
@@ -5370,9 +5407,13 @@ again:
5370 case 0x111d76d4: 5407 case 0x111d76d4:
5371 case 0x111d7605: 5408 case 0x111d7605:
5372 case 0x111d76d5: 5409 case 0x111d76d5:
5410 case 0x111d76e7:
5373 if (spec->board_config == STAC_92HD83XXX_PWR_REF) 5411 if (spec->board_config == STAC_92HD83XXX_PWR_REF)
5374 break; 5412 break;
5375 spec->num_pwrs = 0; 5413 spec->num_pwrs = 0;
5414 spec->num_dmics = stac92xx_connected_ports(codec,
5415 stac92hd83xxx_dmic_nids,
5416 STAC92HD83XXX_NUM_DMICS);
5376 break; 5417 break;
5377 } 5418 }
5378 5419
@@ -5431,36 +5472,6 @@ again:
5431 return 0; 5472 return 0;
5432} 5473}
5433 5474
5434/* get the pin connection (fixed, none, etc) */
5435static unsigned int stac_get_defcfg_connect(struct hda_codec *codec, int idx)
5436{
5437 struct sigmatel_spec *spec = codec->spec;
5438 unsigned int cfg;
5439
5440 cfg = snd_hda_codec_get_pincfg(codec, spec->pin_nids[idx]);
5441 return get_defcfg_connect(cfg);
5442}
5443
5444static int stac92hd71bxx_connected_ports(struct hda_codec *codec,
5445 hda_nid_t *nids, int num_nids)
5446{
5447 struct sigmatel_spec *spec = codec->spec;
5448 int idx, num;
5449 unsigned int def_conf;
5450
5451 for (num = 0; num < num_nids; num++) {
5452 for (idx = 0; idx < spec->num_pins; idx++)
5453 if (spec->pin_nids[idx] == nids[num])
5454 break;
5455 if (idx >= spec->num_pins)
5456 break;
5457 def_conf = stac_get_defcfg_connect(codec, idx);
5458 if (def_conf == AC_JACK_PORT_NONE)
5459 break;
5460 }
5461 return num;
5462}
5463
5464static int stac92hd71bxx_connected_smuxes(struct hda_codec *codec, 5475static int stac92hd71bxx_connected_smuxes(struct hda_codec *codec,
5465 hda_nid_t dig0pin) 5476 hda_nid_t dig0pin)
5466{ 5477{
@@ -5599,7 +5610,7 @@ again:
5599 case 0x111d76b5: 5610 case 0x111d76b5:
5600 spec->init = stac92hd71bxx_core_init; 5611 spec->init = stac92hd71bxx_core_init;
5601 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5612 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5602 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5613 spec->num_dmics = stac92xx_connected_ports(codec,
5603 stac92hd71bxx_dmic_nids, 5614 stac92hd71bxx_dmic_nids,
5604 STAC92HD71BXX_NUM_DMICS); 5615 STAC92HD71BXX_NUM_DMICS);
5605 break; 5616 break;
@@ -5631,7 +5642,7 @@ again:
5631 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); 5642 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
5632 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); 5643 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
5633 stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS - 1] = 0; 5644 stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS - 1] = 0;
5634 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5645 spec->num_dmics = stac92xx_connected_ports(codec,
5635 stac92hd71bxx_dmic_nids, 5646 stac92hd71bxx_dmic_nids,
5636 STAC92HD71BXX_NUM_DMICS - 1); 5647 STAC92HD71BXX_NUM_DMICS - 1);
5637 break; 5648 break;
@@ -5645,7 +5656,7 @@ again:
5645 default: 5656 default:
5646 spec->init = stac92hd71bxx_core_init; 5657 spec->init = stac92hd71bxx_core_init;
5647 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5658 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5648 spec->num_dmics = stac92hd71bxx_connected_ports(codec, 5659 spec->num_dmics = stac92xx_connected_ports(codec,
5649 stac92hd71bxx_dmic_nids, 5660 stac92hd71bxx_dmic_nids,
5650 STAC92HD71BXX_NUM_DMICS); 5661 STAC92HD71BXX_NUM_DMICS);
5651 break; 5662 break;
@@ -6327,6 +6338,8 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = {
6327 { .id = 0x111d76cc, .name = "92HD89F3", .patch = patch_stac92hd73xx }, 6338 { .id = 0x111d76cc, .name = "92HD89F3", .patch = patch_stac92hd73xx },
6328 { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, 6339 { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx },
6329 { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, 6340 { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx },
6341 { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx},
6342 { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx},
6330 {} /* terminator */ 6343 {} /* terminator */
6331}; 6344};
6332 6345