@@ -57,15 +57,14 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction)
57
57
return dw -> priv ;
58
58
}
59
59
60
- static int avs_dai_startup (struct snd_pcm_substream * substream , struct snd_soc_dai * dai , bool is_fe ,
61
- const struct snd_soc_dai_ops * ops )
60
+ static int avs_dai_startup (struct snd_pcm_substream * substream , struct snd_soc_dai * dai )
62
61
{
63
62
struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd (substream );
64
63
struct avs_dev * adev = to_avs_dev (dai -> component -> dev );
65
64
struct avs_tplg_path_template * template ;
66
65
struct avs_dma_data * data ;
67
66
68
- template = avs_dai_find_path_template (dai , is_fe , substream -> stream );
67
+ template = avs_dai_find_path_template (dai , ! rtd -> dai_link -> no_pcm , substream -> stream );
69
68
if (!template ) {
70
69
dev_err (dai -> dev , "no %s path for dai %s, invalid tplg?\n" ,
71
70
snd_pcm_stream_str (substream ), dai -> name );
@@ -174,13 +173,6 @@ static int avs_dai_prepare(struct avs_dev *adev, struct snd_pcm_substream *subst
174
173
return ret ;
175
174
}
176
175
177
- static const struct snd_soc_dai_ops avs_dai_nonhda_be_ops ;
178
-
179
- static int avs_dai_nonhda_be_startup (struct snd_pcm_substream * substream , struct snd_soc_dai * dai )
180
- {
181
- return avs_dai_startup (substream , dai , false, & avs_dai_nonhda_be_ops );
182
- }
183
-
184
176
static int avs_dai_nonhda_be_hw_params (struct snd_pcm_substream * substream ,
185
177
struct snd_pcm_hw_params * hw_params , struct snd_soc_dai * dai )
186
178
{
@@ -265,24 +257,22 @@ static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cm
265
257
}
266
258
267
259
static const struct snd_soc_dai_ops avs_dai_nonhda_be_ops = {
268
- .startup = avs_dai_nonhda_be_startup ,
260
+ .startup = avs_dai_startup ,
269
261
.shutdown = avs_dai_shutdown ,
270
262
.hw_params = avs_dai_nonhda_be_hw_params ,
271
263
.hw_free = avs_dai_nonhda_be_hw_free ,
272
264
.prepare = avs_dai_nonhda_be_prepare ,
273
265
.trigger = avs_dai_nonhda_be_trigger ,
274
266
};
275
267
276
- static const struct snd_soc_dai_ops avs_dai_hda_be_ops ;
277
-
278
268
static int avs_dai_hda_be_startup (struct snd_pcm_substream * substream , struct snd_soc_dai * dai )
279
269
{
280
270
struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd (substream );
281
271
struct hdac_ext_stream * link_stream ;
282
272
struct hda_codec * codec ;
283
273
int ret ;
284
274
285
- ret = avs_dai_startup (substream , dai , false, & avs_dai_hda_be_ops );
275
+ ret = avs_dai_startup (substream , dai );
286
276
if (ret )
287
277
return ret ;
288
278
@@ -479,8 +469,6 @@ static const struct snd_pcm_hw_constraint_list hw_rates = {
479
469
.mask = 0 ,
480
470
};
481
471
482
- const struct snd_soc_dai_ops avs_dai_fe_ops ;
483
-
484
472
static int hw_rule_param_size (struct snd_pcm_hw_params * params , struct snd_pcm_hw_rule * rule )
485
473
{
486
474
struct snd_interval * interval = hw_param_interval (params , rule -> var );
@@ -509,7 +497,7 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so
509
497
struct hdac_ext_stream * host_stream ;
510
498
int ret ;
511
499
512
- ret = avs_dai_startup (substream , dai , true, & avs_dai_fe_ops );
500
+ ret = avs_dai_startup (substream , dai );
513
501
if (ret )
514
502
return ret ;
515
503
0 commit comments