[Sound-open-firmware] [PATCH 2/3] dai: set dai dma msize according to slot number
Keyon Jie
yang.jie at linux.intel.com
Mon Dec 18 05:51:59 CET 2017
On 2017年12月17日 01:55, Liam Girdwood wrote:
> On Sat, 2017-12-16 at 09:59 +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 at linux.intel.com>
>> ---
>> src/audio/dai.c | 18 ++++++++++++++++++
>
> This is specific only for DW-MDA engine so should be in dw-dma.c and
> not dai.c which is generic.
OK, can you propose how should I change in detail then?
Thanks,
~Keyon
>
> Liam
>
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/src/audio/dai.c b/src/audio/dai.c
>> index c50a274..e67e5cf 100644
>> --- a/src/audio/dai.c
>> +++ b/src/audio/dai.c
>> @@ -599,8 +599,26 @@ static int dai_position(struct comp_dev *dev,
>> struct sof_ipc_stream_posn *posn)
>> return 0;
>> }
>>
>> +/*
>> + * use array to get msize for specific slot number setting.
>> + * the relation between msize and slot_num should be
>> + * 2 ^ msize = slot_num
>> + */
>> +static const uint32_t msize[] = {1, 2, 4, 8};
>> 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:
>
More information about the Sound-open-firmware
mailing list