Lines Matching refs:emu

162 	struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);  in snd_p16v_pcm_open_playback_channel()  local
163 struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]); in snd_p16v_pcm_open_playback_channel()
173 epcm->emu = emu; in snd_p16v_pcm_open_playback_channel()
184 channel->emu = emu; in snd_p16v_pcm_open_playback_channel()
189 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_playback_channel()
192 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_playback_channel()
210 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_open_capture_channel() local
211 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice); in snd_p16v_pcm_open_capture_channel()
221 epcm->emu = emu; in snd_p16v_pcm_open_capture_channel()
232 channel->emu = emu; in snd_p16v_pcm_open_capture_channel()
237 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_capture_channel()
240 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_capture_channel()
255 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_playback() local
258 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0; in snd_p16v_pcm_close_playback()
266 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_capture() local
269 emu->p16v_capture_voice.use = 0; in snd_p16v_pcm_close_capture()
288 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_playback() local
290 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_playback()
291 u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
297 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
304 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
307 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
309 emu->p16v_buffer.addr, emu->p16v_buffer.area, in snd_p16v_pcm_prepare_playback()
310 emu->p16v_buffer.bytes); in snd_p16v_pcm_prepare_playback()
312 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_playback()
315 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x8080); in snd_p16v_pcm_prepare_playback()
318 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x4040); in snd_p16v_pcm_prepare_playback()
321 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x2020); in snd_p16v_pcm_prepare_playback()
325 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x0000); in snd_p16v_pcm_prepare_playback()
334 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer.addr+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
335 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); in snd_p16v_pcm_prepare_playback()
336 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); in snd_p16v_pcm_prepare_playback()
337 snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_playback()
339 snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes in snd_p16v_pcm_prepare_playback()
340 snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); in snd_p16v_pcm_prepare_playback()
341 snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); in snd_p16v_pcm_prepare_playback()
342 snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); in snd_p16v_pcm_prepare_playback()
350 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_capture() local
352 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_capture()
363 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_capture()
366 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0800); in snd_p16v_pcm_prepare_capture()
369 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0400); in snd_p16v_pcm_prepare_capture()
372 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0200); in snd_p16v_pcm_prepare_capture()
376 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0000); in snd_p16v_pcm_prepare_capture()
380 snd_emu10k1_ptr20_write(emu, 0x13, channel, 0); in snd_p16v_pcm_prepare_capture()
381 snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_capture()
382 …snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffe… in snd_p16v_pcm_prepare_capture()
383 snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0); in snd_p16v_pcm_prepare_capture()
390 static void snd_p16v_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_enable() argument
395 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_enable()
396 enable = inl(emu->port + INTE2) | intrenb; in snd_p16v_intr_enable()
397 outl(enable, emu->port + INTE2); in snd_p16v_intr_enable()
398 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_enable()
401 static void snd_p16v_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_disable() argument
406 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_disable()
407 disable = inl(emu->port + INTE2) & (~intrenb); in snd_p16v_intr_disable()
408 outl(disable, emu->port + INTE2); in snd_p16v_intr_disable()
409 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_disable()
416 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_playback() local
436 if (snd_pcm_substream_chip(s) != emu || in snd_p16v_pcm_trigger_playback()
441 channel = substream->pcm->device-emu->p16v_device_offset; in snd_p16v_pcm_trigger_playback()
452 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_playback()
453 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)| … in snd_p16v_pcm_trigger_playback()
456 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_playback()
457 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_playback()
470 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_capture() local
479 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_capture()
480 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)|(… in snd_p16v_pcm_trigger_capture()
484 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_capture()
485 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_capture()
500 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_playback() local
504 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_pointer_playback()
508 ptr3 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
509 ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
510 ptr4 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
511 if (ptr3 != ptr4) ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
525 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_capture() local
534 ptr1 = snd_emu10k1_ptr20_read(emu, CAPTURE_POINTER, channel); in snd_p16v_pcm_pointer_capture()
539 dev_warn(emu->card->dev, "buffer capture limited!\n"); in snd_p16v_pcm_pointer_capture()
582 int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) in snd_p16v_pcm() argument
590 emu->p16v_device_offset = device; in snd_p16v_pcm()
592 if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0) in snd_p16v_pcm()
595 pcm->private_data = emu; in snd_p16v_pcm()
604 emu->pcm_p16v = pcm; in snd_p16v_pcm()
610 &emu->pci->dev, in snd_p16v_pcm()
623 &emu->pci->dev, in snd_p16v_pcm()
647 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_get() local
652 value = snd_emu10k1_ptr20_read(emu, reg, high_low); in snd_p16v_volume_get()
666 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_put() local
671 oval = value = snd_emu10k1_ptr20_read(emu, reg, 0); in snd_p16v_volume_put()
682 snd_emu10k1_ptr20_write(emu, reg, 0, value); in snd_p16v_volume_put()
702 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_get() local
704 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; in snd_p16v_capture_source_get()
711 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_put() local
720 change = (emu->p16v_capture_source != val); in snd_p16v_capture_source_put()
722 emu->p16v_capture_source = val; in snd_p16v_capture_source_put()
724 mask = snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & 0xffff; in snd_p16v_capture_source_put()
725 snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, source | mask); in snd_p16v_capture_source_put()
741 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_get() local
743 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; in snd_p16v_capture_channel_get()
750 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_put() local
758 change = (emu->p16v_capture_channel != val); in snd_p16v_capture_channel_put()
760 emu->p16v_capture_channel = val; in snd_p16v_capture_channel_put()
761 tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE, 0) & 0xfffc; in snd_p16v_capture_channel_put()
762 snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, tmp | val); in snd_p16v_capture_channel_put()
805 int snd_p16v_mixer(struct snd_emu10k1 *emu) in snd_p16v_mixer() argument
808 struct snd_card *card = emu->card; in snd_p16v_mixer()
812 emu))) < 0) in snd_p16v_mixer()
822 int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_alloc_pm_buffer() argument
824 emu->p16v_saved = vmalloc(array_size(NUM_CHS * 4, 0x80)); in snd_p16v_alloc_pm_buffer()
825 if (! emu->p16v_saved) in snd_p16v_alloc_pm_buffer()
830 void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_free_pm_buffer() argument
832 vfree(emu->p16v_saved); in snd_p16v_free_pm_buffer()
835 void snd_p16v_suspend(struct snd_emu10k1 *emu) in snd_p16v_suspend() argument
840 val = emu->p16v_saved; in snd_p16v_suspend()
843 *val = snd_emu10k1_ptr20_read(emu, i, ch); in snd_p16v_suspend()
846 void snd_p16v_resume(struct snd_emu10k1 *emu) in snd_p16v_resume() argument
851 val = emu->p16v_saved; in snd_p16v_resume()
854 snd_emu10k1_ptr20_write(emu, i, ch, *val); in snd_p16v_resume()