pcm.c (6f84981772535e670e4e2df051a672af229b6694) | pcm.c (ec4b2099c6e01342e5c3289a906615c3abef85b8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2// 3// Copyright(c) 2021-2022 Intel Corporation. All rights reserved. 4// 5// Authors: Cezary Rojewski <cezary.rojewski@intel.com> 6// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com> 7// 8 --- 21 unchanged lines hidden (view full) --- 30 struct hdac_ext_stream *host_stream; 31 32 struct snd_pcm_substream *substream; 33}; 34 35static struct avs_tplg_path_template * 36avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) 37{ | 1// SPDX-License-Identifier: GPL-2.0-only 2// 3// Copyright(c) 2021-2022 Intel Corporation. All rights reserved. 4// 5// Authors: Cezary Rojewski <cezary.rojewski@intel.com> 6// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com> 7// 8 --- 21 unchanged lines hidden (view full) --- 30 struct hdac_ext_stream *host_stream; 31 32 struct snd_pcm_substream *substream; 33}; 34 35static struct avs_tplg_path_template * 36avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) 37{ |
38 struct snd_soc_dapm_widget *dw; | 38 struct snd_soc_dapm_widget *dw = snd_soc_dai_get_widget(dai, direction); |
39 struct snd_soc_dapm_path *dp; 40 enum snd_soc_dapm_direction dir; 41 42 if (direction == SNDRV_PCM_STREAM_CAPTURE) { | 39 struct snd_soc_dapm_path *dp; 40 enum snd_soc_dapm_direction dir; 41 42 if (direction == SNDRV_PCM_STREAM_CAPTURE) { |
43 dw = dai->capture_widget; | |
44 dir = is_fe ? SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN; 45 } else { | 43 dir = is_fe ? SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN; 44 } else { |
46 dw = dai->playback_widget; | |
47 dir = is_fe ? SND_SOC_DAPM_DIR_IN : SND_SOC_DAPM_DIR_OUT; 48 } 49 50 dp = list_first_entry_or_null(&dw->edges[dir], typeof(*dp), list_node[dir]); 51 if (!dp) 52 return NULL; 53 54 /* Get the other widget, with actual path template data */ 55 dw = (dp->source == dw) ? dp->sink : dp->source; 56 57 return dw->priv; 58} 59 60static 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) 62{ | 45 dir = is_fe ? SND_SOC_DAPM_DIR_IN : SND_SOC_DAPM_DIR_OUT; 46 } 47 48 dp = list_first_entry_or_null(&dw->edges[dir], typeof(*dp), list_node[dir]); 49 if (!dp) 50 return NULL; 51 52 /* Get the other widget, with actual path template data */ 53 dw = (dp->source == dw) ? dp->sink : dp->source; 54 55 return dw->priv; 56} 57 58static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe, 59 const struct snd_soc_dai_ops *ops) 60{ |
63 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 61 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
64 struct avs_dev *adev = to_avs_dev(dai->dev); 65 struct avs_tplg_path_template *template; 66 struct avs_dma_data *data; 67 68 template = avs_dai_find_path_template(dai, is_fe, substream->stream); 69 if (!template) { 70 dev_err(dai->dev, "no %s path for dai %s, invalid tplg?\n", 71 snd_pcm_stream_str(substream), dai->name); --- 92 unchanged lines hidden (view full) --- 164 165static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 166{ 167 return avs_dai_startup(substream, dai, false, &avs_dai_nonhda_be_ops); 168} 169 170static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 171{ | 62 struct avs_dev *adev = to_avs_dev(dai->dev); 63 struct avs_tplg_path_template *template; 64 struct avs_dma_data *data; 65 66 template = avs_dai_find_path_template(dai, is_fe, substream->stream); 67 if (!template) { 68 dev_err(dai->dev, "no %s path for dai %s, invalid tplg?\n", 69 snd_pcm_stream_str(substream), dai->name); --- 92 unchanged lines hidden (view full) --- 162 163static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 164{ 165 return avs_dai_startup(substream, dai, false, &avs_dai_nonhda_be_ops); 166} 167 168static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 169{ |
172 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 170 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
173 struct avs_dev *adev = to_avs_dev(dai->dev); 174 struct avs_dma_data *data; 175 176 if (rtd->dai_link->ignore_suspend) 177 adev->num_lp_paths--; 178 179 data = snd_soc_dai_get_dma_data(dai, substream); 180 --- 32 unchanged lines hidden (view full) --- 213static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 214{ 215 return avs_dai_prepare(to_avs_dev(dai->dev), substream, dai); 216} 217 218static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cmd, 219 struct snd_soc_dai *dai) 220{ | 171 struct avs_dev *adev = to_avs_dev(dai->dev); 172 struct avs_dma_data *data; 173 174 if (rtd->dai_link->ignore_suspend) 175 adev->num_lp_paths--; 176 177 data = snd_soc_dai_get_dma_data(dai, substream); 178 --- 32 unchanged lines hidden (view full) --- 211static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 212{ 213 return avs_dai_prepare(to_avs_dev(dai->dev), substream, dai); 214} 215 216static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cmd, 217 struct snd_soc_dai *dai) 218{ |
221 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 219 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
222 struct avs_dma_data *data; 223 int ret = 0; 224 225 data = snd_soc_dai_get_dma_data(dai, substream); 226 227 switch (cmd) { 228 case SNDRV_PCM_TRIGGER_RESUME: 229 if (rtd->dai_link->ignore_suspend) --- 70 unchanged lines hidden (view full) --- 300 301 return avs_dai_be_hw_params(substream, hw_params, dai, 302 hdac_stream(link_stream)->stream_tag - 1); 303} 304 305static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 306{ 307 struct avs_dma_data *data; | 220 struct avs_dma_data *data; 221 int ret = 0; 222 223 data = snd_soc_dai_get_dma_data(dai, substream); 224 225 switch (cmd) { 226 case SNDRV_PCM_TRIGGER_RESUME: 227 if (rtd->dai_link->ignore_suspend) --- 70 unchanged lines hidden (view full) --- 298 299 return avs_dai_be_hw_params(substream, hw_params, dai, 300 hdac_stream(link_stream)->stream_tag - 1); 301} 302 303static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 304{ 305 struct avs_dma_data *data; |
308 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 306 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
309 struct hdac_ext_stream *link_stream; 310 struct hdac_ext_link *link; 311 struct hda_codec *codec; 312 313 dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); 314 315 data = snd_soc_dai_get_dma_data(dai, substream); 316 if (!data->path) --- 13 unchanged lines hidden (view full) --- 330 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 331 snd_hdac_ext_bus_link_clear_stream_id(link, hdac_stream(link_stream)->stream_tag); 332 333 return 0; 334} 335 336static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 337{ | 307 struct hdac_ext_stream *link_stream; 308 struct hdac_ext_link *link; 309 struct hda_codec *codec; 310 311 dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); 312 313 data = snd_soc_dai_get_dma_data(dai, substream); 314 if (!data->path) --- 13 unchanged lines hidden (view full) --- 328 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 329 snd_hdac_ext_bus_link_clear_stream_id(link, hdac_stream(link_stream)->stream_tag); 330 331 return 0; 332} 333 334static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 335{ |
338 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 336 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
339 struct snd_pcm_runtime *runtime = substream->runtime; 340 struct hdac_ext_stream *link_stream = runtime->private_data; 341 struct hdac_ext_link *link; 342 struct hda_codec *codec; 343 struct hdac_bus *bus; 344 unsigned int format_val; 345 int ret; 346 --- 22 unchanged lines hidden (view full) --- 369 370 link_stream->link_prepared = true; 371 return 0; 372} 373 374static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd, 375 struct snd_soc_dai *dai) 376{ | 337 struct snd_pcm_runtime *runtime = substream->runtime; 338 struct hdac_ext_stream *link_stream = runtime->private_data; 339 struct hdac_ext_link *link; 340 struct hda_codec *codec; 341 struct hdac_bus *bus; 342 unsigned int format_val; 343 int ret; 344 --- 22 unchanged lines hidden (view full) --- 367 368 link_stream->link_prepared = true; 369 return 0; 370} 371 372static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd, 373 struct snd_soc_dai *dai) 374{ |
377 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 375 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
378 struct hdac_ext_stream *link_stream; 379 struct avs_dma_data *data; 380 int ret = 0; 381 382 dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd); 383 384 data = snd_soc_dai_get_dma_data(dai, substream); 385 link_stream = substream->runtime->private_data; --- 98 unchanged lines hidden (view full) --- 484 dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p", 485 __func__, hdac_stream(host_stream)->stream_tag, substream); 486 487 return 0; 488} 489 490static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 491{ | 376 struct hdac_ext_stream *link_stream; 377 struct avs_dma_data *data; 378 int ret = 0; 379 380 dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd); 381 382 data = snd_soc_dai_get_dma_data(dai, substream); 383 link_stream = substream->runtime->private_data; --- 98 unchanged lines hidden (view full) --- 482 dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p", 483 __func__, hdac_stream(host_stream)->stream_tag, substream); 484 485 return 0; 486} 487 488static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) 489{ |
492 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 490 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
493 struct avs_dev *adev = to_avs_dev(dai->dev); 494 struct avs_dma_data *data; 495 496 if (rtd->dai_link->ignore_suspend) 497 adev->num_lp_paths--; 498 499 data = snd_soc_dai_get_dma_data(dai, substream); 500 --- 122 unchanged lines hidden (view full) --- 623 return ret; 624 625 hdac_stream(host_stream)->prepared = true; 626 return 0; 627} 628 629static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) 630{ | 491 struct avs_dev *adev = to_avs_dev(dai->dev); 492 struct avs_dma_data *data; 493 494 if (rtd->dai_link->ignore_suspend) 495 adev->num_lp_paths--; 496 497 data = snd_soc_dai_get_dma_data(dai, substream); 498 --- 122 unchanged lines hidden (view full) --- 621 return ret; 622 623 hdac_stream(host_stream)->prepared = true; 624 return 0; 625} 626 627static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) 628{ |
631 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 629 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
632 struct avs_dma_data *data; 633 struct hdac_ext_stream *host_stream; 634 struct hdac_bus *bus; 635 unsigned long flags; 636 int ret = 0; 637 638 data = snd_soc_dai_get_dma_data(dai, substream); 639 host_stream = data->host_stream; --- 191 unchanged lines hidden (view full) --- 831 832static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data *data) 833{ 834 struct snd_pcm_substream *substream; 835 struct snd_soc_pcm_runtime *rtd; 836 int ret; 837 838 substream = data->substream; | 630 struct avs_dma_data *data; 631 struct hdac_ext_stream *host_stream; 632 struct hdac_bus *bus; 633 unsigned long flags; 634 int ret = 0; 635 636 data = snd_soc_dai_get_dma_data(dai, substream); 637 host_stream = data->host_stream; --- 191 unchanged lines hidden (view full) --- 829 830static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data *data) 831{ 832 struct snd_pcm_substream *substream; 833 struct snd_soc_pcm_runtime *rtd; 834 int ret; 835 836 substream = data->substream; |
839 rtd = snd_pcm_substream_chip(substream); | 837 rtd = asoc_substream_to_rtd(substream); |
840 841 ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai); 842 if (ret) 843 dev_err(dai->dev, "hw_params on resume failed: %d\n", ret); 844 845 return ret; 846} 847 --- 76 unchanged lines hidden (view full) --- 924 int (*op)(struct snd_soc_dai *, struct avs_dma_data *)) 925{ 926 struct snd_soc_pcm_runtime *rtd; 927 struct avs_dma_data *data; 928 struct snd_soc_dai *dai; 929 int ret; 930 931 for_each_component_dais(component, dai) { | 838 839 ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai); 840 if (ret) 841 dev_err(dai->dev, "hw_params on resume failed: %d\n", ret); 842 843 return ret; 844} 845 --- 76 unchanged lines hidden (view full) --- 922 int (*op)(struct snd_soc_dai *, struct avs_dma_data *)) 923{ 924 struct snd_soc_pcm_runtime *rtd; 925 struct avs_dma_data *data; 926 struct snd_soc_dai *dai; 927 int ret; 928 929 for_each_component_dais(component, dai) { |
932 data = dai->playback_dma_data; | 930 data = snd_soc_dai_dma_data_get_playback(dai); |
933 if (data) { | 931 if (data) { |
934 rtd = snd_pcm_substream_chip(data->substream); | 932 rtd = asoc_substream_to_rtd(data->substream); |
935 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 936 ret = op(dai, data); 937 if (ret < 0) { 938 __snd_pcm_set_state(data->substream->runtime, 939 SNDRV_PCM_STATE_DISCONNECTED); 940 return ret; 941 } 942 } 943 } 944 | 933 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 934 ret = op(dai, data); 935 if (ret < 0) { 936 __snd_pcm_set_state(data->substream->runtime, 937 SNDRV_PCM_STATE_DISCONNECTED); 938 return ret; 939 } 940 } 941 } 942 |
945 data = dai->capture_dma_data; | 943 data = snd_soc_dai_dma_data_get_capture(dai); |
946 if (data) { | 944 if (data) { |
947 rtd = snd_pcm_substream_chip(data->substream); | 945 rtd = asoc_substream_to_rtd(data->substream); |
948 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 949 ret = op(dai, data); 950 if (ret < 0) { 951 __snd_pcm_set_state(data->substream->runtime, 952 SNDRV_PCM_STATE_DISCONNECTED); 953 return ret; 954 } 955 } --- 87 unchanged lines hidden (view full) --- 1043 .periods_min = 2, 1044 .periods_max = AZX_MAX_FRAG, 1045 .fifo_size = 0, 1046}; 1047 1048static int avs_component_open(struct snd_soc_component *component, 1049 struct snd_pcm_substream *substream) 1050{ | 946 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 947 ret = op(dai, data); 948 if (ret < 0) { 949 __snd_pcm_set_state(data->substream->runtime, 950 SNDRV_PCM_STATE_DISCONNECTED); 951 return ret; 952 } 953 } --- 87 unchanged lines hidden (view full) --- 1041 .periods_min = 2, 1042 .periods_max = AZX_MAX_FRAG, 1043 .fifo_size = 0, 1044}; 1045 1046static int avs_component_open(struct snd_soc_component *component, 1047 struct snd_pcm_substream *substream) 1048{ |
1051 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 1049 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
1052 1053 /* only FE DAI links are handled here */ 1054 if (rtd->dai_link->no_pcm) 1055 return 0; 1056 1057 return snd_soc_set_runtime_hwparams(substream, &avs_pcm_hardware); 1058} 1059 1060static unsigned int avs_hda_stream_dpib_read(struct hdac_ext_stream *stream) 1061{ 1062 return readl(hdac_stream(stream)->bus->remap_addr + AZX_REG_VS_SDXDPIB_XBASE + 1063 (AZX_REG_VS_SDXDPIB_XINTERVAL * hdac_stream(stream)->index)); 1064} 1065 1066static snd_pcm_uframes_t 1067avs_component_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) 1068{ | 1050 1051 /* only FE DAI links are handled here */ 1052 if (rtd->dai_link->no_pcm) 1053 return 0; 1054 1055 return snd_soc_set_runtime_hwparams(substream, &avs_pcm_hardware); 1056} 1057 1058static unsigned int avs_hda_stream_dpib_read(struct hdac_ext_stream *stream) 1059{ 1060 return readl(hdac_stream(stream)->bus->remap_addr + AZX_REG_VS_SDXDPIB_XBASE + 1061 (AZX_REG_VS_SDXDPIB_XINTERVAL * hdac_stream(stream)->index)); 1062} 1063 1064static snd_pcm_uframes_t 1065avs_component_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) 1066{ |
1069 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 1067 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
1070 struct avs_dma_data *data; 1071 struct hdac_ext_stream *host_stream; 1072 unsigned int pos; 1073 1074 data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); 1075 if (!data->host_stream) 1076 return 0; 1077 --- 208 unchanged lines hidden (view full) --- 1286 struct hda_codec *codec; 1287 char name[32]; 1288 1289 mach = dev_get_platdata(component->card->dev); 1290 codec = mach->pdata; 1291 sprintf(name, "%s-cpu", dev_name(&codec->core.dev)); 1292 1293 for_each_component_dais_safe(component, dai, save) { | 1068 struct avs_dma_data *data; 1069 struct hdac_ext_stream *host_stream; 1070 unsigned int pos; 1071 1072 data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); 1073 if (!data->host_stream) 1074 return 0; 1075 --- 208 unchanged lines hidden (view full) --- 1284 struct hda_codec *codec; 1285 char name[32]; 1286 1287 mach = dev_get_platdata(component->card->dev); 1288 codec = mach->pdata; 1289 sprintf(name, "%s-cpu", dev_name(&codec->core.dev)); 1290 1291 for_each_component_dais_safe(component, dai, save) { |
1292 int stream; 1293 |
|
1294 if (!strstr(dai->driver->name, name)) 1295 continue; 1296 | 1294 if (!strstr(dai->driver->name, name)) 1295 continue; 1296 |
1297 snd_soc_dapm_free_widget(dai->playback_widget); 1298 snd_soc_dapm_free_widget(dai->capture_widget); | 1297 for_each_pcm_streams(stream) 1298 snd_soc_dapm_free_widget(snd_soc_dai_get_widget(dai, stream)); 1299 |
1299 snd_soc_unregister_dai(dai); 1300 } 1301} 1302 1303static int avs_component_hda_probe(struct snd_soc_component *component) 1304{ 1305 struct snd_soc_dapm_context *dapm; 1306 struct snd_soc_dai_driver *dais; --- 82 unchanged lines hidden (view full) --- 1389{ 1390 avs_component_hda_unregister_dais(component); 1391 avs_component_remove(component); 1392} 1393 1394static int avs_component_hda_open(struct snd_soc_component *component, 1395 struct snd_pcm_substream *substream) 1396{ | 1300 snd_soc_unregister_dai(dai); 1301 } 1302} 1303 1304static int avs_component_hda_probe(struct snd_soc_component *component) 1305{ 1306 struct snd_soc_dapm_context *dapm; 1307 struct snd_soc_dai_driver *dais; --- 82 unchanged lines hidden (view full) --- 1390{ 1391 avs_component_hda_unregister_dais(component); 1392 avs_component_remove(component); 1393} 1394 1395static int avs_component_hda_open(struct snd_soc_component *component, 1396 struct snd_pcm_substream *substream) 1397{ |
1397 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 1398 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
1398 struct hdac_ext_stream *link_stream; 1399 struct hda_codec *codec; 1400 1401 if (!rtd->dai_link->no_pcm) { 1402 struct snd_pcm_hardware hwparams = avs_pcm_hardware; 1403 struct snd_soc_pcm_runtime *be; 1404 struct snd_soc_dpcm *dpcm; 1405 int dir = substream->stream; --- 30 unchanged lines hidden (view full) --- 1436 1437 substream->runtime->private_data = link_stream; 1438 return 0; 1439} 1440 1441static int avs_component_hda_close(struct snd_soc_component *component, 1442 struct snd_pcm_substream *substream) 1443{ | 1399 struct hdac_ext_stream *link_stream; 1400 struct hda_codec *codec; 1401 1402 if (!rtd->dai_link->no_pcm) { 1403 struct snd_pcm_hardware hwparams = avs_pcm_hardware; 1404 struct snd_soc_pcm_runtime *be; 1405 struct snd_soc_dpcm *dpcm; 1406 int dir = substream->stream; --- 30 unchanged lines hidden (view full) --- 1437 1438 substream->runtime->private_data = link_stream; 1439 return 0; 1440} 1441 1442static int avs_component_hda_close(struct snd_soc_component *component, 1443 struct snd_pcm_substream *substream) 1444{ |
1444 struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); | 1445 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
1445 struct hdac_ext_stream *link_stream; 1446 1447 /* only BE DAI links are handled here */ 1448 if (!rtd->dai_link->no_pcm) 1449 return 0; 1450 1451 link_stream = substream->runtime->private_data; 1452 snd_hdac_ext_stream_release(link_stream, HDAC_EXT_STREAM_TYPE_LINK); --- 32 unchanged lines hidden --- | 1446 struct hdac_ext_stream *link_stream; 1447 1448 /* only BE DAI links are handled here */ 1449 if (!rtd->dai_link->no_pcm) 1450 return 0; 1451 1452 link_stream = substream->runtime->private_data; 1453 snd_hdac_ext_stream_release(link_stream, HDAC_EXT_STREAM_TYPE_LINK); --- 32 unchanged lines hidden --- |