@@ -183,30 +183,6 @@ static void i2s_stop(struct dw_i2s_dev *dev,
183
183
}
184
184
}
185
185
186
- static int dw_i2s_startup (struct snd_pcm_substream * substream ,
187
- struct snd_soc_dai * cpu_dai )
188
- {
189
- struct dw_i2s_dev * dev = snd_soc_dai_get_drvdata (cpu_dai );
190
- union dw_i2s_snd_dma_data * dma_data = NULL ;
191
-
192
- if (!(dev -> capability & DWC_I2S_RECORD ) &&
193
- (substream -> stream == SNDRV_PCM_STREAM_CAPTURE ))
194
- return - EINVAL ;
195
-
196
- if (!(dev -> capability & DWC_I2S_PLAY ) &&
197
- (substream -> stream == SNDRV_PCM_STREAM_PLAYBACK ))
198
- return - EINVAL ;
199
-
200
- if (substream -> stream == SNDRV_PCM_STREAM_PLAYBACK )
201
- dma_data = & dev -> play_dma_data ;
202
- else if (substream -> stream == SNDRV_PCM_STREAM_CAPTURE )
203
- dma_data = & dev -> capture_dma_data ;
204
-
205
- snd_soc_dai_set_dma_data (cpu_dai , substream , (void * )dma_data );
206
-
207
- return 0 ;
208
- }
209
-
210
186
static void dw_i2s_config (struct dw_i2s_dev * dev , int stream )
211
187
{
212
188
u32 ch_reg ;
@@ -305,12 +281,6 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
305
281
return 0 ;
306
282
}
307
283
308
- static void dw_i2s_shutdown (struct snd_pcm_substream * substream ,
309
- struct snd_soc_dai * dai )
310
- {
311
- snd_soc_dai_set_dma_data (dai , substream , NULL );
312
- }
313
-
314
284
static int dw_i2s_prepare (struct snd_pcm_substream * substream ,
315
285
struct snd_soc_dai * dai )
316
286
{
@@ -382,8 +352,6 @@ static int dw_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
382
352
}
383
353
384
354
static const struct snd_soc_dai_ops dw_i2s_dai_ops = {
385
- .startup = dw_i2s_startup ,
386
- .shutdown = dw_i2s_shutdown ,
387
355
.hw_params = dw_i2s_hw_params ,
388
356
.prepare = dw_i2s_prepare ,
389
357
.trigger = dw_i2s_trigger ,
@@ -625,6 +593,14 @@ static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev,
625
593
626
594
}
627
595
596
+ static int dw_i2s_dai_probe (struct snd_soc_dai * dai )
597
+ {
598
+ struct dw_i2s_dev * dev = snd_soc_dai_get_drvdata (dai );
599
+
600
+ snd_soc_dai_init_dma_data (dai , & dev -> play_dma_data , & dev -> capture_dma_data );
601
+ return 0 ;
602
+ }
603
+
628
604
static int dw_i2s_probe (struct platform_device * pdev )
629
605
{
630
606
const struct i2s_platform_data * pdata = pdev -> dev .platform_data ;
@@ -643,6 +619,7 @@ static int dw_i2s_probe(struct platform_device *pdev)
643
619
return - ENOMEM ;
644
620
645
621
dw_i2s_dai -> ops = & dw_i2s_dai_ops ;
622
+ dw_i2s_dai -> probe = dw_i2s_dai_probe ;
646
623
647
624
dev -> i2s_base = devm_platform_get_and_ioremap_resource (pdev , 0 , & res );
648
625
if (IS_ERR (dev -> i2s_base ))
0 commit comments