diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-14 08:20:16 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-14 08:21:16 -0500 |
commit | d2077d40cbfc8c08cacd153f5b02f9b177f10da0 (patch) | |
tree | 7efc42532c248f309075e65d0e37965c7550b142 /sound/pci/hda | |
parent | d39a3ae8215ad90e68ca5fbbced507b07052018b (diff) |
ALSA: hda - Use standard fixup table for STAC925x
Similar like the previous commit, convert patch_stac925x() to use the
standard fixup table.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 226 |
1 files changed, 141 insertions, 85 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index e5dffd25d83a..4c98b3009e51 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -123,7 +123,6 @@ enum { | |||
123 | }; | 123 | }; |
124 | 124 | ||
125 | enum { | 125 | enum { |
126 | STAC_925x_AUTO, | ||
127 | STAC_925x_REF, | 126 | STAC_925x_REF, |
128 | STAC_M1, | 127 | STAC_M1, |
129 | STAC_M1_2, | 128 | STAC_M1_2, |
@@ -1618,70 +1617,159 @@ static const struct snd_pci_quirk stac9200_fixup_tbl[] = { | |||
1618 | {} /* terminator */ | 1617 | {} /* terminator */ |
1619 | }; | 1618 | }; |
1620 | 1619 | ||
1621 | static const unsigned int ref925x_pin_configs[8] = { | 1620 | static const struct hda_pintbl ref925x_pin_configs[] = { |
1622 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | 1621 | { 0x07, 0x40c003f0 }, |
1623 | 0x90a70320, 0x02214210, 0x01019020, 0x9033032e, | 1622 | { 0x08, 0x424503f2 }, |
1623 | { 0x0a, 0x01813022 }, | ||
1624 | { 0x0b, 0x02a19021 }, | ||
1625 | { 0x0c, 0x90a70320 }, | ||
1626 | { 0x0d, 0x02214210 }, | ||
1627 | { 0x10, 0x01019020 }, | ||
1628 | { 0x11, 0x9033032e }, | ||
1629 | {} | ||
1624 | }; | 1630 | }; |
1625 | 1631 | ||
1626 | static const unsigned int stac925xM1_pin_configs[8] = { | 1632 | static const struct hda_pintbl stac925xM1_pin_configs[] = { |
1627 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1633 | { 0x07, 0x40c003f4 }, |
1628 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | 1634 | { 0x08, 0x424503f2 }, |
1635 | { 0x0a, 0x400000f3 }, | ||
1636 | { 0x0b, 0x02a19020 }, | ||
1637 | { 0x0c, 0x40a000f0 }, | ||
1638 | { 0x0d, 0x90100210 }, | ||
1639 | { 0x10, 0x400003f1 }, | ||
1640 | { 0x11, 0x9033032e }, | ||
1641 | {} | ||
1629 | }; | 1642 | }; |
1630 | 1643 | ||
1631 | static const unsigned int stac925xM1_2_pin_configs[8] = { | 1644 | static const struct hda_pintbl stac925xM1_2_pin_configs[] = { |
1632 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1645 | { 0x07, 0x40c003f4 }, |
1633 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | 1646 | { 0x08, 0x424503f2 }, |
1647 | { 0x0a, 0x400000f3 }, | ||
1648 | { 0x0b, 0x02a19020 }, | ||
1649 | { 0x0c, 0x40a000f0 }, | ||
1650 | { 0x0d, 0x90100210 }, | ||
1651 | { 0x10, 0x400003f1 }, | ||
1652 | { 0x11, 0x9033032e }, | ||
1653 | {} | ||
1634 | }; | 1654 | }; |
1635 | 1655 | ||
1636 | static const unsigned int stac925xM2_pin_configs[8] = { | 1656 | static const struct hda_pintbl stac925xM2_pin_configs[] = { |
1637 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1657 | { 0x07, 0x40c003f4 }, |
1638 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | 1658 | { 0x08, 0x424503f2 }, |
1659 | { 0x0a, 0x400000f3 }, | ||
1660 | { 0x0b, 0x02a19020 }, | ||
1661 | { 0x0c, 0x40a000f0 }, | ||
1662 | { 0x0d, 0x90100210 }, | ||
1663 | { 0x10, 0x400003f1 }, | ||
1664 | { 0x11, 0x9033032e }, | ||
1665 | {} | ||
1639 | }; | 1666 | }; |
1640 | 1667 | ||
1641 | static const unsigned int stac925xM2_2_pin_configs[8] = { | 1668 | static const struct hda_pintbl stac925xM2_2_pin_configs[] = { |
1642 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1669 | { 0x07, 0x40c003f4 }, |
1643 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | 1670 | { 0x08, 0x424503f2 }, |
1671 | { 0x0a, 0x400000f3 }, | ||
1672 | { 0x0b, 0x02a19020 }, | ||
1673 | { 0x0c, 0x40a000f0 }, | ||
1674 | { 0x0d, 0x90100210 }, | ||
1675 | { 0x10, 0x400003f1 }, | ||
1676 | { 0x11, 0x9033032e }, | ||
1677 | {} | ||
1644 | }; | 1678 | }; |
1645 | 1679 | ||
1646 | static const unsigned int stac925xM3_pin_configs[8] = { | 1680 | static const struct hda_pintbl stac925xM3_pin_configs[] = { |
1647 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1681 | { 0x07, 0x40c003f4 }, |
1648 | 0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3, | 1682 | { 0x08, 0x424503f2 }, |
1683 | { 0x0a, 0x400000f3 }, | ||
1684 | { 0x0b, 0x02a19020 }, | ||
1685 | { 0x0c, 0x40a000f0 }, | ||
1686 | { 0x0d, 0x90100210 }, | ||
1687 | { 0x10, 0x400003f1 }, | ||
1688 | { 0x11, 0x503303f3 }, | ||
1689 | {} | ||
1649 | }; | 1690 | }; |
1650 | 1691 | ||
1651 | static const unsigned int stac925xM5_pin_configs[8] = { | 1692 | static const struct hda_pintbl stac925xM5_pin_configs[] = { |
1652 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1693 | { 0x07, 0x40c003f4 }, |
1653 | 0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e, | 1694 | { 0x08, 0x424503f2 }, |
1695 | { 0x0a, 0x400000f3 }, | ||
1696 | { 0x0b, 0x02a19020 }, | ||
1697 | { 0x0c, 0x40a000f0 }, | ||
1698 | { 0x0d, 0x90100210 }, | ||
1699 | { 0x10, 0x400003f1 }, | ||
1700 | { 0x11, 0x9033032e }, | ||
1701 | {} | ||
1654 | }; | 1702 | }; |
1655 | 1703 | ||
1656 | static const unsigned int stac925xM6_pin_configs[8] = { | 1704 | static const struct hda_pintbl stac925xM6_pin_configs[] = { |
1657 | 0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020, | 1705 | { 0x07, 0x40c003f4 }, |
1658 | 0x40a000f0, 0x90100210, 0x400003f1, 0x90330320, | 1706 | { 0x08, 0x424503f2 }, |
1707 | { 0x0a, 0x400000f3 }, | ||
1708 | { 0x0b, 0x02a19020 }, | ||
1709 | { 0x0c, 0x40a000f0 }, | ||
1710 | { 0x0d, 0x90100210 }, | ||
1711 | { 0x10, 0x400003f1 }, | ||
1712 | { 0x11, 0x90330320 }, | ||
1713 | {} | ||
1659 | }; | 1714 | }; |
1660 | 1715 | ||
1661 | static const unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { | 1716 | static const struct hda_fixup stac925x_fixups[] = { |
1662 | [STAC_REF] = ref925x_pin_configs, | 1717 | [STAC_REF] = { |
1663 | [STAC_M1] = stac925xM1_pin_configs, | 1718 | .type = HDA_FIXUP_PINS, |
1664 | [STAC_M1_2] = stac925xM1_2_pin_configs, | 1719 | .v.pins = ref925x_pin_configs, |
1665 | [STAC_M2] = stac925xM2_pin_configs, | 1720 | }, |
1666 | [STAC_M2_2] = stac925xM2_2_pin_configs, | 1721 | [STAC_M1] = { |
1667 | [STAC_M3] = stac925xM3_pin_configs, | 1722 | .type = HDA_FIXUP_PINS, |
1668 | [STAC_M5] = stac925xM5_pin_configs, | 1723 | .v.pins = stac925xM1_pin_configs, |
1669 | [STAC_M6] = stac925xM6_pin_configs, | 1724 | }, |
1725 | [STAC_M1_2] = { | ||
1726 | .type = HDA_FIXUP_PINS, | ||
1727 | .v.pins = stac925xM1_2_pin_configs, | ||
1728 | }, | ||
1729 | [STAC_M2] = { | ||
1730 | .type = HDA_FIXUP_PINS, | ||
1731 | .v.pins = stac925xM2_pin_configs, | ||
1732 | }, | ||
1733 | [STAC_M2_2] = { | ||
1734 | .type = HDA_FIXUP_PINS, | ||
1735 | .v.pins = stac925xM2_2_pin_configs, | ||
1736 | }, | ||
1737 | [STAC_M3] = { | ||
1738 | .type = HDA_FIXUP_PINS, | ||
1739 | .v.pins = stac925xM3_pin_configs, | ||
1740 | }, | ||
1741 | [STAC_M5] = { | ||
1742 | .type = HDA_FIXUP_PINS, | ||
1743 | .v.pins = stac925xM5_pin_configs, | ||
1744 | }, | ||
1745 | [STAC_M6] = { | ||
1746 | .type = HDA_FIXUP_PINS, | ||
1747 | .v.pins = stac925xM6_pin_configs, | ||
1748 | }, | ||
1670 | }; | 1749 | }; |
1671 | 1750 | ||
1672 | static const char * const stac925x_models[STAC_925x_MODELS] = { | 1751 | static const struct hda_model_fixup stac925x_models[] = { |
1673 | [STAC_925x_AUTO] = "auto", | 1752 | { .id = STAC_REF, .name = "ref" }, |
1674 | [STAC_REF] = "ref", | 1753 | { .id = STAC_M1, .name = "m1" }, |
1675 | [STAC_M1] = "m1", | 1754 | { .id = STAC_M1_2, .name = "m1-2" }, |
1676 | [STAC_M1_2] = "m1-2", | 1755 | { .id = STAC_M2, .name = "m2" }, |
1677 | [STAC_M2] = "m2", | 1756 | { .id = STAC_M2_2, .name = "m2-2" }, |
1678 | [STAC_M2_2] = "m2-2", | 1757 | { .id = STAC_M3, .name = "m3" }, |
1679 | [STAC_M3] = "m3", | 1758 | { .id = STAC_M5, .name = "m5" }, |
1680 | [STAC_M5] = "m5", | 1759 | { .id = STAC_M6, .name = "m6" }, |
1681 | [STAC_M6] = "m6", | 1760 | {} |
1682 | }; | 1761 | }; |
1683 | 1762 | ||
1684 | static const struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = { | 1763 | static const struct snd_pci_quirk stac925x_fixup_tbl[] = { |
1764 | /* SigmaTel reference board */ | ||
1765 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | ||
1766 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF), | ||
1767 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), | ||
1768 | |||
1769 | /* Default table for unknown ID */ | ||
1770 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2), | ||
1771 | |||
1772 | /* gateway machines are checked via codec ssid */ | ||
1685 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2), | 1773 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2), |
1686 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5), | 1774 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5), |
1687 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1), | 1775 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1), |
@@ -1695,18 +1783,6 @@ static const struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = { | |||
1695 | {} /* terminator */ | 1783 | {} /* terminator */ |
1696 | }; | 1784 | }; |
1697 | 1785 | ||
1698 | static const struct snd_pci_quirk stac925x_cfg_tbl[] = { | ||
1699 | /* SigmaTel reference board */ | ||
1700 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | ||
1701 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF), | ||
1702 | SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), | ||
1703 | |||
1704 | /* Default table for unknown ID */ | ||
1705 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2), | ||
1706 | |||
1707 | {} /* terminator */ | ||
1708 | }; | ||
1709 | |||
1710 | static const unsigned int ref92hd73xx_pin_configs[13] = { | 1786 | static const unsigned int ref92hd73xx_pin_configs[13] = { |
1711 | 0x02214030, 0x02a19040, 0x01a19020, 0x02214030, | 1787 | 0x02214030, 0x02a19040, 0x01a19020, 0x02214030, |
1712 | 0x0181302e, 0x01014010, 0x01014020, 0x01014030, | 1788 | 0x0181302e, 0x01014010, 0x01014020, 0x01014030, |
@@ -5401,25 +5477,8 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5401 | spec = codec->spec; | 5477 | spec = codec->spec; |
5402 | spec->linear_tone_beep = 1; | 5478 | spec->linear_tone_beep = 1; |
5403 | 5479 | ||
5404 | /* Check first for codec ID */ | 5480 | snd_hda_pick_fixup(codec, stac925x_models, stac925x_fixup_tbl, |
5405 | spec->board_config = snd_hda_check_board_codec_sid_config(codec, | 5481 | stac925x_fixups); |
5406 | STAC_925x_MODELS, | ||
5407 | stac925x_models, | ||
5408 | stac925x_codec_id_cfg_tbl); | ||
5409 | |||
5410 | /* Now checks for PCI ID, if codec ID is not found */ | ||
5411 | if (spec->board_config < 0) | ||
5412 | spec->board_config = snd_hda_check_board_config(codec, | ||
5413 | STAC_925x_MODELS, | ||
5414 | stac925x_models, | ||
5415 | stac925x_cfg_tbl); | ||
5416 | again: | ||
5417 | if (spec->board_config < 0) | ||
5418 | snd_printdd(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", | ||
5419 | codec->chip_name); | ||
5420 | else | ||
5421 | stac92xx_set_config_regs(codec, | ||
5422 | stac925x_brd_tbl[spec->board_config]); | ||
5423 | 5482 | ||
5424 | spec->multiout.max_channels = 2; | 5483 | spec->multiout.max_channels = 2; |
5425 | spec->multiout.num_dacs = 1; | 5484 | spec->multiout.num_dacs = 1; |
@@ -5444,22 +5503,17 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5444 | break; | 5503 | break; |
5445 | } | 5504 | } |
5446 | 5505 | ||
5447 | spec->init = stac925x_core_init; | 5506 | snd_hda_add_verbs(codec, stac925x_core_init); |
5448 | spec->mixer = stac925x_mixer; | 5507 | spec->mixer = stac925x_mixer; |
5449 | spec->num_caps = 1; | 5508 | spec->num_caps = 1; |
5450 | spec->capvols = stac925x_capvols; | 5509 | spec->capvols = stac925x_capvols; |
5451 | spec->capsws = stac925x_capsws; | 5510 | spec->capsws = stac925x_capsws; |
5452 | 5511 | ||
5512 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | ||
5513 | |||
5453 | err = stac92xx_parse_auto_config(codec); | 5514 | err = stac92xx_parse_auto_config(codec); |
5454 | if (!err) { | 5515 | if (!err) |
5455 | if (spec->board_config < 0) { | ||
5456 | printk(KERN_WARNING "hda_codec: No auto-config is " | ||
5457 | "available, default to model=ref\n"); | ||
5458 | spec->board_config = STAC_925x_REF; | ||
5459 | goto again; | ||
5460 | } | ||
5461 | err = -EINVAL; | 5516 | err = -EINVAL; |
5462 | } | ||
5463 | if (err < 0) { | 5517 | if (err < 0) { |
5464 | stac92xx_free(codec); | 5518 | stac92xx_free(codec); |
5465 | return err; | 5519 | return err; |
@@ -5467,6 +5521,8 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5467 | 5521 | ||
5468 | codec->patch_ops = stac92xx_patch_ops; | 5522 | codec->patch_ops = stac92xx_patch_ops; |
5469 | 5523 | ||
5524 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); | ||
5525 | |||
5470 | return 0; | 5526 | return 0; |
5471 | } | 5527 | } |
5472 | 5528 | ||