All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Tobin Davis <tdavis@dsl-only.net>
Cc: alsa-devel@alsa-project.org
Subject: Re: trying to get sound working at a mac	book	pro	(core 2 duo)
Date: Thu, 15 Feb 2007 13:12:11 +0100	[thread overview]
Message-ID: <s5hsld7aack.wl%tiwai@suse.de> (raw)
In-Reply-To: <1171502000.7083.23.camel@razman.gruemaster.com>

At Wed, 14 Feb 2007 17:13:20 -0800,
Tobin Davis wrote:
> 
> On Wed, 2007-02-14 at 23:27 +0100, Takashi Iwai wrote:
> 
>     The driver always takes PCI SSID as a key for table-lookup.
>     The codec has its own SSID (and often a different value from PCI SSID)
>     as proc shows, but it's not used anywhere in the driver code.
> 
> This is the second time I've run into a system that has an HD audio chip, but doesn't
> have a unique PCI SSID. The first was the Mac Pro, where there is no SSID for the HD
> audio bus (see my patch for ALC885 Mac Pro - 12/15).
> 
> Takashi, we may want to look into a function that uses the codec subsystem id as a
> fallback, with the PCI SSID taking precedence.  We already detect the HD Audio bus,
> through the PCI ID.  Let me know.

As I mentioned in another mail, so far, it'd be much easier to check
the codec SSID in each patch code rather than changing the common PCI
quirk lookup.

An experimental patch is below.  Rafael, please give it a try.


Takashi

diff -r d5fda8fa934c Documentation/ALSA-Configuration.txt
--- a/Documentation/ALSA-Configuration.txt	Wed Feb 14 15:23:57 2007 +0100
+++ b/Documentation/ALSA-Configuration.txt	Thu Feb 15 13:09:55 2007 +0100
@@ -895,10 +895,16 @@ Prior to version 0.9.0rc4 options had a 
 			can be adjusted.  Appearing only when compiled with
 			$CONFIG_SND_DEBUG=y
 
-	STAC9200/9205/9220/9221/9254
+	STAC9200/9205/9254
+	  ref		Reference board
+
+	STAC9220/9221
 	  ref		Reference board
 	  3stack	D945 3stack
 	  5stack	D945 5stack + SPDIF
+	  macmini	Intel Mac Mini
+	  macbook	Intel Mac Book
+	  macbook-pro	Intel Mac Book Pro
 
 	STAC9202/9250/9251
 	  ref		Reference board, base config
diff -r d5fda8fa934c pci/hda/patch_sigmatel.c
--- a/pci/hda/patch_sigmatel.c	Wed Feb 14 15:23:57 2007 +0100
+++ b/pci/hda/patch_sigmatel.c	Thu Feb 15 13:05:43 2007 +0100
@@ -59,6 +59,8 @@ enum {
 	STAC_D945GTP3,
 	STAC_D945GTP5,
 	STAC_MACMINI,
+	STAC_MACBOOK,
+	STAC_MACBOOK_PRO,
 	STAC_922X_MODELS
 };
 
@@ -521,11 +523,25 @@ static unsigned int d945gtp5_pin_configs
 	0x02a19320, 0x40000100,
 };
 
+static unsigned int macbook_pin_configs[10] = {
+	0x0321e230, 0x03a1e020, 0x400000fd, 0x9017e110,
+	0x400000fe, 0x0381e021, 0x1345e240, 0x13c5e22e,
+	0x400000fc, 0x400000fb,
+};
+
+static unsigned int macbook_pro_pin_configs[10] = {
+	0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
+	0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
+	0x400000fc, 0x400000fb,
+};
+
 static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
 	[STAC_D945_REF] = ref922x_pin_configs,
 	[STAC_D945GTP3] = d945gtp3_pin_configs,
 	[STAC_D945GTP5] = d945gtp5_pin_configs,
 	[STAC_MACMINI] = d945gtp5_pin_configs,
+	[STAC_MACBOOK] = macbook_pin_configs,
+	[STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
 };
 
 static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -533,6 +549,8 @@ static const char *stac922x_models[STAC_
 	[STAC_D945GTP5]	= "5stack",
 	[STAC_D945GTP3]	= "3stack",
 	[STAC_MACMINI]	= "macmini",
+	[STAC_MACBOOK]	= "macbook",
+	[STAC_MACBOOK_PRO]	= "macbook-pro",
 };
 
 static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1866,6 +1884,23 @@ static int patch_stac922x(struct hda_cod
 	spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
 							stac922x_models,
 							stac922x_cfg_tbl);
+	if (spec->board_config == STAC_MACMINI) {
+		spec->gpio_mute = 1;
+		/* Intel Macs have all same PCI SSID, so we need to check
+		 * codec SSID to distinguish the exact models
+		 */
+		switch (codec->subsystem_id) {
+#if 0
+		case XXXX:
+			spec->board_config = STAC_MACBOOK;
+			break;
+#endif
+		case 0x106b1e00:
+			spec->board_config = STAC_MACBOOK_PRO;
+			break;
+		}
+	}
+
  again:
 	if (spec->board_config < 0) {
 		snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
@@ -1905,9 +1940,6 @@ static int patch_stac922x(struct hda_cod
 		stac92xx_free(codec);
 		return err;
 	}
-
-	if (spec->board_config == STAC_MACMINI)
-		spec->gpio_mute = 1;
 
 	codec->patch_ops = stac92xx_patch_ops;
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2007-02-15 12:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 19:21 trying to get sound working at a mac book pro (core 2 duo) Rafael Espíndola
2007-02-14 19:40 ` Tobin Davis
     [not found]   ` <564d96fb0702141209g6b032115pebe2ce1a7e3de57b@mail.gmail.com>
2007-02-14 20:11     ` Fwd: " Rafael Espíndola
2007-02-14 20:13     ` Rafael Espíndola
2007-02-14 20:35     ` Rafael Espíndola
2007-02-14 20:56       ` Rafael Espíndola
2007-02-14 22:27         ` Takashi Iwai
2007-02-14 22:32           ` Rafael Espíndola
2007-02-15  1:13           ` Tobin Davis
2007-02-15 12:12             ` Takashi Iwai [this message]
2007-02-15 19:55               ` Rafael Espíndola
2007-02-15 20:58                 ` tdavis
2007-02-16 12:30                 ` Takashi Iwai
2007-02-17 14:42                   ` Rafael Espíndola
2007-02-18 13:19                     ` Rafael Espíndola
2007-02-15 10:39 ` Rafael Espíndola

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=s5hsld7aack.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tdavis@dsl-only.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.