File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,9 @@ int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
193
193
194
194
int snd_soc_dai_set_tristate (struct snd_soc_dai * dai , int tristate );
195
195
196
+ int snd_soc_dai_prepare (struct snd_soc_dai * dai ,
197
+ struct snd_pcm_substream * substream );
198
+
196
199
/* Digital Audio Interface mute */
197
200
int snd_soc_dai_digital_mute (struct snd_soc_dai * dai , int mute ,
198
201
int direction );
Original file line number Diff line number Diff line change @@ -360,6 +360,22 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate)
360
360
}
361
361
EXPORT_SYMBOL_GPL (snd_soc_dai_set_tristate );
362
362
363
+ int snd_soc_dai_prepare (struct snd_soc_dai * dai ,
364
+ struct snd_pcm_substream * substream )
365
+ {
366
+ int ret = 0 ;
367
+
368
+ if (!snd_soc_dai_stream_valid (dai , substream -> stream ))
369
+ return 0 ;
370
+
371
+ if (dai -> driver -> ops &&
372
+ dai -> driver -> ops -> prepare )
373
+ ret = dai -> driver -> ops -> prepare (substream , dai );
374
+
375
+ return soc_dai_ret (dai , ret );
376
+ }
377
+ EXPORT_SYMBOL_GPL (snd_soc_dai_prepare );
378
+
363
379
/**
364
380
* snd_soc_dai_digital_mute - configure DAI system or master clock.
365
381
* @dai: DAI
@@ -577,14 +593,9 @@ int snd_soc_pcm_dai_prepare(struct snd_pcm_substream *substream)
577
593
int i , ret ;
578
594
579
595
for_each_rtd_dais (rtd , i , dai ) {
580
- if (!snd_soc_dai_stream_valid (dai , substream -> stream ))
581
- continue ;
582
- if (dai -> driver -> ops &&
583
- dai -> driver -> ops -> prepare ) {
584
- ret = dai -> driver -> ops -> prepare (substream , dai );
585
- if (ret < 0 )
586
- return soc_dai_ret (dai , ret );
587
- }
596
+ ret = snd_soc_dai_prepare (dai , substream );
597
+ if (ret < 0 )
598
+ return ret ;
588
599
}
589
600
590
601
return 0 ;
You can’t perform that action at this time.
0 commit comments