Skip to contentSkip to conversation

Macbook Pro pins in patch_sigmatel

PATCH Applied Nicolas Boichat 3 participants 6 messages Mar 14, 2007 – Mar 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

I just came across this git commit:
http://git.kernel.org/?p=linux/kernel/git/perex/alsa.git;a=commitdiff;h=3fc24d850708b8dfd3472b25eac0c32dd7708925

I also have a Macbook Pro, but my codec->subsystem_id is different (0x106b0200), and I need to use different pins to get the mic to work:

    0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010,
    0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E,
    0x02a19320, 0x400000FB,

Which Macbook Pro are you talking about? I have a first generation Macbook Pro (bought in April 2006, Core Duo (not Core 2 Duo)), so I assume you tested your patches on a 2nd generation Macbook Pro.

I attached a patch to fix this problem against the latest linus' git. I also added a line which prints the subsystem_id in dmesg, so I can ask users on mactel-linux for their subsystem_ids (Macbook non-Pro audio probably won't work fine currently).

(please CC me I'm not subscribed to alsa-devel list)

Best regards,

Nicolas Boichat

Fix audio on Macbook Pro 1st generation.

---

 Documentation/sound/alsa/ALSA-Configuration.txt |    3 ++-
 sound/pci/hda/patch_sigmatel.c                  |   23 ++++++++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)
Documentation/sound/alsa/ALSA-Configuration.txt +2 -1
index db398a6..0c2ab4e 100644
@@ -906,7 +906,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 	  5stack	D945 5stack + SPDIF
 	  macmini	Intel Mac Mini
 	  macbook	Intel Mac Book
-	  macbook-pro	Intel Mac Book Pro
+	  macbook-pro-v1 Intel Mac Book Pro 1st generation
+	  macbook-pro-v2 Intel Mac Book Pro 2nd generation
 
 	STAC9202/9250/9251
 	  ref		Reference board, base config
sound/pci/hda/patch_sigmatel.c +18 -5
index 4c7b039..077d718 100644
@@ -60,7 +60,8 @@ enum {
 	STAC_D945GTP5,
 	STAC_MACMINI,
 	STAC_MACBOOK,
-	STAC_MACBOOK_PRO,
+	STAC_MACBOOK_PRO_V1,
+	STAC_MACBOOK_PRO_V2,
 	STAC_922X_MODELS
 };
 
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
 	0x400000fc, 0x400000fb,
 };
 
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+	0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010,
+	0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E,
+	0x02a19320, 0x400000FB,
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
 	0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
 	0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
 	0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
 	[STAC_D945GTP5] = d945gtp5_pin_configs,
 	[STAC_MACMINI] = d945gtp5_pin_configs,
 	[STAC_MACBOOK] = macbook_pin_configs,
-	[STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+	[STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+	[STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
 };
 
 static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
 	[STAC_D945GTP3]	= "3stack",
 	[STAC_MACMINI]	= "macmini",
 	[STAC_MACBOOK]	= "macbook",
-	[STAC_MACBOOK_PRO]	= "macbook-pro",
+	[STAC_MACBOOK_PRO_V1]	= "macbook-pro-v1",
+	[STAC_MACBOOK_PRO_V2]	= "macbook-pro-v2",
 };
 
 static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1889,9 +1898,13 @@ static int patch_stac922x(struct hda_codec *codec)
 		/* 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:
-			spec->board_config = STAC_MACBOOK_PRO;
+			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

#1 lore raw

At Thu, 15 Mar 2007 02:54:24 +0800,

Quoted 9 lines · Nicolas Boichat

Hello,

I just came across this git commit:
http://git.kernel.org/?p=linux/kernel/git/perex/alsa.git;a=commitdiff;h=3fc24d850708b8dfd3472b25eac0c32dd7708925

I also have a Macbook Pro, but my codec->subsystem_id is different (0x106b0200), and I need to use different pins to get the mic to work:

Quoted 7 lines
    0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010,
    0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E,
    0x02a19320, 0x400000FB,

Which Macbook Pro are you talking about? I have a first generation Macbook Pro (bought in April 2006, Core Duo (not Core 2 Duo)), so I assume you tested your patches on a 2nd generation Macbook Pro.

The patch is based on reports by Rafael Espindola (Cc'ed). Rafael, which model do you have exactl?

Quoted 4 lines

I attached a patch to fix this problem against the latest linus' git. I also added a line which prints the subsystem_id in dmesg, so I can ask users on mactel-linux for their subsystem_ids (Macbook non-Pro audio probably won't work fine currently).

IMO, it's bad to rename the existing model name as it has been already used in ALSA tree. So please simply add a new model name for your device, e.g. macbook-pro-v1.
Otherwise the patch looks good to me.

Could you fix this and repost the patch?

thanks,

Takashi

Quoted 90 lines

(please CC me I'm not subscribed to alsa-devel list)

Best regards,

Nicolas Boichat

Fix audio on Macbook Pro 1st generation.

---

 Documentation/sound/alsa/ALSA-Configuration.txt |    3 ++-
 sound/pci/hda/patch_sigmatel.c                  |   23 ++++++++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)
Documentation/sound/alsa/ALSA-Configuration.txt +2 -1
index db398a6..0c2ab4e 100644
@@ -906,7 +906,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 	  5stack	D945 5stack + SPDIF
 	  macmini	Intel Mac Mini
 	  macbook	Intel Mac Book
-	  macbook-pro	Intel Mac Book Pro
+	  macbook-pro-v1 Intel Mac Book Pro 1st generation
+	  macbook-pro-v2 Intel Mac Book Pro 2nd generation
 
 	STAC9202/9250/9251
 	  ref		Reference board, base config
sound/pci/hda/patch_sigmatel.c +14 -4
index 4c7b039..077d718 100644
@@ -60,7 +60,8 @@ enum {
 	STAC_D945GTP5,
 	STAC_MACMINI,
 	STAC_MACBOOK,
-	STAC_MACBOOK_PRO,
+	STAC_MACBOOK_PRO_V1,
+	STAC_MACBOOK_PRO_V2,
 	STAC_922X_MODELS
 };
 
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
 	0x400000fc, 0x400000fb,
 };
 
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+	0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010,
+	0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E,
+	0x02a19320, 0x400000FB,
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
 	0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
 	0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
 	0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
 	[STAC_D945GTP5] = d945gtp5_pin_configs,
 	[STAC_MACMINI] = d945gtp5_pin_configs,
 	[STAC_MACBOOK] = macbook_pin_configs,
-	[STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+	[STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+	[STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
 };
 
 static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
 	[STAC_D945GTP3]	= "3stack",
 	[STAC_MACMINI]	= "macmini",
 	[STAC_MACBOOK]	= "macbook",
-	[STAC_MACBOOK_PRO]	= "macbook-pro",
+	[STAC_MACBOOK_PRO_V1]	= "macbook-pro-v1",
+	[STAC_MACBOOK_PRO_V2]	= "macbook-pro-v2",
 };
 
 static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1889,9 +1898,13 @@ static int patch_stac922x(struct hda_codec *codec)
 		/* 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);

sound/pci/hda/patch_sigmatel.c static int patch_stac922x(struct hda_codec *codec) · line 1910

Quoted 10 lines
sound/pci/hda/patch_sigmatel.c +4 -1
 		switch (codec->subsystem_id) {
+		case 0x106b0200: /* MacBook Pro first generation */
+			spec->board_config = STAC_MACBOOK_PRO_V1;
+			break;
 		case 0x106b1e00:
-			spec->board_config = STAC_MACBOOK_PRO;
+			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

#2 lore raw
Quoted 2 lines

The patch is based on reports by Rafael Espindola (Cc'ed). Rafael, which model do you have exactl?

A core 2 duo (second generation).

Quoted 4 lines

IMO, it's bad to rename the existing model name as it has been already used in ALSA tree. So please simply add a new model name for your device, e.g. macbook-pro-v1.
Otherwise the patch looks good to me.

Just nitpicking: Do we use upper or lower case in hexadecimal number?

Thanks,
Rafael

-------------------------------------------------------------------------
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

#3 lore raw

Hello,

Quoted 3 lines · Rafael Espíndola
Quoted 2 lines

The patch is based on reports by Rafael Espindola (Cc'ed). Rafael, which model do you have exactl?

A core 2 duo (second generation).

Ok I added a comment in the code about this.

Quoted 4 lines
Quoted 4 lines

IMO, it's bad to rename the existing model name as it has been already used in ALSA tree. So please simply add a new model name for your device, e.g. macbook-pro-v1.

Fixed.

Quoted 3 lines
Quoted 1 line

Otherwise the patch looks good to me.

Just nitpicking: Do we use upper or lower case in hexadecimal number?

Ok ok... Lower case .-) The other pins are lower case...

New patch attached.

Best regards,

Nicolas

Fix audio on Macbook Pro 1st generation.

---

 Documentation/sound/alsa/ALSA-Configuration.txt |    3 ++-
 sound/pci/hda/patch_sigmatel.c                  |   25
+++++++++++++++++------
 2 files changed, 21 insertions(+), 7 deletions(-)
(quoted diff) +0 -0

b/Documentation/sound/alsa/ALSA-Configuration.txt
index db398a6..438f3fe 100644

Documentation/sound/alsa/ALSA-Configuration.txt +0 -0
@@ -906,7 +906,8 @@ Prior to version 0.9.0rc4 options had a 'snd_'

prefix. This was removed.
5stack D945 5stack + SPDIF
macmini Intel Mac Mini
macbook Intel Mac Book

-      macbook-pro    Intel Mac Book Pro
+      macbook-pro-v1 Intel Mac Book Pro 1st generation
+      macbook-pro    Intel Mac Book Pro 2nd generation

STAC9202/9250/9251
ref Reference board, base config

sound/pci/hda/patch_sigmatel.c +9 -2
index 4c7b039..2d78a9f 100644
@@ -60,7 +60,8 @@ enum {
     STAC_D945GTP5,
     STAC_MACMINI,
     STAC_MACBOOK,
-    STAC_MACBOOK_PRO,
+    STAC_MACBOOK_PRO_V1,
+    STAC_MACBOOK_PRO_V2,
     STAC_922X_MODELS
 };
 
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
     0x400000fc, 0x400000fb,
 };
 
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+    0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
+    0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
+    0x02a19320, 0x400000fb
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
     0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
     0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
     0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int
*stac922x_brd_tbl[STAC_922X_MODELS] = {
     [STAC_D945GTP5] = d945gtp5_pin_configs,
     [STAC_MACMINI] = d945gtp5_pin_configs,
     [STAC_MACBOOK] = macbook_pin_configs,
-    [STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+    [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+    [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,

};

static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
[STAC_D945GTP3] = "3stack",
[STAC_MACMINI] = "macmini",
[STAC_MACBOOK] = "macbook",

-    [STAC_MACBOOK_PRO]    = "macbook-pro",
+    [STAC_MACBOOK_PRO_V1]    = "macbook-pro-v1",
+    [STAC_MACBOOK_PRO_V2]    = "macbook-pro",

};

static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1889,9 +1898,13 @@ static int patch_stac922x(struct hda_codec *codec)

         /* 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 0x106b1e00:
- spec->board_config = STAC_MACBOOK_PRO;
+ 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
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#4 lore raw

Sorry the patch got wrapped.......

Quoted 21 lines · Nicolas Boichat

Hello,

Quoted 5 lines · Rafael Espíndola
Quoted 3 lines

The patch is based on reports by Rafael Espindola (Cc'ed). Rafael, which model do you have exactl?

A core 2 duo (second generation).

Ok I added a comment in the code about this.

Quoted 4 lines
Quoted 4 lines

IMO, it's bad to rename the existing model name as it has been already used in ALSA tree. So please simply add a new model name for your device, e.g. macbook-pro-v1.

Fixed.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Otherwise the patch looks good to me.

Just nitpicking: Do we use upper or lower case in hexadecimal number?

Ok ok... Lower case .-) The other pins are lower case...

New patch attached.

Fix audio on Macbook Pro 1st generation.

---

 Documentation/sound/alsa/ALSA-Configuration.txt |    3 ++-
 sound/pci/hda/patch_sigmatel.c                  |   25 +++++++++++++++++------
 2 files changed, 21 insertions(+), 7 deletions(-)
Documentation/sound/alsa/ALSA-Configuration.txt +2 -1
index db398a6..438f3fe 100644
@@ -906,7 +906,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 	  5stack	D945 5stack + SPDIF
 	  macmini	Intel Mac Mini
 	  macbook	Intel Mac Book
-	  macbook-pro	Intel Mac Book Pro
+	  macbook-pro-v1 Intel Mac Book Pro 1st generation
+	  macbook-pro	Intel Mac Book Pro 2nd generation
 
 	STAC9202/9250/9251
 	  ref		Reference board, base config
sound/pci/hda/patch_sigmatel.c +19 -6
index 4c7b039..2d78a9f 100644
@@ -60,7 +60,8 @@ enum {
 	STAC_D945GTP5,
 	STAC_MACMINI,
 	STAC_MACBOOK,
-	STAC_MACBOOK_PRO,
+	STAC_MACBOOK_PRO_V1,
+	STAC_MACBOOK_PRO_V2,
 	STAC_922X_MODELS
 };
 
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
 	0x400000fc, 0x400000fb,
 };
 
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+	0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
+	0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
+	0x02a19320, 0x400000fb
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
 	0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
 	0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
 	0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
 	[STAC_D945GTP5] = d945gtp5_pin_configs,
 	[STAC_MACMINI] = d945gtp5_pin_configs,
 	[STAC_MACBOOK] = macbook_pin_configs,
-	[STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+	[STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+	[STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
 };
 
 static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
 	[STAC_D945GTP3]	= "3stack",
 	[STAC_MACMINI]	= "macmini",
 	[STAC_MACBOOK]	= "macbook",
-	[STAC_MACBOOK_PRO]	= "macbook-pro",
+	[STAC_MACBOOK_PRO_V1]	= "macbook-pro-v1",
+	[STAC_MACBOOK_PRO_V2]	= "macbook-pro",
 };
 
 static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1889,9 +1898,13 @@ static int patch_stac922x(struct hda_codec *codec)
 		/* 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 0x106b1e00:
-			spec->board_config = STAC_MACBOOK_PRO;
+		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
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Applied
#5 lore raw

At Thu, 15 Mar 2007 12:56:58 +0800,

Quoted 30 lines · Nicolas Boichat

Sorry the patch got wrapped.......

Quoted 26 lines · Nicolas Boichat

Hello,

Quoted 5 lines · Rafael Espíndola
Quoted 3 lines

The patch is based on reports by Rafael Espindola (Cc'ed). Rafael, which model do you have exactl?

A core 2 duo (second generation).

Ok I added a comment in the code about this.

Quoted 4 lines
Quoted 4 lines

IMO, it's bad to rename the existing model name as it has been already used in ALSA tree. So please simply add a new model name for your device, e.g. macbook-pro-v1.

Fixed.

Quoted 4 lines
Quoted 2 lines

Otherwise the patch looks good to me.

Just nitpicking: Do we use upper or lower case in hexadecimal number?

Quoted 7 lines
Quoted 4 lines

Ok ok... Lower case .-) The other pins are lower case...

New patch attached.

Fix audio on Macbook Pro 1st generation.

Thanks, applied to HG tree now.

Takashi

-------------------------------------------------------------------------
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