aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_via.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-10-08 09:44:13 -0400
committerTakashi Iwai <tiwai@suse.de>2012-10-08 09:47:54 -0400
commit67aeda1f343fdae8056e3bed37546756e0893bc0 (patch)
tree60016c5ef3e5809e193a75396853f5deaf6bbb08 /sound/pci/hda/patch_via.c
parent613769fcab26a91de52a5d4bd4d116b087e8ac17 (diff)
ALSA: hda - Remove dead GPIO code for VIA codec
From what I can conclude all GPIO handling was removed in 2009. Remove dead code remnants. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r--sound/pci/hda/patch_via.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 5a45a912aedc..430cb33c0e4c 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -299,7 +299,6 @@ static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec)
299 299
300#define VIA_JACK_EVENT 0x20 300#define VIA_JACK_EVENT 0x20
301#define VIA_HP_EVENT 0x01 301#define VIA_HP_EVENT 0x01
302#define VIA_GPIO_EVENT 0x02
303#define VIA_LINE_EVENT 0x03 302#define VIA_LINE_EVENT 0x03
304 303
305enum { 304enum {
@@ -1685,50 +1684,6 @@ static void via_hp_automute(struct hda_codec *codec)
1685 via_line_automute(codec, present); 1684 via_line_automute(codec, present);
1686} 1685}
1687 1686
1688static void via_gpio_control(struct hda_codec *codec)
1689{
1690 unsigned int gpio_data;
1691 unsigned int vol_counter;
1692 unsigned int vol;
1693 unsigned int master_vol;
1694
1695 struct via_spec *spec = codec->spec;
1696
1697 gpio_data = snd_hda_codec_read(codec, codec->afg, 0,
1698 AC_VERB_GET_GPIO_DATA, 0) & 0x03;
1699
1700 vol_counter = (snd_hda_codec_read(codec, codec->afg, 0,
1701 0xF84, 0) & 0x3F0000) >> 16;
1702
1703 vol = vol_counter & 0x1F;
1704 master_vol = snd_hda_codec_read(codec, 0x1A, 0,
1705 AC_VERB_GET_AMP_GAIN_MUTE,
1706 AC_AMP_GET_INPUT);
1707
1708 if (gpio_data == 0x02) {
1709 /* unmute line out */
1710 snd_hda_set_pin_ctl(codec, spec->autocfg.line_out_pins[0],
1711 PIN_OUT);
1712 if (vol_counter & 0x20) {
1713 /* decrease volume */
1714 if (vol > master_vol)
1715 vol = master_vol;
1716 snd_hda_codec_amp_stereo(codec, 0x1A, HDA_INPUT,
1717 0, HDA_AMP_VOLMASK,
1718 master_vol-vol);
1719 } else {
1720 /* increase volume */
1721 snd_hda_codec_amp_stereo(codec, 0x1A, HDA_INPUT, 0,
1722 HDA_AMP_VOLMASK,
1723 ((master_vol+vol) > 0x2A) ? 0x2A :
1724 (master_vol+vol));
1725 }
1726 } else if (!(gpio_data & 0x02)) {
1727 /* mute line out */
1728 snd_hda_set_pin_ctl(codec, spec->autocfg.line_out_pins[0], 0);
1729 }
1730}
1731
1732/* unsolicited event for jack sensing */ 1687/* unsolicited event for jack sensing */
1733static void via_unsol_event(struct hda_codec *codec, 1688static void via_unsol_event(struct hda_codec *codec,
1734 unsigned int res) 1689 unsigned int res)
@@ -1743,8 +1698,6 @@ static void via_unsol_event(struct hda_codec *codec,
1743 1698
1744 if (res == VIA_HP_EVENT || res == VIA_LINE_EVENT) 1699 if (res == VIA_HP_EVENT || res == VIA_LINE_EVENT)
1745 via_hp_automute(codec); 1700 via_hp_automute(codec);
1746 else if (res == VIA_GPIO_EVENT)
1747 via_gpio_control(codec);
1748 snd_hda_jack_report_sync(codec); 1701 snd_hda_jack_report_sync(codec);
1749} 1702}
1750 1703