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