diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 89 |
1 files changed, 81 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 9e07f44ab28a..e70ef0505304 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -93,7 +93,13 @@ enum { | |||
93 | 93 | ||
94 | enum { | 94 | enum { |
95 | STAC_925x_REF, | 95 | STAC_925x_REF, |
96 | STAC_M1, | ||
97 | STAC_M1_2, | ||
98 | STAC_M2, | ||
96 | STAC_M2_2, | 99 | STAC_M2_2, |
100 | STAC_M3, | ||
101 | STAC_M5, | ||
102 | STAC_M6, | ||
97 | STAC_MA6, | 103 | STAC_MA6, |
98 | STAC_PA6, | 104 | STAC_PA6, |
99 | STAC_925x_MODELS | 105 | STAC_925x_MODELS |
@@ -1600,11 +1606,40 @@ static unsigned int ref925x_pin_configs[8] = { | |||
1600 | 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, | 1606 | 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, |
1601 | }; | 1607 | }; |
1602 | 1608 | ||
1609 | static unsigned int stac925xM1_pin_configs[8] = { | ||
1610 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1611 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1612 | }; | ||
1613 | static unsigned int stac925xM1_2_pin_configs[8] = { | ||
1614 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1615 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1616 | }; | ||
1617 | static unsigned int stac925xM2_pin_configs[8] = { | ||
1618 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1619 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1620 | }; | ||
1621 | |||
1622 | static unsigned int stac925xM3_pin_configs[8] = { | ||
1623 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1624 | 0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3, | ||
1625 | }; | ||
1626 | static unsigned int stac925xM5_pin_configs[8] = { | ||
1627 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1628 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | ||
1629 | }; | ||
1630 | |||
1631 | /* Original M6 entry at .ini file */ | ||
1632 | static unsigned int stac925xM6_pin_configs[8] = { | ||
1633 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | ||
1634 | 0x40a000f0, 0x90100210, 0x400003f1, 0x90330320, | ||
1635 | }; | ||
1636 | |||
1603 | static unsigned int stac925x_MA6_pin_configs[8] = { | 1637 | static unsigned int stac925x_MA6_pin_configs[8] = { |
1604 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | 1638 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, |
1605 | 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, | 1639 | 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, |
1606 | }; | 1640 | }; |
1607 | 1641 | ||
1642 | /* This entry should be M2 */ | ||
1608 | static unsigned int stac925x_PA6_pin_configs[8] = { | 1643 | static unsigned int stac925x_PA6_pin_configs[8] = { |
1609 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | 1644 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, |
1610 | 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e, | 1645 | 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e, |
@@ -1617,27 +1652,55 @@ static unsigned int stac925xM2_2_pin_configs[8] = { | |||
1617 | 1652 | ||
1618 | static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { | 1653 | static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { |
1619 | [STAC_REF] = ref925x_pin_configs, | 1654 | [STAC_REF] = ref925x_pin_configs, |
1655 | [STAC_M1] = stac925xM1_pin_configs, | ||
1656 | [STAC_M1_2] = stac925xM1_2_pin_configs, | ||
1657 | [STAC_M2] = stac925xM2_pin_configs, | ||
1620 | [STAC_M2_2] = stac925xM2_2_pin_configs, | 1658 | [STAC_M2_2] = stac925xM2_2_pin_configs, |
1659 | [STAC_M3] = stac925xM3_pin_configs, | ||
1660 | [STAC_M5] = stac925xM5_pin_configs, | ||
1661 | [STAC_M6] = stac925xM6_pin_configs, | ||
1621 | [STAC_MA6] = stac925x_MA6_pin_configs, | 1662 | [STAC_MA6] = stac925x_MA6_pin_configs, |
1622 | [STAC_PA6] = stac925x_PA6_pin_configs, | 1663 | [STAC_PA6] = stac925x_PA6_pin_configs, |
1623 | }; | 1664 | }; |
1624 | 1665 | ||
1625 | static const char *stac925x_models[STAC_925x_MODELS] = { | 1666 | static const char *stac925x_models[STAC_925x_MODELS] = { |
1626 | [STAC_REF] = "ref", | 1667 | [STAC_REF] = "ref", |
1668 | [STAC_M1] = "m1", | ||
1669 | [STAC_M1_2] = "m1-2", | ||
1670 | [STAC_M2] = "m2", | ||
1627 | [STAC_M2_2] = "m2-2", | 1671 | [STAC_M2_2] = "m2-2", |
1628 | [STAC_MA6] = "m6", | 1672 | [STAC_M3] = "m3", |
1673 | [STAC_M5] = "m5", | ||
1674 | [STAC_M6] = "m6", | ||
1675 | [STAC_MA6] = "ma6", | ||
1629 | [STAC_PA6] = "pa6", | 1676 | [STAC_PA6] = "pa6", |
1630 | }; | 1677 | }; |
1631 | 1678 | ||
1632 | static struct snd_pci_quirk stac925x_cfg_tbl[] = { | 1679 | static struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = { |
1633 | /* SigmaTel reference board */ | ||
1634 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | ||
1635 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), | ||
1636 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), | 1680 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), |
1637 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), | 1681 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), |
1682 | |||
1638 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), | 1683 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), |
1639 | SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6), | 1684 | SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6), |
1640 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2), | 1685 | SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2), |
1686 | |||
1687 | /* Not sure about the brand name for those */ | ||
1688 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1), | ||
1689 | SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3), | ||
1690 | SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6), | ||
1691 | SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2), | ||
1692 | |||
1693 | {} /* terminator */ | ||
1694 | }; | ||
1695 | |||
1696 | static struct snd_pci_quirk stac925x_cfg_tbl[] = { | ||
1697 | /* SigmaTel reference board */ | ||
1698 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | ||
1699 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), | ||
1700 | |||
1701 | /* Default table for unknown ID */ | ||
1702 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2), | ||
1703 | |||
1641 | {} /* terminator */ | 1704 | {} /* terminator */ |
1642 | }; | 1705 | }; |
1643 | 1706 | ||
@@ -4371,12 +4434,22 @@ static int patch_stac925x(struct hda_codec *codec) | |||
4371 | codec->spec = spec; | 4434 | codec->spec = spec; |
4372 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 4435 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
4373 | spec->pin_nids = stac925x_pin_nids; | 4436 | spec->pin_nids = stac925x_pin_nids; |
4374 | spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, | 4437 | |
4438 | /* Check first for codec ID */ | ||
4439 | spec->board_config = snd_hda_check_board_codec_sid_config(codec, | ||
4440 | STAC_925x_MODELS, | ||
4441 | stac925x_models, | ||
4442 | stac925x_codec_id_cfg_tbl); | ||
4443 | |||
4444 | /* Now checks for PCI ID, if codec ID is not found */ | ||
4445 | if (spec->board_config < 0) | ||
4446 | spec->board_config = snd_hda_check_board_config(codec, | ||
4447 | STAC_925x_MODELS, | ||
4375 | stac925x_models, | 4448 | stac925x_models, |
4376 | stac925x_cfg_tbl); | 4449 | stac925x_cfg_tbl); |
4377 | again: | 4450 | again: |
4378 | if (spec->board_config < 0) { | 4451 | if (spec->board_config < 0) { |
4379 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," | 4452 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," |
4380 | "using BIOS defaults\n"); | 4453 | "using BIOS defaults\n"); |
4381 | err = stac92xx_save_bios_config_regs(codec); | 4454 | err = stac92xx_save_bios_config_regs(codec); |
4382 | } else | 4455 | } else |