SAMA5D SSC: Needs to account for data offset in audio buffer.
This commit is contained in:
parent
41af511655
commit
0b4090df0d
@ -1182,7 +1182,8 @@ static int ssc_rxdma_setup(struct sam_ssc_s *priv)
|
|||||||
|
|
||||||
/* No data received yet */
|
/* No data received yet */
|
||||||
|
|
||||||
apb->nbytes = 0;
|
apb->nbytes = 0;
|
||||||
|
apb->curbyte = 0;
|
||||||
|
|
||||||
/* Physical address of the SSC RHR register and of the buffer location
|
/* Physical address of the SSC RHR register and of the buffer location
|
||||||
* in RAM.
|
* in RAM.
|
||||||
@ -1551,9 +1552,11 @@ static int ssc_txdma_setup(struct sam_ssc_s *priv)
|
|||||||
{
|
{
|
||||||
struct sam_buffer_s *bfcontainer;
|
struct sam_buffer_s *bfcontainer;
|
||||||
struct ap_buffer_s *apb;
|
struct ap_buffer_s *apb;
|
||||||
|
uintptr_t samp;
|
||||||
uintptr_t paddr;
|
uintptr_t paddr;
|
||||||
uintptr_t maddr;
|
uintptr_t maddr;
|
||||||
uint32_t timeout;
|
uint32_t timeout;
|
||||||
|
apb_samp_t nbytes;
|
||||||
bool notimeout;
|
bool notimeout;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1592,17 +1595,21 @@ static int ssc_txdma_setup(struct sam_ssc_s *priv)
|
|||||||
apb = bfcontainer->apb;
|
apb = bfcontainer->apb;
|
||||||
DEBUGASSERT(((uintptr_t)apb->samp & 3) == 0);
|
DEBUGASSERT(((uintptr_t)apb->samp & 3) == 0);
|
||||||
|
|
||||||
|
/* Get the transfer information, accounting for any data offset */
|
||||||
|
|
||||||
|
samp = (uintptr_t)&apb->samp[apb->curbyte];
|
||||||
|
nbytes = apb->nbytes - apb->curbyte;
|
||||||
|
|
||||||
/* Physical address of the SSC THR register and of the buffer location
|
/* Physical address of the SSC THR register and of the buffer location
|
||||||
* in
|
* in RAM.
|
||||||
* RAM.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
paddr = ssc_physregaddr(priv, SAM_SSC_THR_OFFSET);
|
paddr = ssc_physregaddr(priv, SAM_SSC_THR_OFFSET);
|
||||||
maddr = sam_physramaddr((uintptr_t)apb->samp);
|
maddr = sam_physramaddr(samp);
|
||||||
|
|
||||||
/* Configure the TX DMA */
|
/* Configure the TX DMA */
|
||||||
|
|
||||||
sam_dmatxsetup(priv->tx.dma, paddr, maddr, apb->nbytes);
|
sam_dmatxsetup(priv->tx.dma, paddr, maddr, nbytes);
|
||||||
|
|
||||||
/* Increment the DMA timeout */
|
/* Increment the DMA timeout */
|
||||||
|
|
||||||
@ -1623,9 +1630,7 @@ static int ssc_txdma_setup(struct sam_ssc_s *priv)
|
|||||||
* before starting the DMA.
|
* before starting the DMA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
arch_clean_dcache((uintptr_t)apb->samp,
|
arch_clean_dcache(samp, samp + nbytes);
|
||||||
(uintptr_t)apb->samp + apb->nbytes);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#if 1 /* REVISIT: Chained TX transfers */
|
#if 1 /* REVISIT: Chained TX transfers */
|
||||||
while (0);
|
while (0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user