Lines Matching defs:codec
314 static int hal2_compute_rate(struct hal2_codec *codec, unsigned int rate)
320 codec->master = 44100;
323 codec->master = 48000;
326 codec->inc = 4;
327 codec->mod = mod;
328 rate = 4 * codec->master / mod;
444 static int hal2_alloc_dmabuf(struct snd_hal2 *hal2, struct hal2_codec *codec,
453 codec->buffer = dma_alloc_noncoherent(dev, H2_BUF_SIZE, &buffer_dma,
455 if (!codec->buffer)
460 dma_free_noncoherent(dev, H2_BUF_SIZE, codec->buffer, buffer_dma,
464 codec->buffer_dma = buffer_dma;
465 codec->desc_dma = desc_dma;
466 codec->desc = desc;
474 dma_sync_single_for_device(dev, codec->desc_dma,
477 codec->desc_count = count;
481 static void hal2_free_dmabuf(struct snd_hal2 *hal2, struct hal2_codec *codec,
486 dma_free_noncoherent(dev, codec->desc_count * sizeof(struct hal2_desc),
487 codec->desc, codec->desc_dma, DMA_BIDIRECTIONAL);
488 dma_free_noncoherent(dev, H2_BUF_SIZE, codec->buffer, codec->buffer_dma,
735 static void hal2_init_codec(struct hal2_codec *codec, struct hpc3_regs *hpc3,
738 codec->pbus.pbusnr = index;
739 codec->pbus.pbus = &hpc3->pbdma[index];