mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kasper Sandberg <lkml@metanurb.dk>
Cc: LKML Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] make alsa use corect patch for Realtek ALC889A
Date: Wed, 16 Apr 2008 16:31:39 +0200	[thread overview]
Message-ID: <s5htzi1eur8.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5hbq4af4h3.wl%tiwai@suse.de>

At Wed, 16 Apr 2008 13:01:44 +0200,
I wrote:
> 
> At Sat, 12 Apr 2008 18:17:23 +0200,
> Kasper Sandberg wrote:
> > 
> > Hello..
> > I have a gigabyte X48-DQ6 motherboard, specification url:
> > http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ClassValue=Motherboard&ProductID=2763&ProductName=GA-X48-DQ6
> > they clearly state it uses a realtek alc 889a.
> > 
> > google around, it seems lots of people which has this chip gets it
> > detected as alc885, including me.
> > 
> > now, audio works (atleast analog out, havent tested the rest), allthough
> > i couldnt get the supposed feature of separate channel to front panel to
> > work(doesent matter much to me though)
> > 
> > interrested in fixing this just for the sake of fixing, i ventured into
> > patch_realtek.c, and found the structure that defined patches for hda
> > audio.
> > 
> > i inspected my /proc/asound/card0/codec#2 file (only one except the id
> > file), and found the following information:
> > Codec: Realtek ALC885
> > Address: 2
> > Vendor Id: 0x10ec0885
> > Subsystem Id: 0x1458a002
> > Revision Id: 0x100103
> > 
> > i then modified patch_realtek.c to detect mine as ALC889A, and assign
> > the correct patch to it (well, the one used for 889).
> > 
> > After rebuilding, it now uses patch 883 instead of 882 as it did before.
> > i dont appear to have recieved any separate front panel channel,
> > however, it still seems more correct now, and is probably wise to keep
> > for when 883 is improved to support the hardware fully.
> > 
> > the only thing i notice has changed, is the message i get from the
> > kernel, before i changed, it said:
> > hda_codec: Unknown model for ALC882, trying auto-probe from BIOS...
> > now it says:
> > hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
> > but i guess if it has to spew out such a line, it now spews out the
> > correct one.
> > 
> > analog audio works, so thats fine..
> > 
> > the patch(i apologize if my mailer messes up whitespace, but its so
> > simple that it doesent matter):
> 
> The change looks OK (although I'd move the line just before ALC885
> entry).  I have no datasheet of ALC889A, but rumor says that it's
> almost compatible with ALC888.  So patch_alc883 seems to be a better
> choice than now.
> 
> I'll fix it on ALSA tree now.

On the second thought, replacing to patch_alc883 may break many
devices with preset models because patch_alc882() and patch_alc883()
have different model tables.  So, I applied the patch below in
addition.

BTW, could you show your codec#* files?  This will be really helpful
to identify problems.

Also, I'm still a bit suspicious whether ALC889A has really that
vendor id.  Do you have a chance to check the chip on your board?


thanks,

Takashi

---
diff -r e2c5d8b125b7 -r e42f262f5117 sound/pci/hda/patch_realtek.c
--- a/sound/pci/hda/patch_realtek.c	Wed Apr 16 13:13:29 2008 +0200
+++ b/sound/pci/hda/patch_realtek.c	Wed Apr 16 16:29:09 2008 +0200
@@ -2579,6 +2579,7 @@ static void alc_free(struct hda_codec *c
 		kfree(spec->kctl_alloc);
 	}
 	kfree(spec);
+	codec->spec = NULL; /* to be sure */
 }
 
 /*
@@ -6336,6 +6337,8 @@ static void alc882_auto_init(struct hda_
 		alc_sku_automute(codec);
 }
 
+static int patch_alc883(struct hda_codec *codec); /* called in patch_alc882() */
+
 static int patch_alc882(struct hda_codec *codec)
 {
 	struct alc_spec *spec;
@@ -6365,6 +6368,11 @@ static int patch_alc882(struct hda_codec
 			board_config = ALC885_MBP3;
 			break;
 		default:
+			/* ALC889A is handled better as ALC888-compatible */
+			if (codec->revision_id == 0x100103) {
+				alc_free(codec);
+				return patch_alc883(codec);
+			}
 			printk(KERN_INFO "hda_codec: Unknown model for ALC882, "
 		       			 "trying auto-probe from BIOS...\n");
 			board_config = ALC882_AUTO;
@@ -14043,7 +14051,7 @@ struct hda_codec_preset snd_hda_preset_r
 	{ .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
 	{ .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc883 },
 	{ .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
-	  .patch = patch_alc883 },
+	  .patch = patch_alc882 }, /* should be patch_alc883() in future */
 	{ .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
 	{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 },
 	{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 },

  reply	other threads:[~2008-04-16 14:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 16:17 Kasper Sandberg
2008-04-16 11:01 ` Takashi Iwai
2008-04-16 14:31   ` Takashi Iwai [this message]
2008-04-18  1:52     ` Kasper Sandberg
2008-04-18 10:16       ` Takashi Iwai
2008-04-22 20:53         ` Kasper Sandberg
2008-04-23  8:55           ` Takashi Iwai
2008-04-23 21:35             ` Kasper Sandberg
2008-04-25 12:48               ` Takashi Iwai
2008-04-26  1:11                 ` Kasper Sandberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5htzi1eur8.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@metanurb.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®