aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorGuillaume Munch <diabo@free.fr>2006-08-22 11:15:47 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:43:47 -0400
commit6d8590650eb81d2c869c7adf4b469071cec11eee (patch)
tree99f72606dce6cc5e800019d7bd004559006fd63e /sound/pci
parent7b89190cf6ecd5075c272b4ec12f65a4ce45a762 (diff)
[ALSA] hda-codec - Support for SigmaTel 9872
- AR11M and AR11S uses the same chip hence we claim to support the AR Series. - Added commentary about STAC9225s which shares the same id as CXD9872RD. - Added entry for 7662 but won't work automatically until pci_subdevice is known. - 'vaio' model now corresponds to CXD9872RD_VAIO for backward compat. - Replaced STAC766x_VAIO with CXD9872RD_VAIO, STAC9872AK_VAIO, STAC9872K_VAIO and CXD9872AKD_VAIO - Added 'vaio-ar' model for potential future modifications. Signed-off-by: Guillaume Munch <diabo@free.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c109
1 files changed, 94 insertions, 15 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 73ca566e9eb7..139d73e18a3c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1563,7 +1563,7 @@ static int patch_stac9205(struct hda_codec *codec)
1563} 1563}
1564 1564
1565/* 1565/*
1566 * STAC 7661(?) and 7664 hack 1566 * STAC9872 hack
1567 */ 1567 */
1568 1568
1569/* static config for Sony VAIO FE550G and Sony VAIO AR */ 1569/* static config for Sony VAIO FE550G and Sony VAIO AR */
@@ -1597,6 +1597,23 @@ static struct hda_verb vaio_init[] = {
1597 {} 1597 {}
1598}; 1598};
1599 1599
1600static struct hda_verb vaio_ar_init[] = {
1601 {0x0a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, /* HP <- 0x2 */
1602 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Speaker <- 0x5 */
1603 {0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? (<- 0x2) */
1604 {0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* CD */
1605/* {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },*/ /* Optical Out */
1606 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? */
1607 {0x15, AC_VERB_SET_CONNECT_SEL, 0x2}, /* mic-sel: 0a,0d,14,02 */
1608 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* HP */
1609 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Speaker */
1610/* {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},*/ /* Optical Out */
1611 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* capture sw/vol -> 0x8 */
1612 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, /* CD-in -> 0x6 */
1613 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Mic-in -> 0x9 */
1614 {}
1615};
1616
1600/* bind volumes of both NID 0x02 and 0x05 */ 1617/* bind volumes of both NID 0x02 and 0x05 */
1601static int vaio_master_vol_put(struct snd_kcontrol *kcontrol, 1618static int vaio_master_vol_put(struct snd_kcontrol *kcontrol,
1602 struct snd_ctl_elem_value *ucontrol) 1619 struct snd_ctl_elem_value *ucontrol)
@@ -1667,7 +1684,40 @@ static struct snd_kcontrol_new vaio_mixer[] = {
1667 {} 1684 {}
1668}; 1685};
1669 1686
1670static struct hda_codec_ops stac766x_patch_ops = { 1687static struct snd_kcontrol_new vaio_ar_mixer[] = {
1688 {
1689 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1690 .name = "Master Playback Volume",
1691 .info = snd_hda_mixer_amp_volume_info,
1692 .get = snd_hda_mixer_amp_volume_get,
1693 .put = vaio_master_vol_put,
1694 .private_value = HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
1695 },
1696 {
1697 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1698 .name = "Master Playback Switch",
1699 .info = snd_hda_mixer_amp_switch_info,
1700 .get = snd_hda_mixer_amp_switch_get,
1701 .put = vaio_master_sw_put,
1702 .private_value = HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
1703 },
1704 /* HDA_CODEC_VOLUME("CD Capture Volume", 0x07, 0, HDA_INPUT), */
1705 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_INPUT),
1706 HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_INPUT),
1707 /*HDA_CODEC_MUTE("Optical Out Switch", 0x10, 0, HDA_OUTPUT),
1708 HDA_CODEC_VOLUME("Optical Out Volume", 0x10, 0, HDA_OUTPUT),*/
1709 {
1710 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1711 .name = "Capture Source",
1712 .count = 1,
1713 .info = stac92xx_mux_enum_info,
1714 .get = stac92xx_mux_enum_get,
1715 .put = stac92xx_mux_enum_put,
1716 },
1717 {}
1718};
1719
1720static struct hda_codec_ops stac9872_patch_ops = {
1671 .build_controls = stac92xx_build_controls, 1721 .build_controls = stac92xx_build_controls,
1672 .build_pcms = stac92xx_build_pcms, 1722 .build_pcms = stac92xx_build_pcms,
1673 .init = stac92xx_init, 1723 .init = stac92xx_init,
@@ -1677,25 +1727,34 @@ static struct hda_codec_ops stac766x_patch_ops = {
1677#endif 1727#endif
1678}; 1728};
1679 1729
1680enum { STAC766x_VAIO }; 1730enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */
1681 1731 CXD9872RD_VAIO,
1682static struct hda_board_config stac766x_cfg_tbl[] = { 1732 /* Unknown. id=0x83847662 and subsys=0x104D1200 or 104D1000. */
1683 { .modelname = "vaio", .config = STAC766x_VAIO }, 1733 STAC9872AK_VAIO,
1734 /* Unknown. id=0x83847661 and subsys=0x104D1200. */
1735 STAC9872K_VAIO,
1736 /* AR Series. id=0x83847664 and subsys=104D1300 */
1737 CXD9872AKD_VAIO
1738 };
1739
1740static struct hda_board_config stac9872_cfg_tbl[] = {
1741 { .modelname = "vaio", .config = CXD9872RD_VAIO },
1742 { .modelname = "vaio-ar", .config = CXD9872AKD_VAIO },
1684 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81e6, 1743 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81e6,
1685 .config = STAC766x_VAIO }, 1744 .config = CXD9872RD_VAIO },
1686 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef, 1745 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef,
1687 .config = STAC766x_VAIO }, 1746 .config = CXD9872RD_VAIO },
1688 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81fd, 1747 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81fd,
1689 .config = STAC766x_VAIO }, 1748 .config = CXD9872AKD_VAIO },
1690 {} 1749 {}
1691}; 1750};
1692 1751
1693static int patch_stac766x(struct hda_codec *codec) 1752static int patch_stac9872(struct hda_codec *codec)
1694{ 1753{
1695 struct sigmatel_spec *spec; 1754 struct sigmatel_spec *spec;
1696 int board_config; 1755 int board_config;
1697 1756
1698 board_config = snd_hda_check_board_config(codec, stac766x_cfg_tbl); 1757 board_config = snd_hda_check_board_config(codec, stac9872_cfg_tbl);
1699 if (board_config < 0) 1758 if (board_config < 0)
1700 /* unknown config, let generic-parser do its job... */ 1759 /* unknown config, let generic-parser do its job... */
1701 return snd_hda_parse_generic_codec(codec); 1760 return snd_hda_parse_generic_codec(codec);
@@ -1706,7 +1765,9 @@ static int patch_stac766x(struct hda_codec *codec)
1706 1765
1707 codec->spec = spec; 1766 codec->spec = spec;
1708 switch (board_config) { 1767 switch (board_config) {
1709 case STAC766x_VAIO: 1768 case CXD9872RD_VAIO:
1769 case STAC9872AK_VAIO:
1770 case STAC9872K_VAIO:
1710 spec->mixer = vaio_mixer; 1771 spec->mixer = vaio_mixer;
1711 spec->init = vaio_init; 1772 spec->init = vaio_init;
1712 spec->multiout.max_channels = 2; 1773 spec->multiout.max_channels = 2;
@@ -1718,9 +1779,22 @@ static int patch_stac766x(struct hda_codec *codec)
1718 spec->input_mux = &vaio_mux; 1779 spec->input_mux = &vaio_mux;
1719 spec->mux_nids = vaio_mux_nids; 1780 spec->mux_nids = vaio_mux_nids;
1720 break; 1781 break;
1782
1783 case CXD9872AKD_VAIO:
1784 spec->mixer = vaio_ar_mixer;
1785 spec->init = vaio_ar_init;
1786 spec->multiout.max_channels = 2;
1787 spec->multiout.num_dacs = ARRAY_SIZE(vaio_dacs);
1788 spec->multiout.dac_nids = vaio_dacs;
1789 spec->multiout.hp_nid = VAIO_HP_DAC;
1790 spec->num_adcs = ARRAY_SIZE(vaio_adcs);
1791 spec->adc_nids = vaio_adcs;
1792 spec->input_mux = &vaio_mux;
1793 spec->mux_nids = vaio_mux_nids;
1794 break;
1721 } 1795 }
1722 1796
1723 codec->patch_ops = stac766x_patch_ops; 1797 codec->patch_ops = stac9872_patch_ops;
1724 return 0; 1798 return 0;
1725} 1799}
1726 1800
@@ -1752,7 +1826,13 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = {
1752 { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x }, 1826 { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x },
1753 { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x }, 1827 { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
1754 { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x }, 1828 { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
1755 { .id = 0x83847661, .name = "STAC7661", .patch = patch_stac766x }, 1829 /* The following does not take into account .id=0x83847661 when subsys =
1830 * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
1831 * currently not fully supported.
1832 */
1833 { .id = 0x83847661, .name = "CXD9872RD/K", .patch = patch_stac9872 },
1834 { .id = 0x83847662, .name = "STAC9872AK", .patch = patch_stac9872 },
1835 { .id = 0x83847664, .name = "CXD9872AKD", .patch = patch_stac9872 },
1756 { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 }, 1836 { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 },
1757 { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 }, 1837 { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 },
1758 { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 }, 1838 { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 },
@@ -1761,6 +1841,5 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = {
1761 { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 }, 1841 { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 },
1762 { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 }, 1842 { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 },
1763 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, 1843 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 },
1764 { .id = 0x83847664, .name = "STAC7664", .patch = patch_stac766x },
1765 {} /* terminator */ 1844 {} /* terminator */
1766}; 1845};