Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sound/soc/qcom/qdsp6/q6apm-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static const struct snd_soc_component_driver q6apm_fe_dai_component = {
.ack = q6apm_dai_ack,
.compress_ops = &q6apm_dai_compress_ops,
.use_dai_pcm_id = true,
.remove_order = SND_SOC_COMP_ORDER_EARLY,
};

static int q6apm_dai_probe(struct platform_device *pdev)
Expand Down
1 change: 1 addition & 0 deletions sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ static const struct snd_soc_component_driver q6apm_lpass_dai_component = {
.of_xlate_dai_name = q6dsp_audio_ports_of_xlate_dai_name,
.be_pcm_base = AUDIOREACH_BE_PCM_BASE,
.use_dai_pcm_id = true,
.remove_order = SND_SOC_COMP_ORDER_FIRST,
};

static int q6apm_lpass_dai_dev_probe(struct platform_device *pdev)
Expand Down
11 changes: 9 additions & 2 deletions sound/soc/qcom/qdsp6/q6apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ static const struct snd_soc_component_driver q6apm_audio_component = {
.name = APM_AUDIO_DRV_NAME,
.probe = q6apm_audio_probe,
.remove = q6apm_audio_remove,
.remove_order = SND_SOC_COMP_ORDER_LAST,
};

static int apm_probe(gpr_device_t *gdev)
Expand Down Expand Up @@ -766,13 +767,18 @@ static int apm_probe(gpr_device_t *gdev)

q6apm_get_apm_state(apm);

ret = devm_snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0);
ret = snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0);
if (ret < 0) {
dev_err(dev, "failed to register q6apm: %d\n", ret);
return ret;
}

return of_platform_populate(dev->of_node, NULL, NULL, dev);
return devm_of_platform_populate(dev);
}

static void apm_remove(gpr_device_t *gdev)
{
snd_soc_unregister_component(&gdev->dev);
}

struct audioreach_module *q6apm_find_module_by_mid(struct q6apm_graph *graph, uint32_t mid)
Expand Down Expand Up @@ -839,6 +845,7 @@ MODULE_DEVICE_TABLE(of, apm_device_id);

static gpr_driver_t apm_driver = {
.probe = apm_probe,
.remove = apm_remove,
.gpr_callback = apm_callback,
.driver = {
.name = "qcom-apm",
Expand Down
8 changes: 5 additions & 3 deletions sound/soc/qcom/qdsp6/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
struct audioreach_container *cont;
struct audioreach_module *mod;

mod = dobj->private;
cont = mod->container;

if (w->id == snd_soc_dapm_mixer) {
/* virtual widget */
struct snd_ar_control *scontrol = dobj->private;
Expand All @@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
kfree(scontrol);
return 0;
}
mod = dobj->private;
if (!mod)
return 0;

cont = mod->container;

mutex_lock(&apm->lock);
idr_remove(&apm->modules_idr, mod->instance_id);
Expand Down