aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/virtuoso.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/oxygen/virtuoso.c')
-rw-r--r--sound/pci/oxygen/virtuoso.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index fa79db696e2d..2c3daf3ae4c3 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -30,10 +30,6 @@
30 * GPIO 5 <- external power present (D2X only) 30 * GPIO 5 <- external power present (D2X only)
31 * GPIO 7 -> ALT 31 * GPIO 7 -> ALT
32 * GPIO 8 -> enable output to speakers 32 * GPIO 8 -> enable output to speakers
33 *
34 * CM9780:
35 *
36 * GPIO 0 -> enable AC'97 bypass (line in -> ADC)
37 */ 33 */
38 34
39#include <linux/pci.h> 35#include <linux/pci.h>
@@ -81,8 +77,6 @@ MODULE_DEVICE_TABLE(pci, xonar_ids);
81#define GPIO_ALT 0x0080 77#define GPIO_ALT 0x0080
82#define GPIO_OUTPUT_ENABLE 0x0100 78#define GPIO_OUTPUT_ENABLE 0x0100
83 79
84#define GPIO_LINE_MUTE CM9780_GPO0
85
86struct xonar_data { 80struct xonar_data {
87 u8 is_d2x; 81 u8 is_d2x;
88 u8 has_power; 82 u8 has_power;
@@ -134,7 +128,6 @@ static void xonar_init(struct oxygen *chip)
134 & GPIO_EXT_POWER); 128 & GPIO_EXT_POWER);
135 } 129 }
136 oxygen_ac97_set_bits(chip, 0, CM9780_JACK, CM9780_FMIC2MIC); 130 oxygen_ac97_set_bits(chip, 0, CM9780_JACK, CM9780_FMIC2MIC);
137 oxygen_ac97_clear_bits(chip, 0, CM9780_GPIO_STATUS, GPIO_LINE_MUTE);
138 msleep(300); 131 msleep(300);
139 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_OUTPUT_ENABLE); 132 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_OUTPUT_ENABLE);
140 oxygen_set_bits16(chip, OXYGEN_GPIO_DATA, GPIO_OUTPUT_ENABLE); 133 oxygen_set_bits16(chip, OXYGEN_GPIO_DATA, GPIO_OUTPUT_ENABLE);
@@ -219,49 +212,6 @@ static void xonar_gpio_changed(struct oxygen *chip)
219 } 212 }
220} 213}
221 214
222static void mute_ac97_ctl(struct oxygen *chip, unsigned int control)
223{
224 unsigned int priv_idx = chip->controls[control]->private_value & 0xff;
225 u16 value;
226
227 value = oxygen_read_ac97(chip, 0, priv_idx);
228 if (!(value & 0x8000)) {
229 oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000);
230 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
231 &chip->controls[control]->id);
232 }
233}
234
235static void xonar_ac97_switch_hook(struct oxygen *chip, unsigned int codec,
236 unsigned int reg, int mute)
237{
238 if (codec != 0)
239 return;
240 /* line-in is exclusive */
241 switch (reg) {
242 case AC97_LINE:
243 oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS,
244 mute ? GPIO_LINE_MUTE : 0,
245 GPIO_LINE_MUTE);
246 if (!mute) {
247 mute_ac97_ctl(chip, CONTROL_MIC_CAPTURE_SWITCH);
248 mute_ac97_ctl(chip, CONTROL_CD_CAPTURE_SWITCH);
249 mute_ac97_ctl(chip, CONTROL_AUX_CAPTURE_SWITCH);
250 }
251 break;
252 case AC97_MIC:
253 case AC97_CD:
254 case AC97_VIDEO:
255 case AC97_AUX:
256 if (!mute) {
257 oxygen_ac97_set_bits(chip, 0, CM9780_GPIO_STATUS,
258 GPIO_LINE_MUTE);
259 mute_ac97_ctl(chip, CONTROL_LINE_CAPTURE_SWITCH);
260 }
261 break;
262 }
263}
264
265static int pcm1796_volume_info(struct snd_kcontrol *ctl, 215static int pcm1796_volume_info(struct snd_kcontrol *ctl,
266 struct snd_ctl_elem_info *info) 216 struct snd_ctl_elem_info *info)
267{ 217{
@@ -321,8 +271,6 @@ static int xonar_control_filter(struct snd_kcontrol_new *template)
321 } else if (!strncmp(template->name, "CD Capture ", 11)) { 271 } else if (!strncmp(template->name, "CD Capture ", 11)) {
322 /* CD in is actually connected to the video in pin */ 272 /* CD in is actually connected to the video in pin */
323 template->private_value ^= AC97_CD ^ AC97_VIDEO; 273 template->private_value ^= AC97_CD ^ AC97_VIDEO;
324 } else if (!strcmp(template->name, "Line Capture Volume")) {
325 return 1; /* line-in bypasses the AC'97 mixer */
326 } 274 }
327 return 0; 275 return 0;
328} 276}
@@ -345,7 +293,6 @@ static const struct oxygen_model model_xonar = {
345 .set_adc_params = set_cs5381_params, 293 .set_adc_params = set_cs5381_params,
346 .update_dac_volume = update_pcm1796_volume, 294 .update_dac_volume = update_pcm1796_volume,
347 .update_dac_mute = update_pcm1796_mute, 295 .update_dac_mute = update_pcm1796_mute,
348 .ac97_switch_hook = xonar_ac97_switch_hook,
349 .gpio_changed = xonar_gpio_changed, 296 .gpio_changed = xonar_gpio_changed,
350 .model_data_size = sizeof(struct xonar_data), 297 .model_data_size = sizeof(struct xonar_data),
351 .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 298 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |