aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-01-24 04:47:02 -0500
committerTakashi Iwai <tiwai@suse.de>2010-01-24 05:09:30 -0500
commit2c7a3fb3f81df7318c70d2b8ecbd87f008e28d52 (patch)
treef093831c67365b93b19dcd21a20e5f399ec7e7a4 /sound/pci/hda/patch_conexant.c
parentfaddaa5d1c0cd29629c9c7e7a9d41ecb3149a064 (diff)
ALSA: hda - Merge playback controls for Cx5051 codec models
All cx5051 codec models have the same Master playback mixer definitions. Merge them together. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c62
1 files changed, 13 insertions, 49 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 56dda9c7f899..e24bec6ca23a 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1689,13 +1689,7 @@ static void cxt5051_hp_unsol_event(struct hda_codec *codec,
1689 conexant_report_jack(codec, nid); 1689 conexant_report_jack(codec, nid);
1690} 1690}
1691 1691
1692static struct snd_kcontrol_new cxt5051_mixers[] = { 1692static struct snd_kcontrol_new cxt5051_playback_mixers[] = {
1693 HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT),
1694 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
1695 HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT),
1696 HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT),
1697 HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT),
1698 HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT),
1699 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1693 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT),
1700 { 1694 {
1701 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1695 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1705,7 +1699,16 @@ static struct snd_kcontrol_new cxt5051_mixers[] = {
1705 .put = cxt5051_hp_master_sw_put, 1699 .put = cxt5051_hp_master_sw_put,
1706 .private_value = 0x1a, 1700 .private_value = 0x1a,
1707 }, 1701 },
1702 {}
1703};
1708 1704
1705static struct snd_kcontrol_new cxt5051_capture_mixers[] = {
1706 HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT),
1707 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
1708 HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT),
1709 HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT),
1710 HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT),
1711 HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT),
1709 {} 1712 {}
1710}; 1713};
1711 1714
@@ -1714,48 +1717,18 @@ static struct snd_kcontrol_new cxt5051_hp_mixers[] = {
1714 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1717 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
1715 HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), 1718 HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT),
1716 HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT), 1719 HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT),
1717 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT),
1718 {
1719 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1720 .name = "Master Playback Switch",
1721 .info = cxt_eapd_info,
1722 .get = cxt_eapd_get,
1723 .put = cxt5051_hp_master_sw_put,
1724 .private_value = 0x1a,
1725 },
1726
1727 {} 1720 {}
1728}; 1721};
1729 1722
1730static struct snd_kcontrol_new cxt5051_hp_dv6736_mixers[] = { 1723static struct snd_kcontrol_new cxt5051_hp_dv6736_mixers[] = {
1731 HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x00, HDA_INPUT), 1724 HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x00, HDA_INPUT),
1732 HDA_CODEC_MUTE("Capture Switch", 0x14, 0x00, HDA_INPUT), 1725 HDA_CODEC_MUTE("Capture Switch", 0x14, 0x00, HDA_INPUT),
1733 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT),
1734 {
1735 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1736 .name = "Master Playback Switch",
1737 .info = cxt_eapd_info,
1738 .get = cxt_eapd_get,
1739 .put = cxt5051_hp_master_sw_put,
1740 .private_value = 0x1a,
1741 },
1742
1743 {} 1726 {}
1744}; 1727};
1745 1728
1746static struct snd_kcontrol_new cxt5051_f700_mixers[] = { 1729static struct snd_kcontrol_new cxt5051_f700_mixers[] = {
1747 HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x01, HDA_INPUT), 1730 HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x01, HDA_INPUT),
1748 HDA_CODEC_MUTE("Capture Switch", 0x14, 0x01, HDA_INPUT), 1731 HDA_CODEC_MUTE("Capture Switch", 0x14, 0x01, HDA_INPUT),
1749 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT),
1750 {
1751 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1752 .name = "Master Playback Switch",
1753 .info = cxt_eapd_info,
1754 .get = cxt_eapd_get,
1755 .put = cxt5051_hp_master_sw_put,
1756 .private_value = 0x1a,
1757 },
1758
1759 {} 1732 {}
1760}; 1733};
1761 1734
@@ -1764,16 +1737,6 @@ static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = {
1764 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1737 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
1765 HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), 1738 HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT),
1766 HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), 1739 HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT),
1767 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT),
1768 {
1769 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1770 .name = "Master Playback Switch",
1771 .info = cxt_eapd_info,
1772 .get = cxt_eapd_get,
1773 .put = cxt5051_hp_master_sw_put,
1774 .private_value = 0x1a,
1775 },
1776
1777 {} 1740 {}
1778}; 1741};
1779 1742
@@ -1958,8 +1921,9 @@ static int patch_cxt5051(struct hda_codec *codec)
1958 spec->multiout.dig_out_nid = CXT5051_SPDIF_OUT; 1921 spec->multiout.dig_out_nid = CXT5051_SPDIF_OUT;
1959 spec->num_adc_nids = 1; /* not 2; via auto-mic switch */ 1922 spec->num_adc_nids = 1; /* not 2; via auto-mic switch */
1960 spec->adc_nids = cxt5051_adc_nids; 1923 spec->adc_nids = cxt5051_adc_nids;
1961 spec->num_mixers = 1; 1924 spec->num_mixers = 2;
1962 spec->mixers[0] = cxt5051_mixers; 1925 spec->mixers[0] = cxt5051_capture_mixers;
1926 spec->mixers[1] = cxt5051_playback_mixers;
1963 spec->num_init_verbs = 1; 1927 spec->num_init_verbs = 1;
1964 spec->init_verbs[0] = cxt5051_init_verbs; 1928 spec->init_verbs[0] = cxt5051_init_verbs;
1965 spec->spdif_route = 0; 1929 spec->spdif_route = 0;