pcm.c (66da65005aa819e0b8d3a08f5ec1491b7690cb67) | pcm.c (4ea3bfd13a2484b5f1c19f60b1dc7494f261f0a4) |
---|---|
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) 2// 3// This file is provided under a dual BSD/GPLv2 license. When using or 4// redistributing this file, you may do so under either license. 5// 6// Copyright(c) 2018 Intel Corporation. All rights reserved. 7// 8// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- 590 unchanged lines hidden (view full) --- 599 600static int sof_pcm_probe(struct snd_soc_component *component) 601{ 602 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 603 struct snd_sof_pdata *plat_data = sdev->pdata; 604 const char *tplg_filename; 605 int ret; 606 | 1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) 2// 3// This file is provided under a dual BSD/GPLv2 license. When using or 4// redistributing this file, you may do so under either license. 5// 6// Copyright(c) 2018 Intel Corporation. All rights reserved. 7// 8// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- 590 unchanged lines hidden (view full) --- 599 600static int sof_pcm_probe(struct snd_soc_component *component) 601{ 602 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 603 struct snd_sof_pdata *plat_data = sdev->pdata; 604 const char *tplg_filename; 605 int ret; 606 |
607 /* 608 * make sure the device is pm_runtime_active before loading the 609 * topology and initiating IPC or bus transactions 610 */ 611 ret = pm_runtime_resume_and_get(component->dev); 612 if (ret < 0 && ret != -EACCES) 613 return ret; 614 |
|
607 /* load the default topology */ 608 sdev->component = component; 609 610 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, 611 "%s/%s", 612 plat_data->tplg_filename_prefix, 613 plat_data->tplg_filename); 614 if (!tplg_filename) 615 return -ENOMEM; 616 617 ret = snd_sof_load_topology(component, tplg_filename); 618 if (ret < 0) { 619 dev_err(component->dev, "error: failed to load DSP topology %d\n", 620 ret); 621 return ret; 622 } 623 | 615 /* load the default topology */ 616 sdev->component = component; 617 618 tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, 619 "%s/%s", 620 plat_data->tplg_filename_prefix, 621 plat_data->tplg_filename); 622 if (!tplg_filename) 623 return -ENOMEM; 624 625 ret = snd_sof_load_topology(component, tplg_filename); 626 if (ret < 0) { 627 dev_err(component->dev, "error: failed to load DSP topology %d\n", 628 ret); 629 return ret; 630 } 631 |
632 pm_runtime_mark_last_busy(component->dev); 633 pm_runtime_put_autosuspend(component->dev); 634 |
|
624 return ret; 625} 626 627static void sof_pcm_remove(struct snd_soc_component *component) 628{ 629 /* remove topology */ 630 snd_soc_tplg_component_remove(component); 631} --- 43 unchanged lines hidden --- | 635 return ret; 636} 637 638static void sof_pcm_remove(struct snd_soc_component *component) 639{ 640 /* remove topology */ 641 snd_soc_tplg_component_remove(component); 642} --- 43 unchanged lines hidden --- |