On Fri, 2017-12-15 at 23:02 +0800, Keyon Jie wrote:
We should set src_msize and dest_msize for dma peripheral dev copy, for dai/ssp, they should be set to valid slot number, otherwise, the dma may copy in wrong burst size and data will run with wrong speed.
Signed-off-by: Keyon Jie yang.jie@linux.intel.com
src/audio/dai.c | 13 +++++++++++++
msize is something specific to the DW dma driver only, so this logic should be in dw-dma.c
1 file changed, 13 insertions(+)
diff --git a/src/audio/dai.c b/src/audio/dai.c index c50a274..e04943b 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -599,8 +599,21 @@ static int dai_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn) return 0; }
comment here describing how array index aligns with msize
+static uint32_t msize[] = {1, 2, 4, 8};
const
static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config) {
- struct dai_data *dd = comp_get_drvdata(dev);
- int i;
- /* set dma msize according to slot number */
- for (i = 0; i < ARRAY_SIZE(msize); i++) {
if (msize[i] == config->num_slots) {
dd->config.src_msize = i;
dd->config.dest_msize = i;
break;
}
- }
- /* calc frame bytes */ switch (config->sample_valid_bits) { case 16:
--------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.