Lines Matching refs:chip

50 		printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg);\
55 printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg);\
138 static int _cx88_start_audio_dma(snd_cx88_card_t *chip) in _cx88_start_audio_dma() argument
140 struct cx88_audio_buffer *buf = chip->buf; in _cx88_start_audio_dma()
141 struct cx88_core *core=chip->core; in _cx88_start_audio_dma()
148 cx88_sram_channel_setup(chip->core, audio_ch, buf->bpl, buf->risc.dma); in _cx88_start_audio_dma()
155 atomic_set(&chip->count, 0); in _cx88_start_audio_dma()
159 chip->num_periods, buf->bpl * chip->num_periods); in _cx88_start_audio_dma()
169 cx_set(MO_PCI_INTMSK, chip->core->pci_irqmask | PCI_INT_AUDINT); in _cx88_start_audio_dma()
176 cx88_sram_channel_dump(chip->core, audio_ch); in _cx88_start_audio_dma()
184 static int _cx88_stop_audio_dma(snd_cx88_card_t *chip) in _cx88_stop_audio_dma() argument
186 struct cx88_core *core=chip->core; in _cx88_stop_audio_dma()
198 cx88_sram_channel_dump(chip->core, &cx88_sram_channels[SRAM_CH25]); in _cx88_stop_audio_dma()
224 static void cx8801_aud_irq(snd_cx88_card_t *chip) in cx8801_aud_irq() argument
226 struct cx88_core *core = chip->core; in cx8801_aud_irq()
251 atomic_set(&chip->count, cx_read(MO_AUDD_GPCNT)); in cx8801_aud_irq()
252 snd_pcm_period_elapsed(chip->substream); in cx8801_aud_irq()
262 snd_cx88_card_t *chip = dev_id; in cx8801_irq() local
263 struct cx88_core *core = chip->core; in cx8801_irq()
280 cx8801_aud_irq(chip); in cx8801_irq()
294 static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages) in cx88_alsa_dma_init() argument
296 struct cx88_audio_buffer *buf = chip->buf; in cx88_alsa_dma_init()
371 static int dsp_buffer_free(snd_cx88_card_t *chip) in dsp_buffer_free() argument
373 struct cx88_riscmem *risc = &chip->buf->risc; in dsp_buffer_free()
375 BUG_ON(!chip->dma_size); in dsp_buffer_free()
378 cx88_alsa_dma_unmap(chip); in dsp_buffer_free()
379 cx88_alsa_dma_free(chip->buf); in dsp_buffer_free()
381 pci_free_consistent(chip->pci, risc->size, risc->cpu, risc->dma); in dsp_buffer_free()
382 kfree(chip->buf); in dsp_buffer_free()
384 chip->buf = NULL; in dsp_buffer_free()
423 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); in snd_cx88_pcm_open() local
427 if (!chip) { in snd_cx88_pcm_open()
437 chip->substream = substream; in snd_cx88_pcm_open()
468 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); in snd_cx88_hw_params() local
474 dsp_buffer_free(chip); in snd_cx88_hw_params()
478 chip->period_size = params_period_bytes(hw_params); in snd_cx88_hw_params()
479 chip->num_periods = params_periods(hw_params); in snd_cx88_hw_params()
480 chip->dma_size = chip->period_size * params_periods(hw_params); in snd_cx88_hw_params()
482 BUG_ON(!chip->dma_size); in snd_cx88_hw_params()
483 BUG_ON(chip->num_periods & (chip->num_periods-1)); in snd_cx88_hw_params()
489 chip->buf = buf; in snd_cx88_hw_params()
490 buf->bpl = chip->period_size; in snd_cx88_hw_params()
492 ret = cx88_alsa_dma_init(chip, in snd_cx88_hw_params()
493 (PAGE_ALIGN(chip->dma_size) >> PAGE_SHIFT)); in snd_cx88_hw_params()
497 ret = cx88_alsa_dma_map(chip); in snd_cx88_hw_params()
501 ret = cx88_risc_databuffer(chip->pci, &buf->risc, buf->sglist, in snd_cx88_hw_params()
502 chip->period_size, chip->num_periods, 1); in snd_cx88_hw_params()
510 substream->runtime->dma_area = chip->buf->vaddr; in snd_cx88_hw_params()
511 substream->runtime->dma_bytes = chip->dma_size; in snd_cx88_hw_params()
526 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); in snd_cx88_hw_free() local
529 dsp_buffer_free(chip); in snd_cx88_hw_free()
549 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); in snd_cx88_card_trigger() local
553 spin_lock(&chip->reg_lock); in snd_cx88_card_trigger()
557 err=_cx88_start_audio_dma(chip); in snd_cx88_card_trigger()
560 err=_cx88_stop_audio_dma(chip); in snd_cx88_card_trigger()
567 spin_unlock(&chip->reg_lock); in snd_cx88_card_trigger()
577 snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); in snd_cx88_pointer() local
581 count = atomic_read(&chip->count); in snd_cx88_pointer()
617 static int snd_cx88_pcm(snd_cx88_card_t *chip, int device, const char *name) in snd_cx88_pcm() argument
622 err = snd_pcm_new(chip->card, name, device, 0, 1, &pcm); in snd_cx88_pcm()
625 pcm->private_data = chip; in snd_cx88_pcm()
649 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_volume_get() local
650 struct cx88_core *core=chip->core; in snd_cx88_volume_get()
664 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_wm8775_volume_put() local
665 struct cx88_core *core = chip->core; in snd_cx88_wm8775_volume_put()
686 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_volume_put() local
687 struct cx88_core *core=chip->core; in snd_cx88_volume_put()
705 spin_lock_irq(&chip->reg_lock); in snd_cx88_volume_put()
715 spin_unlock_irq(&chip->reg_lock); in snd_cx88_volume_put()
736 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_switch_get() local
737 struct cx88_core *core = chip->core; in snd_cx88_switch_get()
747 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_switch_put() local
748 struct cx88_core *core = chip->core; in snd_cx88_switch_put()
753 spin_lock_irq(&chip->reg_lock); in snd_cx88_switch_put()
763 spin_unlock_irq(&chip->reg_lock); in snd_cx88_switch_put()
788 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_alc_get() local
789 struct cx88_core *core = chip->core; in snd_cx88_alc_get()
800 snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); in snd_cx88_alc_put() local
801 struct cx88_core *core = chip->core; in snd_cx88_alc_put()
840 static int snd_cx88_free(snd_cx88_card_t *chip) in snd_cx88_free() argument
843 if (chip->irq >= 0) in snd_cx88_free()
844 free_irq(chip->irq, chip); in snd_cx88_free()
846 cx88_core_put(chip->core,chip->pci); in snd_cx88_free()
848 pci_disable_device(chip->pci); in snd_cx88_free()
857 snd_cx88_card_t *chip = card->private_data; in snd_cx88_dev_free() local
859 snd_cx88_free(chip); in snd_cx88_dev_free()
872 snd_cx88_card_t *chip; in snd_cx88_create() local
885 chip = card->private_data; in snd_cx88_create()
902 chip->card = card; in snd_cx88_create()
903 chip->pci = pci; in snd_cx88_create()
904 chip->irq = -1; in snd_cx88_create()
905 spin_lock_init(&chip->reg_lock); in snd_cx88_create()
907 chip->core = core; in snd_cx88_create()
910 err = request_irq(chip->pci->irq, cx8801_irq, in snd_cx88_create()
911 IRQF_SHARED, chip->core->name, chip); in snd_cx88_create()
914 chip->core->name, chip->pci->irq); in snd_cx88_create()
926 chip->irq = pci->irq; in snd_cx88_create()
927 synchronize_irq(chip->irq); in snd_cx88_create()
929 *rchip = chip; in snd_cx88_create()
939 snd_cx88_card_t *chip; in cx88_audio_initdev() local
958 err = snd_cx88_create(card, pci, &chip, &core); in cx88_audio_initdev()
962 err = snd_cx88_pcm(chip, 0, "CX88 Digital"); in cx88_audio_initdev()
966 err = snd_ctl_add(card, snd_ctl_new1(&snd_cx88_volume, chip)); in cx88_audio_initdev()
969 err = snd_ctl_add(card, snd_ctl_new1(&snd_cx88_dac_switch, chip)); in cx88_audio_initdev()
972 err = snd_ctl_add(card, snd_ctl_new1(&snd_cx88_source_switch, chip)); in cx88_audio_initdev()
978 snd_ctl_add(card, snd_ctl_new1(&snd_cx88_alc_switch, chip)); in cx88_audio_initdev()