summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2016-05-10 02:45:54 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2016-05-10 02:45:54 (GMT)
commit9591434ab93e049fd18efe472a1e2dd1fbabd736 (patch)
tree4f5258e3334f6b2994e389700b826908bdebddb1
parent6ea0171c9a74db301df298c13b91786e9941cbfc (diff)
downloadbspam335x-9591434ab93e049fd18efe472a1e2dd1fbabd736.zip
bspam335x-9591434ab93e049fd18efe472a1e2dd1fbabd736.tar.gz
bspam335x-9591434ab93e049fd18efe472a1e2dd1fbabd736.tar.bz2
Fixed audio driver bug.
-rw-r--r--SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c4
-rw-r--r--SylixOS/driver/dma/am335x_dma.c3
-rw-r--r--SylixOS/driver/mcasp/am335x_mcasp.c12
3 files changed, 12 insertions, 7 deletions
diff --git a/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c b/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
index 80429af..176e3e9 100644
--- a/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
+++ b/SylixOS/driver/audio/codec/tlv320aic3x/tlv320aic3x.c
@@ -409,6 +409,10 @@ static INT __aic3xSampleRateConfig (PLW_I2C_DEVICE pI2cDev,
/* Select the configuration for the given sampling rate */
switch (uiSampleRate / 2) {
+ case 4000:
+ fs = 0xAAu;
+ break;
+
case 8000:
fs = 0xAAu;
break;
diff --git a/SylixOS/driver/dma/am335x_dma.c b/SylixOS/driver/dma/am335x_dma.c
index 245b660..d2cc0f7 100644
--- a/SylixOS/driver/dma/am335x_dma.c
+++ b/SylixOS/driver/dma/am335x_dma.c
@@ -91,8 +91,9 @@ static VOID __am335xEdma3Done (__PAM335X_DMA_CONTROLER pDmaControler, UINT ui
switch (uiChannel) {
case EDMA3_CHA_MCASP0_TX:
- case EDMA3_CHA_MCASP1_TX:
case EDMA3_CHA_MCASP0_RX:
+
+ case EDMA3_CHA_MCASP1_TX:
case EDMA3_CHA_MCASP1_RX:
am335xMcaspEdma3Done(uiChannel);
break;
diff --git a/SylixOS/driver/mcasp/am335x_mcasp.c b/SylixOS/driver/mcasp/am335x_mcasp.c
index 89c9652..3566153 100644
--- a/SylixOS/driver/mcasp/am335x_mcasp.c
+++ b/SylixOS/driver/mcasp/am335x_mcasp.c
@@ -59,12 +59,12 @@
#define OPT_FIFO_WIDTH (0x02 << 8u)
-#define TX_DMA_INT_ENABLE (EDMA3CC_OPT_TCC_SET \
- (EDMA3_CHA_MCASP1_TX) | (1 \
+#define TX_DMA_INT_ENABLE(uiDmaChan) (EDMA3CC_OPT_TCC_SET \
+ (uiDmaChan) | (1 \
<< EDMA3CC_OPT_TCINTEN_SHIFT))
-#define RX_DMA_INT_ENABLE (EDMA3CC_OPT_TCC_SET \
- (EDMA3_CHA_MCASP1_RX) | (1 \
+#define RX_DMA_INT_ENABLE(uiDmaChan) (EDMA3CC_OPT_TCC_SET \
+ (uiDmaChan) | (1 \
<< EDMA3CC_OPT_TCINTEN_SHIFT))
#define __DMAJOB_STATUS_FREE (0x00)
@@ -392,7 +392,7 @@ static VOID __am335xMcAspRxDmaInit (__PAM335X_MCASP_CHANNEL pMcAspChannel)
pDmaJob->DMAJOB_uiParId = PAR_RX_START + (i - 1);
}
- pDmaJob->DMAJOB_paramSet.opt = OPT_FIFO_WIDTH | RX_DMA_INT_ENABLE;
+ pDmaJob->DMAJOB_paramSet.opt = OPT_FIFO_WIDTH | RX_DMA_INT_ENABLE(pMcAspChannel->MCASP_uiRxDmaChannel);
pDmaJob->DMAJOB_paramSet.srcAddr = pMcAspChannel->MCASP_ulDataPhyAddrBase;
pDmaJob->DMAJOB_paramSet.destAddr = (UINT)pMcAspChannel->MCASP_pucRxDmaBufferDummy;
@@ -481,7 +481,7 @@ static VOID __am335xMcAspTxDmaInit (__PAM335X_MCASP_CHANNEL pMcAspChannel)
pDmaJob->DMAJOB_uiParId = PAR_TX_START + (i - 1);
}
- pDmaJob->DMAJOB_paramSet.opt = OPT_FIFO_WIDTH | TX_DMA_INT_ENABLE;
+ pDmaJob->DMAJOB_paramSet.opt = OPT_FIFO_WIDTH | TX_DMA_INT_ENABLE(pMcAspChannel->MCASP_uiTxDmaChannel);
pDmaJob->DMAJOB_paramSet.srcAddr = (UINT)pMcAspChannel->MCASP_pucRxDmaBufferDummy;
pDmaJob->DMAJOB_paramSet.destAddr = pMcAspChannel->MCASP_ulDataPhyAddrBase;