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()
211 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_open_capture_channel() local
212 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice); in snd_p16v_pcm_open_capture_channel()
222 epcm->emu = emu; in snd_p16v_pcm_open_capture_channel()
233 channel->emu = emu; in snd_p16v_pcm_open_capture_channel()
238 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_capture_channel()
241 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_capture_channel()
257 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_playback() local
260 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0; in snd_p16v_pcm_close_playback()
268 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_close_capture() local
271 emu->p16v_capture_voice.use = 0; in snd_p16v_pcm_close_capture()
290 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_playback() local
292 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_playback()
293 u32 *table_base = (u32 *)(emu->p16v_buffer->area+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
299 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
306 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
309 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
311 emu->p16v_buffer->addr, emu->p16v_buffer->area, in snd_p16v_pcm_prepare_playback()
312 emu->p16v_buffer->bytes); in snd_p16v_pcm_prepare_playback()
314 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_playback()
317 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x8080); in snd_p16v_pcm_prepare_playback()
320 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x4040); in snd_p16v_pcm_prepare_playback()
323 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x2020); in snd_p16v_pcm_prepare_playback()
327 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x0000); in snd_p16v_pcm_prepare_playback()
336 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer->addr+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
337 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); in snd_p16v_pcm_prepare_playback()
338 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); in snd_p16v_pcm_prepare_playback()
339 snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_playback()
341 snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes in snd_p16v_pcm_prepare_playback()
342 snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); in snd_p16v_pcm_prepare_playback()
343 snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); in snd_p16v_pcm_prepare_playback()
344 snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); in snd_p16v_pcm_prepare_playback()
352 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_prepare_capture() local
354 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_capture()
365 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_capture()
368 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0800); in snd_p16v_pcm_prepare_capture()
371 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0400); in snd_p16v_pcm_prepare_capture()
374 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0200); in snd_p16v_pcm_prepare_capture()
378 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0000); in snd_p16v_pcm_prepare_capture()
382 snd_emu10k1_ptr20_write(emu, 0x13, channel, 0); in snd_p16v_pcm_prepare_capture()
383 snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_capture()
384 …snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffe… in snd_p16v_pcm_prepare_capture()
385 snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0); in snd_p16v_pcm_prepare_capture()
392 static void snd_p16v_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_enable() argument
397 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_enable()
398 enable = inl(emu->port + INTE2) | intrenb; in snd_p16v_intr_enable()
399 outl(enable, emu->port + INTE2); in snd_p16v_intr_enable()
400 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_enable()
403 static void snd_p16v_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb) in snd_p16v_intr_disable() argument
408 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_disable()
409 disable = inl(emu->port + INTE2) & (~intrenb); in snd_p16v_intr_disable()
410 outl(disable, emu->port + INTE2); in snd_p16v_intr_disable()
411 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_disable()
418 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_playback() local
438 if (snd_pcm_substream_chip(s) != emu || in snd_p16v_pcm_trigger_playback()
443 channel = substream->pcm->device-emu->p16v_device_offset; in snd_p16v_pcm_trigger_playback()
454 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_playback()
455 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)| … in snd_p16v_pcm_trigger_playback()
458 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_playback()
459 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_playback()
472 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_trigger_capture() local
481 snd_p16v_intr_enable(emu, inte); in snd_p16v_pcm_trigger_capture()
482 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)|(… in snd_p16v_pcm_trigger_capture()
486 …snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) &… in snd_p16v_pcm_trigger_capture()
487 snd_p16v_intr_disable(emu, inte); in snd_p16v_pcm_trigger_capture()
502 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_playback() local
506 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_pointer_playback()
510 ptr3 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
511 ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
512 ptr4 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
513 if (ptr3 != ptr4) ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
527 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); in snd_p16v_pcm_pointer_capture() local
536 ptr1 = snd_emu10k1_ptr20_read(emu, CAPTURE_POINTER, channel); in snd_p16v_pcm_pointer_capture()
541 dev_warn(emu->card->dev, "buffer capture limited!\n"); in snd_p16v_pcm_pointer_capture()
570 int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) in snd_p16v_pcm() argument
578 emu->p16v_device_offset = device; in snd_p16v_pcm()
580 err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm); in snd_p16v_pcm()
584 pcm->private_data = emu; in snd_p16v_pcm()
593 emu->pcm_p16v = pcm; in snd_p16v_pcm()
599 &emu->pci->dev, in snd_p16v_pcm()
612 &emu->pci->dev, in snd_p16v_pcm()
636 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_get() local
641 value = snd_emu10k1_ptr20_read(emu, reg, high_low); in snd_p16v_volume_get()
655 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_volume_put() local
660 oval = value = snd_emu10k1_ptr20_read(emu, reg, 0); in snd_p16v_volume_put()
671 snd_emu10k1_ptr20_write(emu, reg, 0, value); in snd_p16v_volume_put()
691 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_get() local
693 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; in snd_p16v_capture_source_get()
700 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_source_put() local
709 change = (emu->p16v_capture_source != val); in snd_p16v_capture_source_put()
711 emu->p16v_capture_source = val; in snd_p16v_capture_source_put()
713 mask = snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & 0xffff; in snd_p16v_capture_source_put()
714 snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, source | mask); in snd_p16v_capture_source_put()
730 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_get() local
732 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; in snd_p16v_capture_channel_get()
739 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); in snd_p16v_capture_channel_put() local
747 change = (emu->p16v_capture_channel != val); in snd_p16v_capture_channel_put()
749 emu->p16v_capture_channel = val; in snd_p16v_capture_channel_put()
750 tmp = snd_emu10k1_ptr20_read(emu, CAPTURE_P16V_SOURCE, 0) & 0xfffc; in snd_p16v_capture_channel_put()
751 snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, tmp | val); in snd_p16v_capture_channel_put()
794 int snd_p16v_mixer(struct snd_emu10k1 *emu) in snd_p16v_mixer() argument
797 struct snd_card *card = emu->card; in snd_p16v_mixer()
800 err = snd_ctl_add(card, snd_ctl_new1(&p16v_mixer_controls[i], emu)); in snd_p16v_mixer()
811 int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_alloc_pm_buffer() argument
813 emu->p16v_saved = vmalloc(array_size(NUM_CHS * 4, 0x80)); in snd_p16v_alloc_pm_buffer()
814 if (! emu->p16v_saved) in snd_p16v_alloc_pm_buffer()
819 void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu) in snd_p16v_free_pm_buffer() argument
821 vfree(emu->p16v_saved); in snd_p16v_free_pm_buffer()
824 void snd_p16v_suspend(struct snd_emu10k1 *emu) in snd_p16v_suspend() argument
829 val = emu->p16v_saved; in snd_p16v_suspend()
832 *val = snd_emu10k1_ptr20_read(emu, i, ch); in snd_p16v_suspend()
835 void snd_p16v_resume(struct snd_emu10k1 *emu) in snd_p16v_resume() argument
840 val = emu->p16v_saved; in snd_p16v_resume()
843 snd_emu10k1_ptr20_write(emu, i, ch, *val); in snd_p16v_resume()