Commit e71db39c authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

EMU10K1/EMU10K2 driver
Peter Zubaj <pzad@pobox.sk>:
 - disable routing from AC97 line out to front speakers.
 - AC97 ADC is used only for Mic playback and recording
 - Philips ADC is used for other analog playback and recording
  (Analog Mix Playback Volume, Analog Mix Capture Volume)
 - removes unused AC97 controls (is phone used ???)

Takashi Iwai <tiwai@suse.de>:
 - removed the duplicated IEC958 control on Dell's board.
parent 5631419e
......@@ -679,6 +679,9 @@
#define A_ADCIDX 0x63
#define A_ADCIDX_IDX 0x10000063
#define A_MICIDX 0x64
#define A_MICIDX_IDX 0x10000064
#define FXIDX 0x65 /* FX recording buffer index register */
#define FXIDX_MASK 0x0000ffff /* 16-bit value */
#define FXIDX_IDX 0x10000065
......@@ -1201,8 +1204,8 @@ int snd_emu10k1_proc_init(emu10k1_t * emu);
#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
#define A_EXTIN_LINE2_R 0x09 /* right */
#define A_EXTIN_RCA_SPDIF_L 0x0a /* audigy drive RCA SPDIF - left */
#define A_EXTIN_RCA_SPDIF_R 0x0b /* right */
#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
#define A_EXTIN_ADC_R 0x0b /* right */
#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
#define A_EXTIN_AUX2_R 0x0d /* - right */
......@@ -1227,6 +1230,7 @@ int snd_emu10k1_proc_init(emu10k1_t * emu);
#define A_EXTOUT_AC97_R 0x11 /* right */
#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
/* Audigy constants */
#define A_C_00000000 0xc0
......
......@@ -269,6 +269,9 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
* This has to be done after init ALice3 I2SOut beyond 48KHz.
* So, sequence is important. */
outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
} else {
/* Disable routing from AC97 line out to Front speakers */
outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
}
}
......
......@@ -1305,10 +1305,10 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Playback Volume", gpr, 100);
gpr += 2;
/* Wave Capture */
/* Wave (PCM) Capture */
A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Capture Volume", gpr, 0);
snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Capture Volume", gpr, 0);
gpr += 2;
/* Music Capture */
......@@ -1323,17 +1323,20 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
#define A_ADD_VOLUME_IN(var,vol,input) \
A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
/* AC'97 Playback Volume */
/* AC'97 Playback Volume - used only for mic */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AC97_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AC97_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Playback Volume", gpr, 100);
snd_emu10k1_init_stereo_control(&controls[nctl++], "AMic Playback Volume", gpr, 0);
gpr += 2;
/* AC'97 Capture Volume */
/* AC'97 Capture Volume - used only for mic */
A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_AC97_L);
A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AC97_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Capture Volume", gpr, 100);
snd_emu10k1_init_stereo_control(&controls[nctl++], "Mic Capture Volume", gpr, 0);
gpr += 2;
/* mic capture buffer */
A_OP(icode, &ptr, iINTERP, A_EXTOUT(A_EXTOUT_MIC_CAP), A_EXTIN(A_EXTIN_AC97_L), 0xcd, A_EXTIN(A_EXTIN_AC97_R));
/* Audigy CD Playback Volume */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_SPDIF_CD_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_SPDIF_CD_R);
......@@ -1367,15 +1370,15 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
snd_emu10k1_init_stereo_control(&controls[nctl++], "Line2 Capture Volume", gpr, 0);
gpr += 2;
/* RCA SPDIF Playback Volume */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_RCA_SPDIF_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Coaxial Playback Volume", gpr, 0);
/* Philips ADC Playback Volume */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_ADC_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Playback Volume", gpr, 0);
gpr += 2;
/* RCA SPDIF Capture Volume */
A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_RCA_SPDIF_L);
A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Coaxial Capture Volume", gpr, 0);
/* Philips ADC Capture Volume */
A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_ADC_L);
A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_ADC_R);
snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Capture Volume", gpr, 0);
gpr += 2;
/* Aux2 Playback Volume */
......
......@@ -478,6 +478,22 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
remove_ctl(card, "Master Playback Switch");
remove_ctl(card, "Master Playback Volume");
remove_ctl(card, "PCM Out Path & Mute");
remove_ctl(card, "Mono Output Select");
/* set master volume to 0 dB */
snd_ac97_write(emu->ac97, AC97_MASTER, 0x0202);
/* set capture source to mic */
snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000);
/* remove unused AC97 capture controls */
remove_ctl(card, "Capture Source");
remove_ctl(card, "Capture Switch");
remove_ctl(card, "Capture Volume");
remove_ctl(card, "Mic Select");
remove_ctl(card, "Video Playback Switch");
remove_ctl(card, "Video Playback Volume");
remove_ctl(card, "Mic Playback Switch");
remove_ctl(card, "Mic Playback Volume");
}
} else {
if (emu->APS)
......@@ -493,6 +509,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
/* rename_ctl(card, "Wave Capture Volume", "PCM Capture Volume"); */
rename_ctl(card, "Wave Master Playback Volume", "Master Playback Volume");
rename_ctl(card, "AMic Playback Volume", "Mic Playback Volume");
}
if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
......@@ -534,6 +551,11 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
return -ENOMEM;
if ((err = snd_ctl_add(card, kctl)))
return err;
if ((kctl = ctl_find(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT))) != NULL) {
/* already defined by ac97, remove it */
/* FIXME: or do we need both controls? */
remove_ctl(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT));
}
if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
return -ENOMEM;
if ((err = snd_ctl_add(card, kctl)))
......
......@@ -871,7 +871,7 @@ static int snd_emu10k1_capture_mic_open(snd_pcm_substream_t * substream)
epcm->capture_inte = INTE_MICBUFENABLE;
epcm->capture_ba_reg = MICBA;
epcm->capture_bs_reg = MICBS;
epcm->capture_idx_reg = MICIDX;
epcm->capture_idx_reg = emu->audigy ? A_MICIDX : MICIDX;
substream->runtime->private_data = epcm;
substream->runtime->private_free = snd_emu10k1_pcm_free_substream;
runtime->hw = snd_emu10k1_capture;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment