Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Boichat <nicolas@boichat.ch>
To: tiwai@suse.de
Cc: alsa-devel@lists.sourceforge.net,
	mactel-linux-devel@lists.sourceforge.net,
	Tino Keitel <tino.keitel+mactel-devel@tikei.de>
Subject: Macmini pins in sigmatel_audio
Date: Fri, 16 Mar 2007 17:50:33 +0800	[thread overview]
Message-ID: <45FA6869.40701@boichat.ch> (raw)
In-Reply-To: <20070315185433.GA10186@dose.home.local>

Hi,

I just got this input from a Macmini user (subsys id: 0x106b0800), after
asking him to try different pins settings. (the sound doesn't work
properly with a vanilla 2.6.21-rc3 kernel)

Tino Keitel wrote:
> On Thu, Mar 15, 2007 at 18:12:30 +0800, Nicolas Boichat wrote:
>
> [...]
>
>   
>> Considered it worked with the mactel patches, you should try
>> STAC_MACBOOK_PRO_V1 first....
>>     
>
> You are right, with STAC_MACBOOK_PRO_V1 I can use all required
> features. Here are the results:
>
> - analog line in works, if "Line In as Output" is muted
>
> - analog line out works, it is controlled by  the "Front" channel in
>   alsamixer
>
> - digital line out works
>
> - the internal speaker works, it is controlled by the "Master" channel
>   in alsamixer
>
> - the internal speaker is silent if there is an analog plug in line out
>
> - the internal speker still works if a (optical) digital cable is
>   plugged in line out, I guess because the optical plastic cable
>   doesn't short circuit the line out plug
>
> Minor glitches:
>
> There is an input selector that has the options "Line", "Mic" and
> "Front Mic". However, I think that only "Line" is really usable, as I
> had so signal when I connected a Mic to line in and a "Front Mic" is
> also not present in the mini.
>
> There is a "Mic as output" switch in alsamixer, but there is not "Mic"
> jack.
>   
Considering these pins have been used for a long time on mactel-linux,
and that they are working fine with MacBook (1st generation at least),
Macmini and Macbook Pro (1st generation only), I think the following
patch is appropriate (please apply it after the patch sent yesterday).

Best regards,

Nicolas

Fix audio on Macmini and Macbook.

Signed-off-by: Nicolas Boichat <nicolas@boichat.ch>

---

 Documentation/sound/alsa/ALSA-Configuration.txt |    5 ++--
 sound/pci/hda/patch_sigmatel.c                  |   27 +++++------------------
 2 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 438f3fe..c13885a 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -904,9 +904,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 	  ref		Reference board
 	  3stack	D945 3stack
 	  5stack	D945 5stack + SPDIF
-	  macmini	Intel Mac Mini
-	  macbook	Intel Mac Book
-	  macbook-pro-v1 Intel Mac Book Pro 1st generation
+	  mac		Intel Mac
+			     (Mac Mini, Mac Book, Mac Book Pro 1st generation)
 	  macbook-pro	Intel Mac Book Pro 2nd generation
 
 	STAC9202/9250/9251
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 2d78a9f..1293632 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -58,9 +58,7 @@ enum {
 	STAC_D945_REF,
 	STAC_D945GTP3,
 	STAC_D945GTP5,
-	STAC_MACMINI,
-	STAC_MACBOOK,
-	STAC_MACBOOK_PRO_V1,
+	STAC_MAC,
 	STAC_MACBOOK_PRO_V2,
 	STAC_922X_MODELS
 };
@@ -524,13 +522,7 @@ static unsigned int d945gtp5_pin_configs[10] = {
 	0x02a19320, 0x40000100,
 };
 
-static unsigned int macbook_pin_configs[10] = {
-	0x0321e230, 0x03a1e020, 0x400000fd, 0x9017e110,
-	0x400000fe, 0x0381e021, 0x1345e240, 0x13c5e22e,
-	0x400000fc, 0x400000fb,
-};
-
-static unsigned int macbook_pro_v1_pin_configs[10] = {
+static unsigned int mac_pin_configs[10] = {
 	0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
 	0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
 	0x02a19320, 0x400000fb
@@ -546,9 +538,7 @@ 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_V1] = macbook_pro_v1_pin_configs,
+	[STAC_MAC] = mac_pin_configs,
 	[STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
 };
 
@@ -556,9 +546,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
 	[STAC_D945_REF]	= "ref",
 	[STAC_D945GTP5]	= "5stack",
 	[STAC_D945GTP3]	= "3stack",
-	[STAC_MACMINI]	= "macmini",
-	[STAC_MACBOOK]	= "macbook",
-	[STAC_MACBOOK_PRO_V1]	= "macbook-pro-v1",
+	[STAC_MAC]	= "mac",
 	[STAC_MACBOOK_PRO_V2]	= "macbook-pro",
 };
 
@@ -622,7 +610,7 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
 	/* other systems  */
 	/* Apple Mac Mini (early 2006) */
 	SND_PCI_QUIRK(0x8384, 0x7680,
-		      "Mac Mini", STAC_MACMINI),
+		      "Intel Mac", STAC_MAC),
 	{} /* terminator */
 };
 
@@ -1893,16 +1881,13 @@ static int patch_stac922x(struct hda_codec *codec)
 	spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
 							stac922x_models,
 							stac922x_cfg_tbl);
-	if (spec->board_config == STAC_MACMINI) {
+	if (spec->board_config == STAC_MAC) {
 		spec->gpio_mute = 1;
 		/* Intel Macs have all same PCI SSID, so we need to check
 		 * codec SSID to distinguish the exact models
 		 */
 		printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id);
 		switch (codec->subsystem_id) {
-		case 0x106b0200: /* MacBook Pro first generation */
-			spec->board_config = STAC_MACBOOK_PRO_V1;
-			break;
 		case 0x106b1e00: /* MacBook Pro second generation */
 			spec->board_config = STAC_MACBOOK_PRO_V2;
 			break;



-------------------------------------------------------------------------
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-03-16  9:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1HRY1h-0003Y6-2M@sc8-pr-svn1.sourceforge.net>
     [not found] ` <20070314192940.GA18255@dose.home.local>
     [not found]   ` <45F8DD78.9020508@boichat.ch>
     [not found]     ` <20070315080134.GA22654@dose.home.local>
     [not found]       ` <45F91C0E.7020600@boichat.ch>
     [not found]         ` <20070315185433.GA10186@dose.home.local>
2007-03-16  9:50           ` Nicolas Boichat [this message]
2007-03-16 11:08             ` Macmini pins in sigmatel_audio Takashi Iwai
2007-03-16 14:28               ` [Alsa-devel] " Takashi Iwai
2007-03-17  5:58               ` Nicolas Boichat

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=45FA6869.40701@boichat.ch \
    --to=nicolas@boichat.ch \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=mactel-linux-devel@lists.sourceforge.net \
    --cc=tino.keitel+mactel-devel@tikei.de \
    --cc=tiwai@suse.de \
    /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