File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -491,26 +491,33 @@ int snd_dmaengine_mpcm_register(struct rk_mdais_dev *mdais)
491491 struct device * child ;
492492 struct dmaengine_mpcm * pcm ;
493493 struct dma_chan * chan ;
494+ unsigned int * tx_maps , * rx_maps ;
494495 int ret , i , num ;
495496
496497 dev = mdais -> dev ;
497498 num = mdais -> num_dais ;
499+ tx_maps = mdais -> playback_channel_maps ;
500+ rx_maps = mdais -> capture_channel_maps ;
498501 pcm = kzalloc (sizeof (* pcm ), GFP_KERNEL );
499502 if (!pcm )
500503 return - ENOMEM ;
501504
502505 pcm -> mdais = mdais ;
503506 for (i = 0 ; i < num ; i ++ ) {
504507 child = mdais -> dais [i ].dev ;
505- chan = dma_request_slave_channel_reason (child , "tx" );
506- if (IS_ERR (chan ))
507- chan = NULL ;
508- pcm -> tx_chans [i ] = chan ;
509-
510- chan = dma_request_slave_channel_reason (child , "rx" );
511- if (IS_ERR (chan ))
512- chan = NULL ;
513- pcm -> rx_chans [i ] = chan ;
508+ if (tx_maps [i ]) {
509+ chan = dma_request_slave_channel_reason (child , "tx" );
510+ if (IS_ERR (chan ))
511+ chan = NULL ;
512+ pcm -> tx_chans [i ] = chan ;
513+ }
514+
515+ if (rx_maps [i ]) {
516+ chan = dma_request_slave_channel_reason (child , "rx" );
517+ if (IS_ERR (chan ))
518+ chan = NULL ;
519+ pcm -> rx_chans [i ] = chan ;
520+ }
514521 }
515522
516523 ret = snd_soc_add_platform (dev , & pcm -> platform ,
You can’t perform that action at this time.
0 commit comments