aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorNicolas Boichat <nicolas@boichat.ch>2008-07-21 10:18:01 -0400
committerTakashi Iwai <tiwai@suse.de>2008-07-27 04:22:27 -0400
commit536319afd1f25383009c0c88f6fb00104f49c178 (patch)
tree82790c97fccf0396a84b52f447b9dfd0fa3292b0 /sound
parentb15ebe2616289da258f85b3ff142fca237ef9f59 (diff)
ALSA: Allow to force model to intel-mac-v3 in snd_hda_intel (sigmatel).
Currently, even if you pass model=intel-mac-v3 as a module parameter to snd_hda_intel, the function patch_stac922x (patch_sigmatel.c) will still try to auto-detect the model type. This is a problem on my MacBook Pro 1st generation, which needs intel-mac-v3, but sometimes incorrectly reports 0x00000100 as subsystem id, which causes the switch in patch_stac922x to select intel-mac-v4. To fix this, I added a new model called intel-mac-auto, so in case no module parameter is passed, and an Intel Mac board is detected, the model will be automatically detected, while no detection will be done if the model is forced to intel-mac-v3. This problem has been around for quite a while, and I used to fix it by moving the case statement for 0x00000100 in patch_stac922x so that intel-mac-v3 is chosen. Another way to fix the problem would be to check if a module parameter was set directly in patch_stac922x, using something like this: if (spec->board_config == STAC_INTEL_MAC_V3 && !codec->bus->modelname) { But I think it is less elegant (if you prefer that way, I can prepare a patch). Signed-off-by: Nicolas Boichat <nicolas@boichat.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 08cb77f51880..7fdafcb0015d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -94,6 +94,9 @@ enum {
94 STAC_INTEL_MAC_V3, 94 STAC_INTEL_MAC_V3,
95 STAC_INTEL_MAC_V4, 95 STAC_INTEL_MAC_V4,
96 STAC_INTEL_MAC_V5, 96 STAC_INTEL_MAC_V5,
97 STAC_INTEL_MAC_AUTO, /* This model is selected if no module parameter
98 * is given, one of the above models will be
99 * chosen according to the subsystem id. */
97 /* for backward compatibility */ 100 /* for backward compatibility */
98 STAC_MACMINI, 101 STAC_MACMINI,
99 STAC_MACBOOK, 102 STAC_MACBOOK,
@@ -1483,6 +1486,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
1483 [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, 1486 [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs,
1484 [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, 1487 [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs,
1485 [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, 1488 [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs,
1489 [STAC_INTEL_MAC_AUTO] = intel_mac_v3_pin_configs,
1486 /* for backward compatibility */ 1490 /* for backward compatibility */
1487 [STAC_MACMINI] = intel_mac_v3_pin_configs, 1491 [STAC_MACMINI] = intel_mac_v3_pin_configs,
1488 [STAC_MACBOOK] = intel_mac_v5_pin_configs, 1492 [STAC_MACBOOK] = intel_mac_v5_pin_configs,
@@ -1505,6 +1509,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
1505 [STAC_INTEL_MAC_V3] = "intel-mac-v3", 1509 [STAC_INTEL_MAC_V3] = "intel-mac-v3",
1506 [STAC_INTEL_MAC_V4] = "intel-mac-v4", 1510 [STAC_INTEL_MAC_V4] = "intel-mac-v4",
1507 [STAC_INTEL_MAC_V5] = "intel-mac-v5", 1511 [STAC_INTEL_MAC_V5] = "intel-mac-v5",
1512 [STAC_INTEL_MAC_AUTO] = "intel-mac-auto",
1508 /* for backward compatibility */ 1513 /* for backward compatibility */
1509 [STAC_MACMINI] = "macmini", 1514 [STAC_MACMINI] = "macmini",
1510 [STAC_MACBOOK] = "macbook", 1515 [STAC_MACBOOK] = "macbook",
@@ -1576,9 +1581,9 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
1576 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, 1581 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
1577 "Intel D945P", STAC_D945GTP5), 1582 "Intel D945P", STAC_D945GTP5),
1578 /* other systems */ 1583 /* other systems */
1579 /* Apple Mac Mini (early 2006) */ 1584 /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */
1580 SND_PCI_QUIRK(0x8384, 0x7680, 1585 SND_PCI_QUIRK(0x8384, 0x7680,
1581 "Mac Mini", STAC_INTEL_MAC_V3), 1586 "Mac", STAC_INTEL_MAC_AUTO),
1582 /* Dell systems */ 1587 /* Dell systems */
1583 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7, 1588 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7,
1584 "unknown Dell", STAC_922X_DELL_D81), 1589 "unknown Dell", STAC_922X_DELL_D81),
@@ -3725,7 +3730,7 @@ static int patch_stac922x(struct hda_codec *codec)
3725 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, 3730 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
3726 stac922x_models, 3731 stac922x_models,
3727 stac922x_cfg_tbl); 3732 stac922x_cfg_tbl);
3728 if (spec->board_config == STAC_INTEL_MAC_V3) { 3733 if (spec->board_config == STAC_INTEL_MAC_AUTO) {
3729 spec->gpio_mask = spec->gpio_dir = 0x03; 3734 spec->gpio_mask = spec->gpio_dir = 0x03;
3730 spec->gpio_data = 0x03; 3735 spec->gpio_data = 0x03;
3731 /* Intel Macs have all same PCI SSID, so we need to check 3736 /* Intel Macs have all same PCI SSID, so we need to check
@@ -3757,6 +3762,9 @@ static int patch_stac922x(struct hda_codec *codec)
3757 case 0x106b2200: 3762 case 0x106b2200:
3758 spec->board_config = STAC_INTEL_MAC_V5; 3763 spec->board_config = STAC_INTEL_MAC_V5;
3759 break; 3764 break;
3765 default:
3766 spec->board_config = STAC_INTEL_MAC_V3;
3767 break;
3760 } 3768 }
3761 } 3769 }
3762 3770