I am working on a SSC Driver for I2S and am having trouble getting the PDC to work. I am only concerned with incoming data. I have allocated the buffer using DMA memory,
//allocate buffers ssc->buffer = kmalloc(sizeof(char) * 1024, GFP_DMA);
and configured the PDC registers PTCR, RPR, and RCR as follows:
pdc_ptcr = (SSC_BF(CR_RXDIS, SSC_RXDIS_ZERO) | SSC_BF(CR_RXEN, SSC_RXEN_YES) | SSC_BF(CR_TXDIS, SSC_TXDIS_YES) | SSC_BF(CR_TXEN, SSC_TXEN_ZERO)); ssc_writel(ssc->regs, PDC_RPR, (u32)&i2s_devp->buffer); ssc_writel(ssc->regs, PDC_RCR, 32); ssc_writel(ssc->regs, PDC_PTCR, pdc_ptcr);
I am trying to interrupt when the buffer is full, but am not sure on where to set up the interrupt. According to the documentation it appears the PDC flags the SSC Interrupt Register and triggers the SSC to interrupt but that isn't working. Or, am I just missing some clock setup for the PDC? Not sure what to do, and the other kernel drivers have their PDC code in so many places I can't seem to decode it.
Thanks for the help,