summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c321fed)
raw | patch | inline | side by side (parent: c321fed)
author | Stephen Molfetta <sjmolfetta@ti.com> | |
Wed, 17 Oct 2018 16:34:24 +0000 (11:34 -0500) | ||
committer | Stephen Molfetta <sjmolfetta@ti.com> | |
Wed, 17 Oct 2018 16:38:36 +0000 (11:38 -0500) |
We enable the driver to accept both legacy and new ways to pass EDMA
handle.
This partially reverts commit 4eede7b28a82b99e7979ec2eaa641ea699ff9eb5.
Conflicts:
src/dma/V0/mcasp_dma.c
handle.
This partially reverts commit 4eede7b28a82b99e7979ec2eaa641ea699ff9eb5.
Conflicts:
src/dma/V0/mcasp_dma.c
15 files changed:
index 93e0708dbd08516e4c79bd4ca4482df1207d70ba..ee01a7fb3042da87e2d60cf9e21297070d0baf48 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index a9bcf74ec6eaf010971c4705de798735f04d79fe..a438bce8bcf574e14cf01222a2006d9ae0bb2bb0 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 9b056d32a8e5a3e6fa07bcb1f9c6eb14fe80c729..95044ba88c92e0764e716684f2afc04cc88dd885 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 24cff3bdb3bf1279d8946bd5608c56b59bffbb55..8d54df502a5906bb34d8dbce3ce421caede34246 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index d55d8f4b883c3e0673f558a38abc1d1636e74388..54b7f49b6aaa70e786970ec760c05e496a3e2fa5 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index d55d8f4b883c3e0673f558a38abc1d1636e74388..54b7f49b6aaa70e786970ec760c05e496a3e2fa5 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 6cd53e1fbab4bab1ec5a7f8cf0581ace15198582..5a607a48d45e2c42c380bfa4c73fc981bc98394b 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
2, /* number of TDM channels */
Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
2, /* number of TDM channels */
Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
index 571c2f9f0fae52c63027a804c1458a117950760a..0efff9433ae62b6138e1c6ee8cd7cf8b0bf97978 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 39f2c946ce8a88a889da0a4d5baf5de3b97e0b7f..c194d06218ef6d4729c5f51c91394e30cd80bdb6 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 92ed734ad724898fd8f2e455f8ad090ab49e36f7..c498fb27dbef5ce8387446c874a4da418a80872d 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 41d6f21b2d96c439a41b1f1e81249e87634966c3..6b50c4fc3b71f6e09751b51b94173457dceaef7e 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
index 8f075e3f9dbb78cc186fbee4261a125724ea0966..c6f9626fac80acd765e1be8620217a4a3152ff24 100644 (file)
Mcasp_WordLength_32,
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrRcv,
#if defined (DSP_MODE)
1,
Mcasp_WordLength_32, /* word width */
NULL,
0,
+ NULL,
(Mcasp_GblCallback)&GblErrXmt,
#if defined (DSP_MODE)
1,
diff --git a/mcasp_drv.h b/mcasp_drv.h
index 8de564c3868f15ac8d490a279c6feb02c2bea966..ed25effd858169c1889f06707de96baf65d7fe40 100644 (file)
--- a/mcasp_drv.h
+++ b/mcasp_drv.h
* pre-calcuated properly for word width of slot - Please refer the *
* wordWidth of this structure */
+ void * edmaHandle;
+ /**< Handle to the EDMA Driver */
+
Mcasp_GblCallback gblCbk;
/**< callback required when global error occurs - *
* must be callable directly from the ISR context */
diff --git a/src/dma/V0/mcasp_dma.c b/src/dma/V0/mcasp_dma.c
index 1a69888fc1198cbe6cc3e1b94b2b527709e2a09f..11403f841fa4a1eafe1adb57295f581bf89702ac 100644 (file)
--- a/src/dma/V0/mcasp_dma.c
+++ b/src/dma/V0/mcasp_dma.c
instHandle = (Mcasp_Object *)chanHandle->devHandle;
+ /* EDMA handle should be provided by the HW info. However, legacy
+ * implementation will allow for this to be provided via the channel
+ * parameters.
+ */
chanHandle->edmaHandle = instHandle->hwInfo.dmaHandle;
+
/* Fixed number of EDMA PaRAM sets allocated for channel linking */
chanHandle->maxActiveSubmit = Mcasp_MAXLINKCNT;
chanHandle->xferChan = 0;
diff --git a/src/mcasp_drv.c b/src/mcasp_drv.c
index 43c20f6f6ecff461e370a7ca1330d8e04d87b8b3..2aa3fdc36737fb255a5ecb1ae6c0f07c27620be0 100644 (file)
--- a/src/mcasp_drv.c
+++ b/src/mcasp_drv.c
if ((NULL == instHandle->hwInfo.dmaHandle) && (TRUE == chanparam->isDmaDriven))
{
status = MCASP_EBADARGS;
+#ifdef MCASP_EDMA_ENABLED
+ /* Preserving legacy operation: old versions of the EDMA-based
+ * driver allowed for EDMA handle to be passed in through the
+ * channel parameters instead of the HW info. If this is the case,
+ * we allow for now and don't return a failure status for bad args.
+ */
+ if (NULL != chanparam->edmaHandle)
+ {
+ status = MCASP_COMPLETED;
+ }
+#endif
}
#endif /* PSP_DISABLE_INPUT_PARAMETER_CHECK */
/* Store this info in the channel handle too */
chanHandle->isDmaDriven = (Bool)TRUE;
+#ifdef MCASP_EDMA_ENABLED
+ /* Preserving legacy operation: old versions of the EDMA
+ * based driver allowed for EDMA handle to be passed in
+ * through the channel parameters instead of the HW info.
+ * If this is the case we pull into the channel handle from
+ * the parameter.
+ *
+ * In this case, we've already confirmed EDMA handle from
+ * the channel parameters is valid, so we pass to the chan
+ * handle now.
+ */
+ if (NULL == instHandle->hwInfo.dmaHandle)
+ {
+ chanHandle->edmaHandle = chanparam->edmaHandle;
+ }
+#endif
if (MCASP_INPUT == chanHandle->mode)
{
/* Receive mode */