Searched refs:trident (Results 1 - 8 of 8) sorted by relevance

/linux-4.1.27/sound/pci/trident/
H A DMakefile6 snd-trident-objs := trident.o trident_main.o trident_memory.o
9 obj-$(CONFIG_SND_TRIDENT) += snd-trident.o
H A Dtrident_main.c45 #include "trident.h"
48 static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
51 static int snd_trident_pcm_mixer_free(struct snd_trident *trident,
55 static int snd_trident_sis_reset(struct snd_trident *trident);
57 static void snd_trident_clear_voices(struct snd_trident * trident,
59 static int snd_trident_free(struct snd_trident *trident);
67 static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
71 dev_dbg(trident->card->dev, "Trident voice %i:\n", voice);
72 outb(voice, TRID_REG(trident, T4D_LFO_GC_CIR));
73 val = inl(TRID_REG(trident, CH_LBA));
74 dev_dbg(trident->card->dev, "LBA: 0x%x\n", val);
75 val = inl(TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
76 dev_dbg(trident->card->dev, "GVSel: %i\n", val >> 31);
77 dev_dbg(trident->card->dev, "Pan: 0x%x\n", (val >> 24) & 0x7f);
78 dev_dbg(trident->card->dev, "Vol: 0x%x\n", (val >> 16) & 0xff);
79 dev_dbg(trident->card->dev, "CTRL: 0x%x\n", (val >> 12) & 0x0f);
80 dev_dbg(trident->card->dev, "EC: 0x%x\n", val & 0x0fff);
81 if (trident->device != TRIDENT_DEVICE_ID_NX) {
82 val = inl(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS));
83 dev_dbg(trident->card->dev, "CSO: 0x%x\n", val >> 16);
84 dev_dbg(trident->card->dev, "Alpha: 0x%x\n", (val >> 4) & 0x0fff);
85 dev_dbg(trident->card->dev, "FMS: 0x%x\n", val & 0x0f);
86 val = inl(TRID_REG(trident, CH_DX_ESO_DELTA));
87 dev_dbg(trident->card->dev, "ESO: 0x%x\n", val >> 16);
88 dev_dbg(trident->card->dev, "Delta: 0x%x\n", val & 0xffff);
89 val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL));
91 val = inl(TRID_REG(trident, CH_NX_DELTA_CSO));
93 dev_dbg(trident->card->dev, "CSO: 0x%x\n", val & 0x00ffffff);
94 val = inl(TRID_REG(trident, CH_NX_DELTA_ESO));
96 dev_dbg(trident->card->dev, "Delta: 0x%x\n", tmp);
97 dev_dbg(trident->card->dev, "ESO: 0x%x\n", val & 0x00ffffff);
98 val = inl(TRID_REG(trident, CH_NX_ALPHA_FMS_FMC_RVOL_CVOL));
99 dev_dbg(trident->card->dev, "Alpha: 0x%x\n", val >> 20);
100 dev_dbg(trident->card->dev, "FMS: 0x%x\n", (val >> 16) & 0x0f);
102 dev_dbg(trident->card->dev, "FMC: 0x%x\n", (val >> 14) & 3);
103 dev_dbg(trident->card->dev, "RVol: 0x%x\n", (val >> 7) & 0x7f);
104 dev_dbg(trident->card->dev, "CVol: 0x%x\n", val & 0x7f);
125 struct snd_trident *trident = ac97->private_data; snd_trident_codec_read() local
127 spin_lock_irqsave(&trident->reg_lock, flags); snd_trident_codec_read()
128 if (trident->device == TRIDENT_DEVICE_ID_DX) { snd_trident_codec_read()
130 outl(data, TRID_REG(trident, DX_ACR1_AC97_R)); snd_trident_codec_read()
132 data = inl(TRID_REG(trident, DX_ACR1_AC97_R)); snd_trident_codec_read()
136 } else if (trident->device == TRIDENT_DEVICE_ID_NX) { snd_trident_codec_read()
139 outl(data, TRID_REG(trident, treg)); snd_trident_codec_read()
141 data = inl(TRID_REG(trident, treg)); snd_trident_codec_read()
145 } else if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_codec_read()
149 outl(data, TRID_REG(trident, SI_AC97_READ)); snd_trident_codec_read()
151 data = inl(TRID_REG(trident, SI_AC97_READ)); snd_trident_codec_read()
157 if (count == 0 && !trident->ac97_detect) { snd_trident_codec_read()
158 dev_err(trident->card->dev, snd_trident_codec_read()
164 spin_unlock_irqrestore(&trident->reg_lock, flags); snd_trident_codec_read()
188 struct snd_trident *trident = ac97->private_data; snd_trident_codec_write() local
192 spin_lock_irqsave(&trident->reg_lock, flags); snd_trident_codec_write()
193 if (trident->device == TRIDENT_DEVICE_ID_DX) { snd_trident_codec_write()
198 if ((inw(TRID_REG(trident, address)) & DX_AC97_BUSY_WRITE) == 0) snd_trident_codec_write()
203 } else if (trident->device == TRIDENT_DEVICE_ID_NX) { snd_trident_codec_write()
208 if ((inw(TRID_REG(trident, address)) & NX_AC97_BUSY_WRITE) == 0) snd_trident_codec_write()
213 } else if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_codec_write()
218 if ((inw(TRID_REG(trident, address)) & (SI_AC97_BUSY_WRITE)) == 0) snd_trident_codec_write()
231 spin_unlock_irqrestore(&trident->reg_lock, flags); snd_trident_codec_write()
234 outl(data, TRID_REG(trident, address)); snd_trident_codec_write()
235 spin_unlock_irqrestore(&trident->reg_lock, flags); snd_trident_codec_write()
239 void snd_trident_enable_eso(struct snd_trident *trident)
246 Parameters: trident - pointer to target device class for 4DWave.
250 static void snd_trident_enable_eso(struct snd_trident * trident) snd_trident_enable_eso() argument
254 val = inl(TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_enable_eso()
257 if (trident->device == TRIDENT_DEVICE_ID_SI7018) snd_trident_enable_eso()
259 outl(val, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_enable_eso()
263 void snd_trident_disable_eso(struct snd_trident *trident)
271 trident - pointer to target device class for 4DWave.
277 static void snd_trident_disable_eso(struct snd_trident * trident) snd_trident_disable_eso() argument
281 tmp = inl(TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_disable_eso()
284 outl(tmp, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_disable_eso()
288 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
295 trident - pointer to target device class for 4DWave.
301 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice) snd_trident_start_voice() argument
306 outl(mask, TRID_REG(trident, reg)); snd_trident_start_voice()
312 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
319 trident - pointer to target device class for 4DWave.
325 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) snd_trident_stop_voice() argument
330 outl(mask, TRID_REG(trident, reg)); snd_trident_stop_voice()
336 int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
340 Parameters : trident - pointer to target device class for 4DWave.
346 static int snd_trident_allocate_pcm_channel(struct snd_trident * trident) snd_trident_allocate_pcm_channel() argument
350 if (trident->ChanPCMcnt >= trident->ChanPCM) snd_trident_allocate_pcm_channel()
353 if (!(trident->ChanMap[T4D_BANK_B] & (1 << idx))) { snd_trident_allocate_pcm_channel()
354 trident->ChanMap[T4D_BANK_B] |= 1 << idx; snd_trident_allocate_pcm_channel()
355 trident->ChanPCMcnt++; snd_trident_allocate_pcm_channel()
367 Parameters : trident - pointer to target device class for 4DWave.
374 static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel) snd_trident_free_pcm_channel() argument
379 if (trident->ChanMap[T4D_BANK_B] & (1 << channel)) { snd_trident_free_pcm_channel()
380 trident->ChanMap[T4D_BANK_B] &= ~(1 << channel); snd_trident_free_pcm_channel()
381 trident->ChanPCMcnt--; snd_trident_free_pcm_channel()
390 Parameters : trident - pointer to target device class for 4DWave.
396 static int snd_trident_allocate_synth_channel(struct snd_trident * trident) snd_trident_allocate_synth_channel() argument
401 if (!(trident->ChanMap[T4D_BANK_A] & (1 << idx))) { snd_trident_allocate_synth_channel()
402 trident->ChanMap[T4D_BANK_A] |= 1 << idx; snd_trident_allocate_synth_channel()
403 trident->synth.ChanSynthCount++; snd_trident_allocate_synth_channel()
415 Parameters : trident - pointer to target device class for 4DWave.
422 static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel) snd_trident_free_synth_channel() argument
427 if (trident->ChanMap[T4D_BANK_A] & (1 << channel)) { snd_trident_free_synth_channel()
428 trident->ChanMap[T4D_BANK_A] &= ~(1 << channel); snd_trident_free_synth_channel()
429 trident->synth.ChanSynthCount--; snd_trident_free_synth_channel()
439 Parameters: trident - pointer to target device class for 4DWave.
445 void snd_trident_write_voice_regs(struct snd_trident * trident, snd_trident_write_voice_regs() argument
459 switch (trident->device) { snd_trident_write_voice_regs()
492 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_voice_regs()
493 outl(regs[0], TRID_REG(trident, CH_START + 0)); snd_trident_write_voice_regs()
494 outl(regs[1], TRID_REG(trident, CH_START + 4)); snd_trident_write_voice_regs()
495 outl(regs[2], TRID_REG(trident, CH_START + 8)); snd_trident_write_voice_regs()
496 outl(regs[3], TRID_REG(trident, CH_START + 12)); snd_trident_write_voice_regs()
497 outl(regs[4], TRID_REG(trident, CH_START + 16)); snd_trident_write_voice_regs()
500 dev_dbg(trident->card->dev, "written %i channel:\n", voice->number); snd_trident_write_voice_regs()
501 dev_dbg(trident->card->dev, " regs[0] = 0x%x/0x%x\n", snd_trident_write_voice_regs()
502 regs[0], inl(TRID_REG(trident, CH_START + 0))); snd_trident_write_voice_regs()
503 dev_dbg(trident->card->dev, " regs[1] = 0x%x/0x%x\n", snd_trident_write_voice_regs()
504 regs[1], inl(TRID_REG(trident, CH_START + 4))); snd_trident_write_voice_regs()
505 dev_dbg(trident->card->dev, " regs[2] = 0x%x/0x%x\n", snd_trident_write_voice_regs()
506 regs[2], inl(TRID_REG(trident, CH_START + 8))); snd_trident_write_voice_regs()
507 dev_dbg(trident->card->dev, " regs[3] = 0x%x/0x%x\n", snd_trident_write_voice_regs()
508 regs[3], inl(TRID_REG(trident, CH_START + 12))); snd_trident_write_voice_regs()
509 dev_dbg(trident->card->dev, " regs[4] = 0x%x/0x%x\n", snd_trident_write_voice_regs()
510 regs[4], inl(TRID_REG(trident, CH_START + 16))); snd_trident_write_voice_regs()
522 Parameters: trident - pointer to target device class for 4DWave.
528 static void snd_trident_write_cso_reg(struct snd_trident * trident, snd_trident_write_cso_reg() argument
533 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_cso_reg()
534 if (trident->device != TRIDENT_DEVICE_ID_NX) { snd_trident_write_cso_reg()
535 outw(voice->CSO, TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2); snd_trident_write_cso_reg()
538 (voice->CSO & 0x00ffffff), TRID_REG(trident, CH_NX_DELTA_CSO)); snd_trident_write_cso_reg()
548 Parameters: trident - pointer to target device class for 4DWave.
554 static void snd_trident_write_eso_reg(struct snd_trident * trident, snd_trident_write_eso_reg() argument
559 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_eso_reg()
560 if (trident->device != TRIDENT_DEVICE_ID_NX) { snd_trident_write_eso_reg()
561 outw(voice->ESO, TRID_REG(trident, CH_DX_ESO_DELTA) + 2); snd_trident_write_eso_reg()
564 TRID_REG(trident, CH_NX_DELTA_ESO)); snd_trident_write_eso_reg()
574 Parameters: trident - pointer to target device class for 4DWave.
580 static void snd_trident_write_vol_reg(struct snd_trident * trident, snd_trident_write_vol_reg() argument
585 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_vol_reg()
586 switch (trident->device) { snd_trident_write_vol_reg()
589 outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2)); snd_trident_write_vol_reg()
592 /* dev_dbg(trident->card->dev, "voice->Vol = 0x%x\n", voice->Vol); */ snd_trident_write_vol_reg()
594 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC)); snd_trident_write_vol_reg()
605 Parameters: trident - pointer to target device class for 4DWave.
611 static void snd_trident_write_pan_reg(struct snd_trident * trident, snd_trident_write_pan_reg() argument
616 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_pan_reg()
618 TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 3)); snd_trident_write_pan_reg()
627 Parameters: trident - pointer to target device class for 4DWave.
633 static void snd_trident_write_rvol_reg(struct snd_trident * trident, snd_trident_write_rvol_reg() argument
638 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_rvol_reg()
641 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ? snd_trident_write_rvol_reg()
651 Parameters: trident - pointer to target device class for 4DWave.
657 static void snd_trident_write_cvol_reg(struct snd_trident * trident, snd_trident_write_cvol_reg() argument
662 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_write_cvol_reg()
665 TRID_REG(trident, trident->device == TRIDENT_DEVICE_ID_NX ? snd_trident_write_cvol_reg()
674 Parameters: trident - pointer to target device class for 4DWave.
704 Parameters: trident - pointer to target device class for 4DWave.
734 Parameters: trident - pointer to target device class for 4DWave.
756 Parameters: trident - pointer to target device class for 4DWave.
802 trident hardware is unpredictable and interrupt generator snd_trident_ioctl()
822 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_allocate_pcm_mem() local
829 if (trident->tlb.entries) { snd_trident_allocate_pcm_mem()
832 snd_trident_free_pages(trident, voice->memblk); snd_trident_allocate_pcm_mem()
833 voice->memblk = snd_trident_alloc_pages(trident, substream); snd_trident_allocate_pcm_mem()
856 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_allocate_evoice() local
865 evoice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); snd_trident_allocate_evoice()
873 snd_trident_free_voice(trident, evoice); snd_trident_allocate_evoice()
917 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_hw_free() local
922 if (trident->tlb.entries) { snd_trident_hw_free()
924 snd_trident_free_pages(trident, voice->memblk); snd_trident_hw_free()
930 snd_trident_free_voice(trident, evoice); snd_trident_hw_free()
949 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_prepare() local
953 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number]; snd_trident_playback_prepare()
955 spin_lock_irq(&trident->reg_lock); snd_trident_playback_prepare()
987 snd_trident_write_voice_regs(trident, voice); snd_trident_playback_prepare()
997 evoice->GVSel = trident->device == TRIDENT_DEVICE_ID_SI7018 ? 0 : 1; snd_trident_playback_prepare()
1010 snd_trident_write_voice_regs(trident, evoice); snd_trident_playback_prepare()
1016 spin_unlock_irq(&trident->reg_lock); snd_trident_playback_prepare()
1052 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_prepare() local
1057 spin_lock_irq(&trident->reg_lock); snd_trident_capture_prepare()
1060 outb(0, TRID_REG(trident, LEGACY_DMAR15)); snd_trident_capture_prepare()
1063 outb(0x54, TRID_REG(trident, LEGACY_DMAR11)); snd_trident_capture_prepare()
1067 outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0)); snd_trident_capture_prepare()
1073 outb((ESO_bytes & 0x00ff0000) >> 16, TRID_REG(trident, LEGACY_DMAR6)); snd_trident_capture_prepare()
1074 outw((ESO_bytes & 0x0000ffff), TRID_REG(trident, LEGACY_DMAR4)); snd_trident_capture_prepare()
1079 outw(val, TRID_REG(trident, T4D_SBDELTA_DELTA_R)); snd_trident_capture_prepare()
1088 outl((val << 16) | val, TRID_REG(trident, T4D_SBBL_SBCL)); snd_trident_capture_prepare()
1092 trident->bDMAStart = 0x19; // 0001 1001b snd_trident_capture_prepare()
1095 trident->bDMAStart |= 0x80; snd_trident_capture_prepare()
1097 trident->bDMAStart |= 0x20; snd_trident_capture_prepare()
1099 trident->bDMAStart |= 0x40; snd_trident_capture_prepare()
1124 snd_trident_write_voice_regs(trident, voice); snd_trident_capture_prepare()
1126 spin_unlock_irq(&trident->reg_lock); snd_trident_capture_prepare()
1166 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_si7018_capture_hw_free() local
1173 snd_trident_free_voice(trident, evoice); snd_trident_si7018_capture_hw_free()
1192 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_si7018_capture_prepare() local
1197 spin_lock_irq(&trident->reg_lock); snd_trident_si7018_capture_prepare()
1222 snd_trident_write_voice_regs(trident, voice); snd_trident_si7018_capture_prepare()
1240 snd_trident_write_voice_regs(trident, evoice); snd_trident_si7018_capture_prepare()
1246 spin_unlock_irq(&trident->reg_lock); snd_trident_si7018_capture_prepare()
1263 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_prepare() local
1268 spin_lock_irq(&trident->reg_lock); snd_trident_foldback_prepare()
1297 outb(((voice->number & 0x3f) | 0x80), TRID_REG(trident, T4D_RCI + voice->foldback_chan)); snd_trident_foldback_prepare()
1299 snd_trident_write_voice_regs(trident, voice); snd_trident_foldback_prepare()
1309 evoice->GVSel = trident->device == TRIDENT_DEVICE_ID_SI7018 ? 0 : 1; snd_trident_foldback_prepare()
1317 snd_trident_write_voice_regs(trident, evoice); snd_trident_foldback_prepare()
1323 spin_unlock_irq(&trident->reg_lock); snd_trident_foldback_prepare()
1342 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_hw_params() local
1350 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_hw_params()
1357 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_hw_params()
1358 old_bits = trident->spdif_pcm_bits; snd_trident_spdif_hw_params()
1360 trident->spdif_pcm_bits &= ~IEC958_AES0_PRO_FS; snd_trident_spdif_hw_params()
1362 trident->spdif_pcm_bits &= ~(IEC958_AES3_CON_FS << 24); snd_trident_spdif_hw_params()
1364 trident->spdif_pcm_ctrl = 0x3c; // 48000 Hz snd_trident_spdif_hw_params()
1365 trident->spdif_pcm_bits |= snd_trident_spdif_hw_params()
1366 trident->spdif_bits & IEC958_AES0_PROFESSIONAL ? snd_trident_spdif_hw_params()
1371 trident->spdif_pcm_ctrl = 0x3e; // 44100 Hz snd_trident_spdif_hw_params()
1372 trident->spdif_pcm_bits |= snd_trident_spdif_hw_params()
1373 trident->spdif_bits & IEC958_AES0_PROFESSIONAL ? snd_trident_spdif_hw_params()
1378 trident->spdif_pcm_ctrl = 0x3d; // 32000 Hz snd_trident_spdif_hw_params()
1379 trident->spdif_pcm_bits |= snd_trident_spdif_hw_params()
1380 trident->spdif_bits & IEC958_AES0_PROFESSIONAL ? snd_trident_spdif_hw_params()
1384 change = old_bits != trident->spdif_pcm_bits; snd_trident_spdif_hw_params()
1385 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_hw_params()
1388 snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE, &trident->spdif_pcm_ctl->id); snd_trident_spdif_hw_params()
1406 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_prepare() local
1410 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number]; snd_trident_spdif_prepare()
1414 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_prepare()
1416 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_prepare()
1454 snd_trident_write_voice_regs(trident, voice); snd_trident_spdif_prepare()
1456 outw((RESO & 0xffff), TRID_REG(trident, NX_SPESO)); snd_trident_spdif_prepare()
1457 outb((RESO >> 16), TRID_REG(trident, NX_SPESO + 2)); snd_trident_spdif_prepare()
1458 outl((LBAO & 0xfffffffc), TRID_REG(trident, NX_SPLBA)); snd_trident_spdif_prepare()
1459 outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO)); snd_trident_spdif_prepare()
1460 outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2)); snd_trident_spdif_prepare()
1463 outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3)); snd_trident_spdif_prepare()
1464 outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_spdif_prepare()
1493 snd_trident_write_voice_regs(trident, voice); snd_trident_spdif_prepare()
1503 evoice->GVSel = trident->device == TRIDENT_DEVICE_ID_SI7018 ? 0 : 1; snd_trident_spdif_prepare()
1511 snd_trident_write_voice_regs(trident, evoice); snd_trident_spdif_prepare()
1517 outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_spdif_prepare()
1518 temp = inl(TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_spdif_prepare()
1520 outl(temp, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_spdif_prepare()
1521 temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_spdif_prepare()
1523 outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_spdif_prepare()
1526 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_prepare()
1547 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_trigger() local
1568 spin_lock(&trident->reg_lock); snd_trident_trigger()
1569 val = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff; snd_pcm_group_for_each_entry()
1571 if ((struct snd_trident *) snd_pcm_substream_chip(s) == trident) { snd_pcm_group_for_each_entry()
1597 if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
1598 outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
1599 val = trident->spdif_pcm_ctrl;
1602 outb(val, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
1604 outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS));
1605 val = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) | SPDIF_EN;
1606 outl(val, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
1610 outl(what, TRID_REG(trident, T4D_STOP_B));
1611 val = inl(TRID_REG(trident, T4D_AINTEN_B));
1617 outl(val, TRID_REG(trident, T4D_AINTEN_B));
1619 outl(what, TRID_REG(trident, T4D_START_B));
1621 if (capture_flag && trident->device != TRIDENT_DEVICE_ID_SI7018)
1622 outb(trident->bDMAStart, TRID_REG(trident, T4D_SBCTRL_SBE2R_SBDD));
1624 if (capture_flag && trident->device != TRIDENT_DEVICE_ID_SI7018)
1625 outb(0x00, TRID_REG(trident, T4D_SBCTRL_SBE2R_SBDD));
1627 spin_unlock(&trident->reg_lock);
1644 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_pointer() local
1652 spin_lock(&trident->reg_lock); snd_trident_playback_pointer()
1654 outb(voice->number, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_playback_pointer()
1656 if (trident->device != TRIDENT_DEVICE_ID_NX) { snd_trident_playback_pointer()
1657 cso = inw(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS + 2)); snd_trident_playback_pointer()
1659 cso = (unsigned int) inl(TRID_REG(trident, CH_NX_DELTA_CSO)) & 0x00ffffff; snd_trident_playback_pointer()
1662 spin_unlock(&trident->reg_lock); snd_trident_playback_pointer()
1683 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_pointer() local
1691 result = inw(TRID_REG(trident, T4D_SBBL_SBCL)); snd_trident_capture_pointer()
1713 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_pointer() local
1721 result = inl(TRID_REG(trident, NX_SPCTRL_SPCSO)) & 0x00ffffff; snd_trident_spdif_pointer()
1848 struct snd_trident *trident; snd_trident_pcm_free_substream() local
1851 trident = voice->trident; snd_trident_pcm_free_substream()
1852 snd_trident_free_voice(trident, voice); snd_trident_pcm_free_substream()
1858 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_open() local
1862 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); snd_trident_playback_open()
1865 snd_trident_pcm_mixer_build(trident, voice, substream); snd_trident_playback_open()
1886 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_playback_close() local
1890 snd_trident_pcm_mixer_free(trident, voice, substream); snd_trident_playback_close()
1907 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_open() local
1911 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); snd_trident_spdif_open()
1916 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_open()
1917 trident->spdif_pcm_bits = trident->spdif_bits; snd_trident_spdif_open()
1918 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_open()
1922 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_open()
1928 trident->spdif_pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; snd_trident_spdif_open()
1929 snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE | snd_trident_spdif_open()
1930 SNDRV_CTL_EVENT_MASK_INFO, &trident->spdif_pcm_ctl->id); snd_trident_spdif_open()
1948 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_spdif_close() local
1951 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_close()
1953 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_close()
1954 outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3)); snd_trident_spdif_close()
1955 outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_spdif_close()
1957 outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_spdif_close()
1958 temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_spdif_close()
1959 if (trident->spdif_ctrl) { snd_trident_spdif_close()
1964 outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_spdif_close()
1966 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_close()
1967 trident->spdif_pcm_ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; snd_trident_spdif_close()
1968 snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE | snd_trident_spdif_close()
1969 SNDRV_CTL_EVENT_MASK_INFO, &trident->spdif_pcm_ctl->id); snd_trident_spdif_close()
1986 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_capture_open() local
1990 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); snd_trident_capture_open()
2030 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_open() local
2034 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); snd_trident_foldback_open()
2057 struct snd_trident *trident = snd_pcm_substream_chip(substream); snd_trident_foldback_close() local
2063 spin_lock_irq(&trident->reg_lock); snd_trident_foldback_close()
2064 outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan)); snd_trident_foldback_close()
2065 spin_unlock_irq(&trident->reg_lock); snd_trident_foldback_close()
2168 Parameters: trident - pointer to target device class for 4DWave.
2174 int snd_trident_pcm(struct snd_trident *trident, int device) snd_trident_pcm() argument
2179 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm)) < 0) snd_trident_pcm()
2182 pcm->private_data = trident; snd_trident_pcm()
2184 if (trident->tlb.entries) { snd_trident_pcm()
2190 trident->device != TRIDENT_DEVICE_ID_SI7018 ? snd_trident_pcm()
2197 trident->pcm = pcm; snd_trident_pcm()
2199 if (trident->tlb.entries) { snd_trident_pcm()
2203 snd_dma_pci_data(trident->pci), snd_trident_pcm()
2206 SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), snd_trident_pcm()
2210 snd_dma_pci_data(trident->pci), 64*1024, 128*1024); snd_trident_pcm()
2221 Parameters: trident - pointer to target device class for 4DWave.
2227 int snd_trident_foldback_pcm(struct snd_trident *trident, int device) snd_trident_foldback_pcm() argument
2234 if (trident->device == TRIDENT_DEVICE_ID_NX) snd_trident_foldback_pcm()
2236 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback)) < 0) snd_trident_foldback_pcm()
2239 foldback->private_data = trident; snd_trident_foldback_pcm()
2240 if (trident->tlb.entries) snd_trident_foldback_pcm()
2256 trident->foldback = foldback; snd_trident_foldback_pcm()
2258 if (trident->tlb.entries) snd_trident_foldback_pcm()
2260 snd_dma_pci_data(trident->pci), 0, 128*1024); snd_trident_foldback_pcm()
2263 snd_dma_pci_data(trident->pci), 64*1024, 128*1024); snd_trident_foldback_pcm()
2273 Parameters: trident - pointer to target device class for 4DWave-NX.
2279 int snd_trident_spdif_pcm(struct snd_trident *trident, int device) snd_trident_spdif_pcm() argument
2284 if ((err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif)) < 0) snd_trident_spdif_pcm()
2287 spdif->private_data = trident; snd_trident_spdif_pcm()
2288 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_pcm()
2295 trident->spdif = spdif; snd_trident_spdif_pcm()
2297 snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), 64*1024, 128*1024); snd_trident_spdif_pcm()
2318 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_control_get() local
2321 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_control_get()
2322 val = trident->spdif_ctrl; snd_trident_spdif_control_get()
2324 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_control_get()
2331 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_control_put() local
2336 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_control_put()
2338 change = trident->spdif_ctrl != val; snd_trident_spdif_control_put()
2339 trident->spdif_ctrl = val; snd_trident_spdif_control_put()
2340 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_control_put()
2341 if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0) { snd_trident_spdif_control_put()
2342 outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_spdif_control_put()
2343 outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3)); snd_trident_spdif_control_put()
2346 if (trident->spdif == NULL) { snd_trident_spdif_control_put()
2348 outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_spdif_control_put()
2349 temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & ~SPDIF_EN; snd_trident_spdif_control_put()
2352 outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_spdif_control_put()
2355 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_control_put()
2386 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_default_get() local
2388 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_default_get()
2389 ucontrol->value.iec958.status[0] = (trident->spdif_bits >> 0) & 0xff; snd_trident_spdif_default_get()
2390 ucontrol->value.iec958.status[1] = (trident->spdif_bits >> 8) & 0xff; snd_trident_spdif_default_get()
2391 ucontrol->value.iec958.status[2] = (trident->spdif_bits >> 16) & 0xff; snd_trident_spdif_default_get()
2392 ucontrol->value.iec958.status[3] = (trident->spdif_bits >> 24) & 0xff; snd_trident_spdif_default_get()
2393 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_default_get()
2400 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_default_put() local
2408 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_default_put()
2409 change = trident->spdif_bits != val; snd_trident_spdif_default_put()
2410 trident->spdif_bits = val; snd_trident_spdif_default_put()
2411 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_default_put()
2412 if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0) snd_trident_spdif_default_put()
2413 outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_spdif_default_put()
2415 if (trident->spdif == NULL) snd_trident_spdif_default_put()
2416 outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_spdif_default_put()
2418 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_default_put()
2481 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_stream_get() local
2483 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_stream_get()
2484 ucontrol->value.iec958.status[0] = (trident->spdif_pcm_bits >> 0) & 0xff; snd_trident_spdif_stream_get()
2485 ucontrol->value.iec958.status[1] = (trident->spdif_pcm_bits >> 8) & 0xff; snd_trident_spdif_stream_get()
2486 ucontrol->value.iec958.status[2] = (trident->spdif_pcm_bits >> 16) & 0xff; snd_trident_spdif_stream_get()
2487 ucontrol->value.iec958.status[3] = (trident->spdif_pcm_bits >> 24) & 0xff; snd_trident_spdif_stream_get()
2488 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_stream_get()
2495 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_spdif_stream_put() local
2503 spin_lock_irq(&trident->reg_lock); snd_trident_spdif_stream_put()
2504 change = trident->spdif_pcm_bits != val; snd_trident_spdif_stream_put()
2505 trident->spdif_pcm_bits = val; snd_trident_spdif_stream_put()
2506 if (trident->spdif != NULL) { snd_trident_spdif_stream_put()
2507 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_spdif_stream_put()
2508 outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_spdif_stream_put()
2510 outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_spdif_stream_put()
2513 spin_unlock_irq(&trident->reg_lock); snd_trident_spdif_stream_put()
2538 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_ac97_control_get() local
2541 spin_lock_irq(&trident->reg_lock); snd_trident_ac97_control_get()
2542 val = trident->ac97_ctrl = inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_ac97_control_get()
2544 spin_unlock_irq(&trident->reg_lock); snd_trident_ac97_control_get()
2551 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_ac97_control_put() local
2555 spin_lock_irq(&trident->reg_lock); snd_trident_ac97_control_put()
2556 val = trident->ac97_ctrl = inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_ac97_control_put()
2560 change = val != trident->ac97_ctrl; snd_trident_ac97_control_put()
2561 trident->ac97_ctrl = val; snd_trident_ac97_control_put()
2562 outl(trident->ac97_ctrl = val, TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_ac97_control_put()
2563 spin_unlock_irq(&trident->reg_lock); snd_trident_ac97_control_put()
2596 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_vol_control_get() local
2599 val = trident->musicvol_wavevol; snd_trident_vol_control_get()
2610 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_vol_control_put() local
2614 spin_lock_irq(&trident->reg_lock); snd_trident_vol_control_put()
2615 val = trident->musicvol_wavevol; snd_trident_vol_control_put()
2619 change = val != trident->musicvol_wavevol; snd_trident_vol_control_put()
2620 outl(trident->musicvol_wavevol = val, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); snd_trident_vol_control_put()
2621 spin_unlock_irq(&trident->reg_lock); snd_trident_vol_control_put()
2656 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_vol_control_info() local
2662 if (trident->device == TRIDENT_DEVICE_ID_SI7018) snd_trident_pcm_vol_control_info()
2670 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_vol_control_get() local
2671 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_vol_control_get()
2673 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_pcm_vol_control_get()
2684 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_vol_control_put() local
2685 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_vol_control_put()
2689 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_pcm_vol_control_put()
2694 spin_lock_irq(&trident->reg_lock); snd_trident_pcm_vol_control_put()
2698 snd_trident_write_vol_reg(trident, mix->voice, val); snd_trident_pcm_vol_control_put()
2699 spin_unlock_irq(&trident->reg_lock); snd_trident_pcm_vol_control_put()
2734 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_pan_control_get() local
2735 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_pan_control_get()
2749 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_pan_control_put() local
2750 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_pan_control_put()
2758 spin_lock_irq(&trident->reg_lock); snd_trident_pcm_pan_control_put()
2762 snd_trident_write_pan_reg(trident, mix->voice, val); snd_trident_pcm_pan_control_put()
2763 spin_unlock_irq(&trident->reg_lock); snd_trident_pcm_pan_control_put()
2797 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_rvol_control_get() local
2798 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_rvol_control_get()
2807 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_rvol_control_put() local
2808 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_rvol_control_put()
2813 spin_lock_irq(&trident->reg_lock); snd_trident_pcm_rvol_control_put()
2817 snd_trident_write_rvol_reg(trident, mix->voice, val); snd_trident_pcm_rvol_control_put()
2818 spin_unlock_irq(&trident->reg_lock); snd_trident_pcm_rvol_control_put()
2855 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_cvol_control_get() local
2856 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_cvol_control_get()
2865 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); snd_trident_pcm_cvol_control_put() local
2866 struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; snd_trident_pcm_cvol_control_put()
2871 spin_lock_irq(&trident->reg_lock); snd_trident_pcm_cvol_control_put()
2875 snd_trident_write_cvol_reg(trident, mix->voice, val); snd_trident_pcm_cvol_control_put()
2876 spin_unlock_irq(&trident->reg_lock); snd_trident_pcm_cvol_control_put()
2909 static void snd_trident_notify_pcm_change(struct snd_trident *trident, snd_trident_notify_pcm_change() argument
2913 snd_trident_notify_pcm_change1(trident->card, trident->ctl_vol, num, activate); snd_trident_notify_pcm_change()
2914 snd_trident_notify_pcm_change1(trident->card, trident->ctl_pan, num, activate); snd_trident_notify_pcm_change()
2915 snd_trident_notify_pcm_change1(trident->card, trident->ctl_rvol, num, activate); snd_trident_notify_pcm_change()
2916 snd_trident_notify_pcm_change1(trident->card, trident->ctl_cvol, num, activate); snd_trident_notify_pcm_change()
2919 static int snd_trident_pcm_mixer_build(struct snd_trident *trident, snd_trident_pcm_mixer_build() argument
2925 if (snd_BUG_ON(!trident || !voice || !substream)) snd_trident_pcm_mixer_build()
2927 tmix = &trident->pcm_mixer[substream->number]; snd_trident_pcm_mixer_build()
2933 snd_trident_notify_pcm_change(trident, tmix, substream->number, 1); snd_trident_pcm_mixer_build()
2937 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice *voice, struct snd_pcm_substream *substream) snd_trident_pcm_mixer_free() argument
2941 if (snd_BUG_ON(!trident || !substream)) snd_trident_pcm_mixer_free()
2943 tmix = &trident->pcm_mixer[substream->number]; snd_trident_pcm_mixer_free()
2945 snd_trident_notify_pcm_change(trident, tmix, substream->number, 0); snd_trident_pcm_mixer_free()
2954 Parameters: trident - pointer to target device class for 4DWave.
2960 static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) snd_trident_mixer() argument
2963 struct snd_card *card = trident->card; snd_trident_mixer()
2976 if ((err = snd_ac97_bus(trident->card, 0, &ops, NULL, &trident->ac97_bus)) < 0) snd_trident_mixer()
2980 _ac97.private_data = trident; snd_trident_mixer()
2981 trident->ac97_detect = 1; snd_trident_mixer()
2984 if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) { snd_trident_mixer()
2985 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_mixer()
2986 if ((err = snd_trident_sis_reset(trident)) < 0) snd_trident_mixer()
2996 if (trident->device == TRIDENT_DEVICE_ID_SI7018 && snd_trident_mixer()
2997 (inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) { snd_trident_mixer()
2999 err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec); snd_trident_mixer()
3001 dev_err(trident->card->dev, snd_trident_mixer()
3006 err = snd_ac97_modem(trident->card, &_ac97, &mc97); snd_trident_mixer()
3008 dev_err(trident->card->dev, snd_trident_mixer()
3014 trident->ac97_detect = 0; snd_trident_mixer()
3016 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { snd_trident_mixer()
3017 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident))) < 0) snd_trident_mixer()
3020 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_music_control, trident))) < 0) snd_trident_mixer()
3023 outl(trident->musicvol_wavevol = 0x00000000, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); snd_trident_mixer()
3025 outl(trident->musicvol_wavevol = 0xffff0000, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); snd_trident_mixer()
3031 tmix = &trident->pcm_mixer[idx]; snd_trident_mixer()
3034 if ((trident->ctl_vol = snd_ctl_new1(&snd_trident_pcm_vol_control, trident)) == NULL) snd_trident_mixer()
3036 if ((err = snd_ctl_add(card, trident->ctl_vol))) snd_trident_mixer()
3039 if ((trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident)) == NULL) snd_trident_mixer()
3041 if ((err = snd_ctl_add(card, trident->ctl_pan))) snd_trident_mixer()
3044 if ((trident->ctl_rvol = snd_ctl_new1(&snd_trident_pcm_rvol_control, trident)) == NULL) snd_trident_mixer()
3046 if ((err = snd_ctl_add(card, trident->ctl_rvol))) snd_trident_mixer()
3049 if ((trident->ctl_cvol = snd_ctl_new1(&snd_trident_pcm_cvol_control, trident)) == NULL) snd_trident_mixer()
3051 if ((err = snd_ctl_add(card, trident->ctl_cvol))) snd_trident_mixer()
3054 if (trident->device == TRIDENT_DEVICE_ID_NX) { snd_trident_mixer()
3055 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident))) < 0) snd_trident_mixer()
3059 if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_mixer()
3061 kctl = snd_ctl_new1(&snd_trident_spdif_control, trident); snd_trident_mixer()
3066 if (trident->ac97->ext_id & AC97_EI_SPDIF) snd_trident_mixer()
3068 if (trident->ac97_sec && (trident->ac97_sec->ext_id & AC97_EI_SPDIF)) snd_trident_mixer()
3075 kctl = snd_ctl_new1(&snd_trident_spdif_default, trident); snd_trident_mixer()
3085 kctl = snd_ctl_new1(&snd_trident_spdif_mask, trident); snd_trident_mixer()
3095 kctl = snd_ctl_new1(&snd_trident_spdif_stream, trident); snd_trident_mixer()
3104 trident->spdif_pcm_ctl = kctl; snd_trident_mixer()
3232 static int snd_trident_sis_reset(struct snd_trident *trident) snd_trident_sis_reset() argument
3238 r = trident->in_suspend ? 0 : 2; /* count of retries */ snd_trident_sis_reset()
3240 pci_write_config_byte(trident->pci, 0x46, 0x04); /* SOFTWARE RESET */ snd_trident_sis_reset()
3242 pci_write_config_byte(trident->pci, 0x46, 0x00); snd_trident_sis_reset()
3245 outb(0x00, TRID_REG(trident, SI_AC97_GPIO)); snd_trident_sis_reset()
3248 outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_sis_reset()
3252 outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_sis_reset()
3257 if ((inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) snd_trident_sis_reset()
3259 do_delay(trident); snd_trident_sis_reset()
3261 dev_err(trident->card->dev, "AC'97 codec ready error [0x%x]\n", snd_trident_sis_reset()
3262 inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL))); snd_trident_sis_reset()
3266 do_delay(trident); snd_trident_sis_reset()
3273 if ((inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_SECONDARY_READY) != 0) snd_trident_sis_reset()
3275 do_delay(trident); snd_trident_sis_reset()
3278 outl(BANK_B_EN, TRID_REG(trident, T4D_LFO_GC_CIR)); snd_trident_sis_reset()
3289 struct snd_trident *trident = entry->private_data; snd_trident_proc_read() local
3292 switch (trident->device) { snd_trident_proc_read()
3306 snd_iprintf(buffer, "Spurious IRQs : %d\n", trident->spurious_irq_count); snd_trident_proc_read()
3307 snd_iprintf(buffer, "Spurious IRQ dlta: %d\n", trident->spurious_irq_max_delta); snd_trident_proc_read()
3308 if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) snd_trident_proc_read()
3309 snd_iprintf(buffer, "IEC958 Mixer Out : %s\n", trident->spdif_ctrl == 0x28 ? "on" : "off"); snd_trident_proc_read()
3310 if (trident->device == TRIDENT_DEVICE_ID_NX) { snd_trident_proc_read()
3311 snd_iprintf(buffer, "Rear Speakers : %s\n", trident->ac97_ctrl & 0x00000010 ? "on" : "off"); snd_trident_proc_read()
3312 if (trident->tlb.entries) { snd_trident_proc_read()
3314 snd_iprintf(buffer, "Memory Maximum : %d\n", trident->tlb.memhdr->size); snd_trident_proc_read()
3315 snd_iprintf(buffer, "Memory Used : %d\n", trident->tlb.memhdr->used); snd_trident_proc_read()
3316 snd_iprintf(buffer, "Memory Free : %d\n", snd_util_mem_avail(trident->tlb.memhdr)); snd_trident_proc_read()
3321 static void snd_trident_proc_init(struct snd_trident *trident) snd_trident_proc_init() argument
3324 const char *s = "trident"; snd_trident_proc_init()
3326 if (trident->device == TRIDENT_DEVICE_ID_SI7018) snd_trident_proc_init()
3328 if (! snd_card_proc_new(trident->card, s, &entry)) snd_trident_proc_init()
3329 snd_info_set_text_ops(entry, trident, snd_trident_proc_read); snd_trident_proc_init()
3334 struct snd_trident *trident = device->device_data; snd_trident_dev_free() local
3335 return snd_trident_free(trident); snd_trident_dev_free()
3344 Parameters: trident - pointer to target device class for 4DWave.
3350 static int snd_trident_tlb_alloc(struct snd_trident *trident) snd_trident_tlb_alloc() argument
3357 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), snd_trident_tlb_alloc()
3358 2 * SNDRV_TRIDENT_MAX_PAGES * 4, &trident->tlb.buffer) < 0) { snd_trident_tlb_alloc()
3359 dev_err(trident->card->dev, "unable to allocate TLB buffer\n"); snd_trident_tlb_alloc()
3362 trident->tlb.entries = (unsigned int*)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4); snd_trident_tlb_alloc()
3363 trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4); snd_trident_tlb_alloc()
3365 trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long)); snd_trident_tlb_alloc()
3366 if (trident->tlb.shadow_entries == NULL) { snd_trident_tlb_alloc()
3367 dev_err(trident->card->dev, snd_trident_tlb_alloc()
3372 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), snd_trident_tlb_alloc()
3373 SNDRV_TRIDENT_PAGE_SIZE, &trident->tlb.silent_page) < 0) { snd_trident_tlb_alloc()
3374 dev_err(trident->card->dev, "unable to allocate silent page\n"); snd_trident_tlb_alloc()
3377 memset(trident->tlb.silent_page.area, 0, SNDRV_TRIDENT_PAGE_SIZE); snd_trident_tlb_alloc()
3379 trident->tlb.entries[i] = cpu_to_le32(trident->tlb.silent_page.addr & ~(SNDRV_TRIDENT_PAGE_SIZE-1)); snd_trident_tlb_alloc()
3380 trident->tlb.shadow_entries[i] = (unsigned long)trident->tlb.silent_page.area; snd_trident_tlb_alloc()
3384 trident->tlb.memhdr = snd_util_memhdr_new(SNDRV_TRIDENT_PAGE_SIZE * SNDRV_TRIDENT_MAX_PAGES); snd_trident_tlb_alloc()
3385 if (trident->tlb.memhdr == NULL) snd_trident_tlb_alloc()
3388 trident->tlb.memhdr->block_extra_size = sizeof(struct snd_trident_memblk_arg); snd_trident_tlb_alloc()
3396 static void snd_trident_stop_all_voices(struct snd_trident *trident) snd_trident_stop_all_voices() argument
3398 outl(0xffffffff, TRID_REG(trident, T4D_STOP_A)); snd_trident_stop_all_voices()
3399 outl(0xffffffff, TRID_REG(trident, T4D_STOP_B)); snd_trident_stop_all_voices()
3400 outl(0, TRID_REG(trident, T4D_AINTEN_A)); snd_trident_stop_all_voices()
3401 outl(0, TRID_REG(trident, T4D_AINTEN_B)); snd_trident_stop_all_voices()
3404 static int snd_trident_4d_dx_init(struct snd_trident *trident) snd_trident_4d_dx_init() argument
3406 struct pci_dev *pci = trident->pci; snd_trident_4d_dx_init()
3419 outl(0x00000001, TRID_REG(trident, DX_ACR2_AC97_COM_STAT)); snd_trident_4d_dx_init()
3421 outl(0x00000000, TRID_REG(trident, DX_ACR2_AC97_COM_STAT)); snd_trident_4d_dx_init()
3423 trident->ac97_ctrl = 0x0000004a; snd_trident_4d_dx_init()
3424 outl(trident->ac97_ctrl, TRID_REG(trident, DX_ACR2_AC97_COM_STAT)); snd_trident_4d_dx_init()
3428 if ((inl(TRID_REG(trident, DX_ACR2_AC97_COM_STAT)) & 0x0010) != 0) snd_trident_4d_dx_init()
3430 do_delay(trident); snd_trident_4d_dx_init()
3432 dev_err(trident->card->dev, "AC'97 codec ready error\n"); snd_trident_4d_dx_init()
3436 snd_trident_stop_all_voices(trident); snd_trident_4d_dx_init()
3444 static int snd_trident_4d_nx_init(struct snd_trident *trident) snd_trident_4d_nx_init() argument
3446 struct pci_dev *pci = trident->pci; snd_trident_4d_nx_init()
3460 outl(0x00000001, TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_4d_nx_init()
3462 outl(0x00000000, TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_4d_nx_init()
3466 if ((inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT)) & 0x0008) != 0) snd_trident_4d_nx_init()
3468 do_delay(trident); snd_trident_4d_nx_init()
3470 dev_err(trident->card->dev, "AC'97 codec ready error [0x%x]\n", snd_trident_4d_nx_init()
3471 inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT))); snd_trident_4d_nx_init()
3476 trident->ac97_ctrl = 0x00000002; snd_trident_4d_nx_init()
3477 outl(trident->ac97_ctrl, TRID_REG(trident, NX_ACR0_AC97_COM_STAT)); snd_trident_4d_nx_init()
3479 outl(NX_SB_IRQ_DISABLE, TRID_REG(trident, T4D_MISCINT)); snd_trident_4d_nx_init()
3481 snd_trident_stop_all_voices(trident); snd_trident_4d_nx_init()
3483 if (trident->tlb.entries != NULL) { snd_trident_4d_nx_init()
3486 i = trident->tlb.entries_dmaaddr; snd_trident_4d_nx_init()
3488 outl(i, TRID_REG(trident, NX_TLBC)); snd_trident_4d_nx_init()
3490 outl(0, TRID_REG(trident, NX_TLBC)); snd_trident_4d_nx_init()
3493 outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS)); snd_trident_4d_nx_init()
3494 outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3)); snd_trident_4d_nx_init()
3502 static int snd_trident_sis_init(struct snd_trident *trident) snd_trident_sis_init() argument
3506 if ((err = snd_trident_sis_reset(trident)) < 0) snd_trident_sis_init()
3509 snd_trident_stop_all_voices(trident); snd_trident_sis_init()
3512 outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS)); snd_trident_sis_init()
3540 struct snd_trident *trident; snd_trident_create() local
3562 trident = kzalloc(sizeof(*trident), GFP_KERNEL); snd_trident_create()
3563 if (trident == NULL) { snd_trident_create()
3567 trident->device = (pci->vendor << 16) | pci->device; snd_trident_create()
3568 trident->card = card; snd_trident_create()
3569 trident->pci = pci; snd_trident_create()
3570 spin_lock_init(&trident->reg_lock); snd_trident_create()
3571 spin_lock_init(&trident->event_lock); snd_trident_create()
3572 spin_lock_init(&trident->voice_alloc); snd_trident_create()
3577 trident->ChanPCM = pcm_streams; snd_trident_create()
3580 trident->synth.max_size = max_wavetable_size * 1024; snd_trident_create()
3581 trident->irq = -1; snd_trident_create()
3583 trident->midi_port = TRID_REG(trident, T4D_MPU401_BASE); snd_trident_create()
3587 kfree(trident); snd_trident_create()
3591 trident->port = pci_resource_start(pci, 0); snd_trident_create()
3594 KBUILD_MODNAME, trident)) { snd_trident_create()
3596 snd_trident_free(trident); snd_trident_create()
3599 trident->irq = pci->irq; snd_trident_create()
3602 trident->tlb.entries = NULL; snd_trident_create()
3603 trident->tlb.buffer.area = NULL; snd_trident_create()
3604 if (trident->device == TRIDENT_DEVICE_ID_NX) { snd_trident_create()
3605 if ((err = snd_trident_tlb_alloc(trident)) < 0) { snd_trident_create()
3606 snd_trident_free(trident); snd_trident_create()
3611 trident->spdif_bits = trident->spdif_pcm_bits = SNDRV_PCM_DEFAULT_CON_SPDIF; snd_trident_create()
3614 switch (trident->device) { snd_trident_create()
3616 err = snd_trident_4d_dx_init(trident); snd_trident_create()
3619 err = snd_trident_4d_nx_init(trident); snd_trident_create()
3622 err = snd_trident_sis_init(trident); snd_trident_create()
3629 snd_trident_free(trident); snd_trident_create()
3633 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) { snd_trident_create()
3634 snd_trident_free(trident); snd_trident_create()
3638 if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0) snd_trident_create()
3643 voice = &trident->synth.voices[i]; snd_trident_create()
3645 voice->trident = trident; snd_trident_create()
3649 tmix = &trident->pcm_mixer[i]; snd_trident_create()
3656 snd_trident_enable_eso(trident); snd_trident_create()
3658 snd_trident_proc_init(trident); snd_trident_create()
3659 *rtrident = trident; snd_trident_create()
3669 Parameters: trident - device specific private data for 4DWave card
3675 static int snd_trident_free(struct snd_trident *trident) snd_trident_free() argument
3677 snd_trident_free_gameport(trident); snd_trident_free()
3678 snd_trident_disable_eso(trident); snd_trident_free()
3680 if (trident->device == TRIDENT_DEVICE_ID_NX) snd_trident_free()
3681 outb(0x00, TRID_REG(trident, NX_SPCTRL_SPCSO + 3)); snd_trident_free()
3682 else if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_free()
3683 outl(0, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); snd_trident_free()
3685 if (trident->irq >= 0) snd_trident_free()
3686 free_irq(trident->irq, trident); snd_trident_free()
3687 if (trident->tlb.buffer.area) { snd_trident_free()
3688 outl(0, TRID_REG(trident, NX_TLBC)); snd_trident_free()
3689 snd_util_memhdr_free(trident->tlb.memhdr); snd_trident_free()
3690 if (trident->tlb.silent_page.area) snd_trident_free()
3691 snd_dma_free_pages(&trident->tlb.silent_page); snd_trident_free()
3692 vfree(trident->tlb.shadow_entries); snd_trident_free()
3693 snd_dma_free_pages(&trident->tlb.buffer); snd_trident_free()
3695 pci_release_regions(trident->pci); snd_trident_free()
3696 pci_disable_device(trident->pci); snd_trident_free()
3697 kfree(trident); snd_trident_free()
3706 Parameters: trident - device specific private data for 4DWave card
3721 struct snd_trident *trident = dev_id; snd_trident_interrupt() local
3726 audio_int = inl(TRID_REG(trident, T4D_MISCINT)); snd_trident_interrupt()
3731 spin_lock(&trident->reg_lock); snd_trident_interrupt()
3732 stimer = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff; snd_trident_interrupt()
3733 chn_int = inl(TRID_REG(trident, T4D_AINT_A)); snd_trident_interrupt()
3736 outl(chn_int, TRID_REG(trident, T4D_AINT_A)); /* ack */ snd_trident_interrupt()
3738 chn_int = inl(TRID_REG(trident, T4D_AINT_B)); snd_trident_interrupt()
3745 voice = &trident->synth.voices[channel]; snd_trident_interrupt()
3747 outl(mask, TRID_REG(trident, T4D_STOP_B)); snd_trident_interrupt()
3755 trident->spurious_irq_count++; snd_trident_interrupt()
3756 if (trident->spurious_irq_max_delta < (unsigned int)delta) snd_trident_interrupt()
3757 trident->spurious_irq_max_delta = delta; snd_trident_interrupt()
3763 tmp = inw(TRID_REG(trident, T4D_SBBL_SBCL)); snd_trident_interrupt()
3764 if (trident->bDMAStart & 0x40) snd_trident_interrupt()
3769 tmp = inl(TRID_REG(trident, NX_SPCTRL_SPCSO)) & 0x00ffffff; snd_trident_interrupt()
3777 snd_trident_stop_voice(trident, voice->number); snd_trident_interrupt()
3778 snd_trident_write_eso_reg(trident, voice, tmp); snd_trident_interrupt()
3779 snd_trident_start_voice(trident, voice->number); snd_trident_interrupt()
3784 snd_trident_stop_voice(trident, voice->number); snd_trident_interrupt()
3785 snd_trident_write_cso_reg(trident, voice, voice->isync_mark); snd_trident_interrupt()
3786 snd_trident_write_eso_reg(trident, voice, voice->ESO); snd_trident_interrupt()
3787 snd_trident_start_voice(trident, voice->number); snd_trident_interrupt()
3792 snd_trident_stop_voice(trident, voice->extra->number); snd_trident_interrupt()
3793 snd_trident_write_cso_reg(trident, voice->extra, 0); snd_trident_interrupt()
3794 snd_trident_start_voice(trident, voice->extra->number); snd_trident_interrupt()
3797 spin_unlock(&trident->reg_lock); snd_trident_interrupt()
3799 spin_lock(&trident->reg_lock); snd_trident_interrupt()
3801 outl(chn_int, TRID_REG(trident, T4D_AINT_B)); /* ack */ snd_trident_interrupt()
3803 spin_unlock(&trident->reg_lock); snd_trident_interrupt()
3806 if (trident->rmidi) { snd_trident_interrupt()
3807 snd_mpu401_uart_interrupt(irq, trident->rmidi->private_data); snd_trident_interrupt()
3809 inb(TRID_REG(trident, T4D_MPUR0)); snd_trident_interrupt()
3812 // outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT)); snd_trident_interrupt()
3816 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port) snd_trident_alloc_voice() argument
3822 spin_lock_irqsave(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3824 idx = snd_trident_allocate_pcm_channel(trident); snd_trident_alloc_voice()
3826 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3829 pvoice = &trident->synth.voices[idx]; snd_trident_alloc_voice()
3836 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3840 idx = snd_trident_allocate_synth_channel(trident); snd_trident_alloc_voice()
3842 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3845 pvoice = &trident->synth.voices[idx]; snd_trident_alloc_voice()
3851 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3856 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_alloc_voice()
3862 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice) snd_trident_free_voice() argument
3869 snd_trident_clear_voices(trident, voice->number, voice->number); snd_trident_free_voice()
3870 spin_lock_irqsave(&trident->voice_alloc, flags); snd_trident_free_voice()
3875 snd_trident_free_pcm_channel(trident, voice->number); snd_trident_free_voice()
3877 snd_trident_free_synth_channel(trident, voice->number); snd_trident_free_voice()
3883 spin_unlock_irqrestore(&trident->voice_alloc, flags); snd_trident_free_voice()
3890 static void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max) snd_trident_clear_voices() argument
3899 outl(mask[0], TRID_REG(trident, T4D_STOP_A)); snd_trident_clear_voices()
3900 val = inl(TRID_REG(trident, T4D_AINTEN_A)); snd_trident_clear_voices()
3901 outl(val & ~mask[0], TRID_REG(trident, T4D_AINTEN_A)); snd_trident_clear_voices()
3904 outl(mask[1], TRID_REG(trident, T4D_STOP_B)); snd_trident_clear_voices()
3905 val = inl(TRID_REG(trident, T4D_AINTEN_B)); snd_trident_clear_voices()
3906 outl(val & ~mask[1], TRID_REG(trident, T4D_AINTEN_B)); snd_trident_clear_voices()
3914 struct snd_trident *trident = card->private_data; snd_trident_suspend() local
3916 trident->in_suspend = 1; snd_trident_suspend()
3918 snd_pcm_suspend_all(trident->pcm); snd_trident_suspend()
3919 snd_pcm_suspend_all(trident->foldback); snd_trident_suspend()
3920 snd_pcm_suspend_all(trident->spdif); snd_trident_suspend()
3922 snd_ac97_suspend(trident->ac97); snd_trident_suspend()
3923 snd_ac97_suspend(trident->ac97_sec); snd_trident_suspend()
3930 struct snd_trident *trident = card->private_data; snd_trident_resume() local
3932 switch (trident->device) { snd_trident_resume()
3934 snd_trident_4d_dx_init(trident); snd_trident_resume()
3937 snd_trident_4d_nx_init(trident); snd_trident_resume()
3940 snd_trident_sis_init(trident); snd_trident_resume()
3944 snd_ac97_resume(trident->ac97); snd_trident_resume()
3945 snd_ac97_resume(trident->ac97_sec); snd_trident_resume()
3948 outl(trident->musicvol_wavevol, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); snd_trident_resume()
3950 snd_trident_enable_eso(trident); snd_trident_resume()
3953 trident->in_suspend = 0; snd_trident_resume()
H A Dtrident_memory.c32 #include "trident.h"
37 #define __set_tlb_bus(trident,page,ptr,addr) \
38 do { (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)); \
39 (trident)->tlb.shadow_entries[page] = (ptr); } while (0)
40 #define __tlb_to_ptr(trident,page) \
41 (void*)((trident)->tlb.shadow_entries[page])
42 #define __tlb_to_addr(trident,page) \
43 (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1))
50 #define set_tlb_bus(trident,page,ptr,addr) __set_tlb_bus(trident,page,ptr,addr)
52 #define set_silent_tlb(trident,page) __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr)
58 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, page)
60 #define page_to_addr(trident,page) __tlb_to_addr(trident, page)
68 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, (page) << 1)
69 #define page_to_addr(trident,page) __tlb_to_addr(trident, (page) << 1)
72 static inline void set_tlb_bus(struct snd_trident *trident, int page, set_tlb_bus() argument
76 __set_tlb_bus(trident, page, ptr, addr); set_tlb_bus()
77 __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE); set_tlb_bus()
79 static inline void set_silent_tlb(struct snd_trident *trident, int page) set_silent_tlb() argument
82 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); set_silent_tlb()
83 __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); set_silent_tlb()
98 #define page_to_ptr(trident,page) __tlb_to_ptr(trident, (page) * UNIT_PAGES)
99 #define page_to_addr(trident,page) __tlb_to_addr(trident, (page) * UNIT_PAGES)
102 static inline void set_tlb_bus(struct snd_trident *trident, int page, set_tlb_bus() argument
108 __set_tlb_bus(trident, page, ptr, addr); set_tlb_bus()
113 static inline void set_silent_tlb(struct snd_trident *trident, int page) set_silent_tlb() argument
118 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); set_silent_tlb()
124 static inline void *offset_ptr(struct snd_trident *trident, int offset) offset_ptr() argument
127 ptr = page_to_ptr(trident, get_aligned_page(offset)); offset_ptr()
189 snd_trident_alloc_sg_pages(struct snd_trident *trident, snd_trident_alloc_sg_pages() argument
201 hdr = trident->tlb.memhdr; snd_trident_alloc_sg_pages()
226 set_tlb_bus(trident, page, ptr, addr); snd_trident_alloc_sg_pages()
236 snd_trident_alloc_cont_pages(struct snd_trident *trident, snd_trident_alloc_cont_pages() argument
250 hdr = trident->tlb.memhdr; snd_trident_alloc_cont_pages()
271 set_tlb_bus(trident, page, ptr, addr); snd_trident_alloc_cont_pages()
281 snd_trident_alloc_pages(struct snd_trident *trident, snd_trident_alloc_pages() argument
284 if (snd_BUG_ON(!trident || !substream)) snd_trident_alloc_pages()
287 return snd_trident_alloc_sg_pages(trident, substream); snd_trident_alloc_pages()
289 return snd_trident_alloc_cont_pages(trident, substream); snd_trident_alloc_pages()
296 int snd_trident_free_pages(struct snd_trident *trident, snd_trident_free_pages() argument
302 if (snd_BUG_ON(!trident || !blk)) snd_trident_free_pages()
305 hdr = trident->tlb.memhdr; snd_trident_free_pages()
309 set_silent_tlb(trident, page); snd_trident_free_pages()
H A Dtrident.c29 #include "trident.h"
81 struct snd_trident *trident; snd_trident_probe() local
101 &trident)) < 0) { snd_trident_probe()
105 card->private_data = trident; snd_trident_probe()
107 switch (trident->device) { snd_trident_probe()
121 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_probe()
128 card->shortname, trident->port, trident->irq); snd_trident_probe()
130 if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { snd_trident_probe()
134 switch (trident->device) { snd_trident_probe()
137 if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { snd_trident_probe()
143 if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { snd_trident_probe()
144 if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { snd_trident_probe()
149 if (trident->device != TRIDENT_DEVICE_ID_SI7018 && snd_trident_probe()
151 trident->midi_port, snd_trident_probe()
154 -1, &trident->rmidi)) < 0) { snd_trident_probe()
159 snd_trident_create_gameport(trident); snd_trident_probe()
H A Dtrident.h51 #define TRID_REG(trident, x) ((trident)->port + (x))
255 struct snd_trident * trident; member in struct:snd_trident_port
312 struct snd_trident *trident; member in struct:snd_trident_voice
421 int snd_trident_create_gameport(struct snd_trident *trident);
423 int snd_trident_pcm(struct snd_trident *trident, int device);
424 int snd_trident_foldback_pcm(struct snd_trident *trident, int device);
425 int snd_trident_spdif_pcm(struct snd_trident *trident, int device);
426 int snd_trident_attach_synthesizer(struct snd_trident * trident);
427 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type,
429 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice);
430 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice);
431 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice);
432 void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice);
436 struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident,
438 int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk);
439 struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size);
440 int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk);
441 int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk,
/linux-4.1.27/sound/pci/
H A DMakefile80 trident/ \
H A Dsis7019.c363 /* This was copied from the trident driver, but it seems its gotten sis_rate_to_delta()
/linux-4.1.27/drivers/video/fbdev/
H A Dtridentfb.c26 #include <video/trident.h>
1597 * Parse user specified options (`video=trident:')
1599 * video=trident:800x600,bpp=16,noaccel

Completed in 198 milliseconds