[alsa-devel] help with idt 92hd206 codec for intel hda?

Takashi Iwai tiwai at suse.de
Tue Apr 29 17:48:53 CEST 2008


At Sun, 27 Apr 2008 01:38:19 -0500,
Greg Zornetzer wrote:
> 
> Hi all,
> I recently acquired an ECS GF7100PVT-M3 motherboard, which appears to use
> the IDT 92HD206 codec for HDA.  Unfortunately, it doesn't appear to have
> full support under ALSA.  It gets detected as another Sigmatel chip.  Analog
> stereo output appears to work, but the mixer doesn't find any of the normal
> inputs.
> 
> I found the tech specs for the chip at
> http://www.idt.com/products/getDoc.cfm?docID=13461840
> I've attached an lspci output and the codec file to this email.  I'm not
> much of an driver hacker, but if someone could give me an idea of what needs
> to go into the patch_sigmatel.c file to make this thing work, I'd be willing
> to try.  I'm also more than willing to test out patches on my setup.

The below is an entirely untested patch quickly made from the codec
information you posted.  Could you give it a try with the latest ALSA
HG version?


thanks,

Takashi

---
diff -r 19b486f73bd8 pci/hda/patch_sigmatel.c
--- a/pci/hda/patch_sigmatel.c	Fri Apr 25 14:25:04 2008 +0200
+++ b/pci/hda/patch_sigmatel.c	Tue Apr 29 19:47:26 2008 +0200
@@ -364,6 +364,20 @@
 	0x21, 0x22,
 };
 
+#define stac92hd206_pin_nids	stac925x_pin_nids
+
+static hda_nid_t stac92hd206_dac_nids[4] = {
+	0x02, 0x03, 0x04, 0x05,
+};
+
+static hda_nid_t stac92hd206_adc_nids[2] = {
+	0x07, 0x08
+};
+
+static hda_nid_t stac92hd206_mux_nids[2] = {
+	0x15, 0x16
+};
+
 static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol,
 				   struct snd_ctl_elem_info *uinfo)
 {
@@ -688,6 +702,12 @@
 	{}
 };
 
+static struct hda_verb stac92hd206_core_init[] = {
+	/* set master volume and direct control */
+	{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
+	{}
+};
+
 #define STAC_MONO_MUX \
 	{ \
 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
@@ -889,6 +909,17 @@
 	HDA_CODEC_VOLUME_IDX("Capture Volume", 0x2, 0x1A, 0x0, HDA_INPUT),
 	HDA_CODEC_MUTE_IDX("Capture Switch", 0x2, 0x1d, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME_IDX("Mux Capture Volume", 0x2, 0x17, 0x0, HDA_OUTPUT),
+	{ } /* end */
+};
+
+static struct snd_kcontrol_new stac92hd206_mixer[] = {
+	STAC_INPUT_SOURCE(2),
+	HDA_CODEC_VOLUME_IDX("Capture Volume", 0, 0x15, 0, HDA_OUTPUT),
+	HDA_CODEC_MUTE_IDX("Capture Switch", 0, 0x1b, 0, HDA_OUTPUT),
+	HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 0, 0x18, 0, HDA_INPUT),
+	HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x16, 0, HDA_OUTPUT),
+	HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x1c, 0, HDA_OUTPUT),
+	HDA_CODEC_VOLUME_IDX("Capture Mux Volume", 1, 0x19, 0, HDA_INPUT),
 	{ } /* end */
 };
 
@@ -3463,6 +3494,53 @@
 	return 0;
 }
 
+static int patch_stac92hd206(struct hda_codec *codec)
+{
+	struct sigmatel_spec *spec;
+	int err;
+
+	spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+	if (!spec)
+		return -ENOMEM;
+
+	codec->spec = spec;
+	spec->num_pins = ARRAY_SIZE(stac92hd206_pin_nids);
+	spec->pin_nids = stac92hd206_pin_nids;
+
+	/* no preset model yet */
+	err = stac92xx_save_bios_config_regs(codec);
+	if (err < 0) {
+		stac92xx_free(codec);
+		return err;
+	}
+	spec->pin_configs = spec->bios_pin_configs;
+
+	spec->multiout.max_channels = 2;
+	spec->multiout.num_dacs = 1;
+	spec->multiout.dac_nids = stac92hd206_dac_nids;
+	spec->adc_nids = stac92hd206_adc_nids;
+	spec->num_adcs = ARRAY_SIZE(stac92hd206_adc_nids);
+	spec->mux_nids = stac92hd206_mux_nids;
+	spec->num_muxes = ARRAY_SIZE(stac92hd206_mux_nids);
+	spec->num_pwrs = 0;
+	spec->num_dmics = 0;
+
+	spec->init = stac92hd206_core_init;
+	spec->mixer = stac92hd206_mixer;
+
+	err = stac92xx_parse_auto_config(codec, 0x1e, 0x20);
+	if (!err)
+		err = -EINVAL;
+	if (err < 0) {
+		stac92xx_free(codec);
+		return err;
+	}
+
+	codec->patch_ops = stac92xx_patch_ops;
+
+	return 0;
+}
+
 static struct hda_input_mux stac92hd73xx_dmux = {
 	.num_items = 4,
 	.items = {
@@ -4289,6 +4367,8 @@
 	{ .id = 0x83847635, .name = "STAC9250D", .patch = patch_stac925x },
 	{ .id = 0x83847636, .name = "STAC9251", .patch = patch_stac925x },
 	{ .id = 0x83847637, .name = "STAC9250D", .patch = patch_stac925x },
+	{ .id = 0x83847645, .name = "92HD206X", .patch = patch_stac92hd206 },
+	{ .id = 0x83847646, .name = "92HD206D", .patch = patch_stac92hd206 },
  	/* The following does not take into account .id=0x83847661 when subsys =
  	 * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
  	 * currently not fully supported.


More information about the Alsa-devel mailing list