Lines Matching refs:emu
176 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_open_playback_channel() local
177 struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]); in snd_p16v_pcm_open_playback_channel()
187 epcm->emu = emu; in snd_p16v_pcm_open_playback_channel()
198 channel->emu = emu; in snd_p16v_pcm_open_playback_channel()
203 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_playback_channel()
206 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_playback_channel()
224 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_open_capture_channel() local
225 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice); in snd_p16v_pcm_open_capture_channel()
235 epcm->emu = emu; in snd_p16v_pcm_open_capture_channel()
246 channel->emu = emu; in snd_p16v_pcm_open_capture_channel()
251 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_capture_channel()
254 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_capture_channel()
269 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_playback() local
272 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0; in snd_p16v_pcm_close_playback()
280 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_capture() local
283 emu->p16v_capture_voice.use = 0; in snd_p16v_pcm_close_capture()
340 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_playback() local
342 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_playback()
343 u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
349 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
356 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
359 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
361 emu->p16v_buffer.addr, emu->p16v_buffer.area, in snd_p16v_pcm_prepare_playback()
362 emu->p16v_buffer.bytes); in snd_p16v_pcm_prepare_playback()
364 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_playback()
367 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x8080); in snd_p16v_pcm_prepare_playback()
370 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x4040); in snd_p16v_pcm_prepare_playback()
373 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x2020); in snd_p16v_pcm_prepare_playback()
377 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x0000); in snd_p16v_pcm_prepare_playback()
386 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer.addr+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
387 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); in snd_p16v_pcm_prepare_playback()
388 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); in snd_p16v_pcm_prepare_playback()
389 snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_playback()
391 snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes in snd_p16v_pcm_prepare_playback()
392 snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); in snd_p16v_pcm_prepare_playback()
393 snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); in snd_p16v_pcm_prepare_playback()
394 snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); in snd_p16v_pcm_prepare_playback()
402 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_capture() local
404 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_capture()
415 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_capture()
418 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0800); in snd_p16v_pcm_prepare_capture()
421 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0400); in snd_p16v_pcm_prepare_capture()
424 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0200); in snd_p16v_pcm_prepare_capture()
428 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0000); in snd_p16v_pcm_prepare_capture()
432 snd_emu10k1_ptr20_write(emu, 0x13, channel, 0); in snd_p16v_pcm_prepare_capture()
433 snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_capture()
434 …snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffe… in snd_p16v_pcm_prepare_capture()
435 snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0); in snd_p16v_pcm_prepare_capture()
442 static void snd_p16v_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_enable() argument
447 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_enable()
448 enable = inl(emu->port + INTE2) | intrenb; in snd_p16v_intr_enable()
449 outl(enable, emu->port + INTE2); in snd_p16v_intr_enable()
450 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_enable()
453 static void snd_p16v_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_disable() argument
458 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_disable()
459 disable = inl(emu->port + INTE2) & (~intrenb); in snd_p16v_intr_disable()
460 outl(disable, emu->port + INTE2); in snd_p16v_intr_disable()
461 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_disable()
468 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_playback() local
488 if (snd_pcm_substream_chip(s) != emu || in snd_p16v_pcm_trigger_playback()
493 channel = substream->pcm->device-emu->p16v_device_offset; in snd_p16v_pcm_trigger_playback()
504 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_playback()
505 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)| … in snd_p16v_pcm_trigger_playback()
508 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_playback()
509 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_playback()
522 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_capture() local
531 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_capture()
532 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)|(… in snd_p16v_pcm_trigger_capture()
536 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_capture()
537 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_capture()
552 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_playback() local
556 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_pointer_playback()
560 ptr3 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
561 ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
562 ptr4 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
563 if (ptr3 != ptr4) ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
577 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_capture() local
586 ptr1 = snd_emu10k1_ptr20_read(emu, CAPTURE_POINTER, channel); in snd_p16v_pcm_pointer_capture()
591 dev_warn(emu->card->dev, "buffer capture limited!\n"); in snd_p16v_pcm_pointer_capture()
640 int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) in snd_p16v_pcm() argument
648 emu->p16v_device_offset = device; in snd_p16v_pcm()
650 if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0) in snd_p16v_pcm()
653 pcm->private_data = emu; in snd_p16v_pcm()
662 emu->pcm_p16v = pcm; in snd_p16v_pcm()
669 snd_dma_pci_data(emu->pci), in snd_p16v_pcm()
683 snd_dma_pci_data(emu->pci), in snd_p16v_pcm()
708 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_get() local
713 value = snd_emu10k1_ptr20_read(emu, reg, high_low); in snd_p16v_volume_get()
727 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_put() local
732 oval = value = snd_emu10k1_ptr20_read(emu, reg, 0); in snd_p16v_volume_put()
743 snd_emu10k1_ptr20_write(emu, reg, 0, value); in snd_p16v_volume_put()
763 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_get() local
765 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; in snd_p16v_capture_source_get()
772 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_put() local
781 change = (emu->p16v_capture_source != val); in snd_p16v_capture_source_put()
783 emu->p16v_capture_source = val; in snd_p16v_capture_source_put()
785 mask = snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & 0xffff; in snd_p16v_capture_source_put()
786 snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, source | mask); in snd_p16v_capture_source_put()
802 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_get() local
804 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; in snd_p16v_capture_channel_get()
811 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_put() local
819 change = (emu->p16v_capture_channel != val); in snd_p16v_capture_channel_put()
821 emu->p16v_capture_channel = val; in snd_p16v_capture_channel_put()
822 tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE, 0) & 0xfffc; in snd_p16v_capture_channel_put()
823 snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, tmp | val); in snd_p16v_capture_channel_put()
866 int snd_p16v_mixer(struct snd_emu10k1 *emu) in snd_p16v_mixer() argument
869 struct snd_card *card = emu->card; in snd_p16v_mixer()
873 emu))) < 0) in snd_p16v_mixer()
883 int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_alloc_pm_buffer() argument
885 emu->p16v_saved = vmalloc(NUM_CHS * 4 * 0x80); in snd_p16v_alloc_pm_buffer()
886 if (! emu->p16v_saved) in snd_p16v_alloc_pm_buffer()
891 void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_free_pm_buffer() argument
893 vfree(emu->p16v_saved); in snd_p16v_free_pm_buffer()
896 void snd_p16v_suspend(struct snd_emu10k1 *emu) in snd_p16v_suspend() argument
901 val = emu->p16v_saved; in snd_p16v_suspend()
904 *val = snd_emu10k1_ptr20_read(emu, i, ch); in snd_p16v_suspend()
907 void snd_p16v_resume(struct snd_emu10k1 *emu) in snd_p16v_resume() argument
912 val = emu->p16v_saved; in snd_p16v_resume()
915 snd_emu10k1_ptr20_write(emu, i, ch, *val); in snd_p16v_resume()