Lines Matching defs:psc_dma
26 struct psc_dma *psc_dma = _psc_dma;
27 struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;
33 if (psc_dma->playback.active && (isr & MPC52xx_PSC_IMR_TXEMP))
34 psc_dma->stats.underrun_count++;
37 if (psc_dma->capture.active && (isr & MPC52xx_PSC_IMR_ORERR))
38 psc_dma->stats.overrun_count++;
74 spin_lock(&s->psc_dma->lock);
85 spin_unlock(&s->psc_dma->lock);
110 struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;
112 struct psc_dma_stream *s = to_psc_dma_stream(substream, psc_dma);
113 struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;
120 dev_dbg(psc_dma->dev, "START: stream=%i fbits=%u ps=%u #p=%u\n",
134 spin_lock_irqsave(&psc_dma->lock, flags);
146 spin_unlock_irqrestore(&psc_dma->lock, flags);
153 dev_dbg(psc_dma->dev, "STOP: stream=%i periods_count=%i\n",
157 spin_lock_irqsave(&psc_dma->lock, flags);
163 spin_unlock_irqrestore(&psc_dma->lock, flags);
168 dev_dbg(psc_dma->dev, "unhandled trigger: stream=%i cmd=%i\n",
175 if (psc_dma->playback.active)
177 if (psc_dma->capture.active)
179 out_be16(®s->isr_imr.imr, psc_dma->imr | imr);
215 struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;
219 dev_dbg(psc_dma->dev, "psc_dma_open(substream=%p)\n", substream);
222 s = &psc_dma->capture;
224 s = &psc_dma->playback;
242 struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;
245 dev_dbg(psc_dma->dev, "psc_dma_close(substream=%p)\n", substream);
248 s = &psc_dma->capture;
250 s = &psc_dma->playback;
252 if (!psc_dma->playback.active &&
253 !psc_dma->capture.active) {
256 out_be16(&psc_dma->psc_regs->isr_imr.imr, psc_dma->imr);
257 out_8(&psc_dma->psc_regs->command, 4 << 4); /* reset error */
267 struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;
272 s = &psc_dma->capture;
274 s = &psc_dma->playback;
305 struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;
332 rtd->socdev->card->codec->ac97->private_data = psc_dma;
375 struct psc_dma *psc_dma;
395 psc_dma = kzalloc(sizeof *psc_dma, GFP_KERNEL);
396 if (!psc_dma) {
408 spin_lock_init(&psc_dma->lock);
409 mutex_init(&psc_dma->mutex);
410 psc_dma->id = be32_to_cpu(*prop);
411 psc_dma->irq = irq;
412 psc_dma->psc_regs = regs;
413 psc_dma->fifo_regs = regs + sizeof *psc_dma->psc_regs;
414 psc_dma->dev = &op->dev;
415 psc_dma->playback.psc_dma = psc_dma;
416 psc_dma->capture.psc_dma = psc_dma;
417 snprintf(psc_dma->name, sizeof psc_dma->name, "PSC%u", psc_dma->id);
422 psc_dma->capture.bcom_task =
423 bcom_psc_gen_bd_rx_init(psc_dma->id, 10, fifo, 512);
424 psc_dma->playback.bcom_task =
425 bcom_psc_gen_bd_tx_init(psc_dma->id, 10, fifo);
426 if (!psc_dma->capture.bcom_task ||
427 !psc_dma->playback.bcom_task) {
434 out_be16(&psc_dma->psc_regs->isr_imr.imr, psc_dma->imr);
436 out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_RST_RX);
438 out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_RST_TX);
440 out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_RST_ERR_STAT);
442 out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_SEL_MODE_REG_1);
448 out_8(&psc_dma->psc_regs->mode, 0);
449 out_8(&psc_dma->psc_regs->mode, 0);
452 out_be16(&psc_dma->fifo_regs->rfalarm, 0x100);
453 out_8(&psc_dma->fifo_regs->rfcntl, 0x4);
454 out_be16(&psc_dma->fifo_regs->tfalarm, 0x100);
455 out_8(&psc_dma->fifo_regs->tfcntl, 0x7);
458 psc_dma->playback.irq =
459 bcom_get_task_irq(psc_dma->playback.bcom_task);
460 psc_dma->capture.irq =
461 bcom_get_task_irq(psc_dma->capture.bcom_task);
463 rc = request_irq(psc_dma->irq, &psc_dma_status_irq, IRQF_SHARED,
464 "psc-dma-status", psc_dma);
465 rc |= request_irq(psc_dma->capture.irq, &psc_dma_bcom_irq, IRQF_SHARED,
466 "psc-dma-capture", &psc_dma->capture);
467 rc |= request_irq(psc_dma->playback.irq, &psc_dma_bcom_irq, IRQF_SHARED,
468 "psc-dma-playback", &psc_dma->playback);
475 dev_set_drvdata(&op->dev, psc_dma);
480 free_irq(psc_dma->irq, psc_dma);
481 free_irq(psc_dma->capture.irq, &psc_dma->capture);
482 free_irq(psc_dma->playback.irq, &psc_dma->playback);
484 kfree(psc_dma);
493 struct psc_dma *psc_dma = dev_get_drvdata(&op->dev);
499 bcom_gen_bd_rx_release(psc_dma->capture.bcom_task);
500 bcom_gen_bd_tx_release(psc_dma->playback.bcom_task);
503 free_irq(psc_dma->irq, psc_dma);
504 free_irq(psc_dma->capture.irq, &psc_dma->capture);
505 free_irq(psc_dma->playback.irq, &psc_dma->playback);
507 iounmap(psc_dma->psc_regs);
508 kfree(psc_dma);