aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-02-16 07:27:18 -0500
committerJaroslav Kysela <perex@suse.cz>2007-03-06 04:40:28 -0500
commit3fc24d850708b8dfd3472b25eac0c32dd7708925 (patch)
tree449ecf9e1f63dd30326fe777d14cc26083624e7a
parentcc69d12d0a063fd5f25d9b395357be5ba438b0c6 (diff)
[ALSA] hda-codec - Define pin configs for MacBooks
Define pin configs for MacBook and MacBook Pro with STAC92xx codecs. The latter is detected automatically by checking codec SSID now. Also, fixed the documentation regarding available modeliof sigmatel codec chips. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt8
-rw-r--r--sound/pci/hda/patch_sigmatel.c33
2 files changed, 37 insertions, 4 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index c30ff1bb2d10..e127751d17c2 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -895,10 +895,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
895 can be adjusted. Appearing only when compiled with 895 can be adjusted. Appearing only when compiled with
896 $CONFIG_SND_DEBUG=y 896 $CONFIG_SND_DEBUG=y
897 897
898 STAC9200/9205/9220/9221/9254 898 STAC9200/9205/9254
899 ref Reference board
900
901 STAC9220/9221
899 ref Reference board 902 ref Reference board
900 3stack D945 3stack 903 3stack D945 3stack
901 5stack D945 5stack + SPDIF 904 5stack D945 5stack + SPDIF
905 macmini Intel Mac Mini
906 macbook Intel Mac Book
907 macbook-pro Intel Mac Book Pro
902 908
903 STAC9202/9250/9251 909 STAC9202/9250/9251
904 ref Reference board, base config 910 ref Reference board, base config
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 54fdf3448133..4c7b03996be9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -59,6 +59,8 @@ enum {
59 STAC_D945GTP3, 59 STAC_D945GTP3,
60 STAC_D945GTP5, 60 STAC_D945GTP5,
61 STAC_MACMINI, 61 STAC_MACMINI,
62 STAC_MACBOOK,
63 STAC_MACBOOK_PRO,
62 STAC_922X_MODELS 64 STAC_922X_MODELS
63}; 65};
64 66
@@ -521,11 +523,25 @@ static unsigned int d945gtp5_pin_configs[10] = {
521 0x02a19320, 0x40000100, 523 0x02a19320, 0x40000100,
522}; 524};
523 525
526static unsigned int macbook_pin_configs[10] = {
527 0x0321e230, 0x03a1e020, 0x400000fd, 0x9017e110,
528 0x400000fe, 0x0381e021, 0x1345e240, 0x13c5e22e,
529 0x400000fc, 0x400000fb,
530};
531
532static unsigned int macbook_pro_pin_configs[10] = {
533 0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
534 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
535 0x400000fc, 0x400000fb,
536};
537
524static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { 538static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
525 [STAC_D945_REF] = ref922x_pin_configs, 539 [STAC_D945_REF] = ref922x_pin_configs,
526 [STAC_D945GTP3] = d945gtp3_pin_configs, 540 [STAC_D945GTP3] = d945gtp3_pin_configs,
527 [STAC_D945GTP5] = d945gtp5_pin_configs, 541 [STAC_D945GTP5] = d945gtp5_pin_configs,
528 [STAC_MACMINI] = d945gtp5_pin_configs, 542 [STAC_MACMINI] = d945gtp5_pin_configs,
543 [STAC_MACBOOK] = macbook_pin_configs,
544 [STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
529}; 545};
530 546
531static const char *stac922x_models[STAC_922X_MODELS] = { 547static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -533,6 +549,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
533 [STAC_D945GTP5] = "5stack", 549 [STAC_D945GTP5] = "5stack",
534 [STAC_D945GTP3] = "3stack", 550 [STAC_D945GTP3] = "3stack",
535 [STAC_MACMINI] = "macmini", 551 [STAC_MACMINI] = "macmini",
552 [STAC_MACBOOK] = "macbook",
553 [STAC_MACBOOK_PRO] = "macbook-pro",
536}; 554};
537 555
538static struct snd_pci_quirk stac922x_cfg_tbl[] = { 556static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1866,6 +1884,18 @@ static int patch_stac922x(struct hda_codec *codec)
1866 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, 1884 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
1867 stac922x_models, 1885 stac922x_models,
1868 stac922x_cfg_tbl); 1886 stac922x_cfg_tbl);
1887 if (spec->board_config == STAC_MACMINI) {
1888 spec->gpio_mute = 1;
1889 /* Intel Macs have all same PCI SSID, so we need to check
1890 * codec SSID to distinguish the exact models
1891 */
1892 switch (codec->subsystem_id) {
1893 case 0x106b1e00:
1894 spec->board_config = STAC_MACBOOK_PRO;
1895 break;
1896 }
1897 }
1898
1869 again: 1899 again:
1870 if (spec->board_config < 0) { 1900 if (spec->board_config < 0) {
1871 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " 1901 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
@@ -1906,9 +1936,6 @@ static int patch_stac922x(struct hda_codec *codec)
1906 return err; 1936 return err;
1907 } 1937 }
1908 1938
1909 if (spec->board_config == STAC_MACMINI)
1910 spec->gpio_mute = 1;
1911
1912 codec->patch_ops = stac92xx_patch_ops; 1939 codec->patch_ops = stac92xx_patch_ops;
1913 1940
1914 return 0; 1941 return 0;