Skip to content

Commit 6d84e03

Browse files
authored
ADSP stop start fix (#368)
ADSP stop start fix
2 parents 935c8c8 + ef3c539 commit 6d84e03

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

sound/soc/qcom/qdsp6/q6apm-dai.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ static const struct snd_soc_component_driver q6apm_fe_dai_component = {
851851
.ack = q6apm_dai_ack,
852852
.compress_ops = &q6apm_dai_compress_ops,
853853
.use_dai_pcm_id = true,
854+
.remove_order = SND_SOC_COMP_ORDER_EARLY,
854855
};
855856

856857
static int q6apm_dai_probe(struct platform_device *pdev)

sound/soc/qcom/qdsp6/q6apm-lpass-dais.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ static const struct snd_soc_component_driver q6apm_lpass_dai_component = {
278278
.of_xlate_dai_name = q6dsp_audio_ports_of_xlate_dai_name,
279279
.be_pcm_base = AUDIOREACH_BE_PCM_BASE,
280280
.use_dai_pcm_id = true,
281+
.remove_order = SND_SOC_COMP_ORDER_FIRST,
281282
};
282283

283284
static int q6apm_lpass_dai_dev_probe(struct platform_device *pdev)

sound/soc/qcom/qdsp6/q6apm.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ static const struct snd_soc_component_driver q6apm_audio_component = {
735735
.name = APM_AUDIO_DRV_NAME,
736736
.probe = q6apm_audio_probe,
737737
.remove = q6apm_audio_remove,
738+
.remove_order = SND_SOC_COMP_ORDER_LAST,
738739
};
739740

740741
static int apm_probe(gpr_device_t *gdev)
@@ -766,13 +767,18 @@ static int apm_probe(gpr_device_t *gdev)
766767

767768
q6apm_get_apm_state(apm);
768769

769-
ret = devm_snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0);
770+
ret = snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0);
770771
if (ret < 0) {
771772
dev_err(dev, "failed to register q6apm: %d\n", ret);
772773
return ret;
773774
}
774775

775-
return of_platform_populate(dev->of_node, NULL, NULL, dev);
776+
return devm_of_platform_populate(dev);
777+
}
778+
779+
static void apm_remove(gpr_device_t *gdev)
780+
{
781+
snd_soc_unregister_component(&gdev->dev);
776782
}
777783

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

840846
static gpr_driver_t apm_driver = {
841847
.probe = apm_probe,
848+
.remove = apm_remove,
842849
.gpr_callback = apm_callback,
843850
.driver = {
844851
.name = "qcom-apm",

sound/soc/qcom/qdsp6/topology.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
952952
struct audioreach_container *cont;
953953
struct audioreach_module *mod;
954954

955-
mod = dobj->private;
956-
cont = mod->container;
957-
958955
if (w->id == snd_soc_dapm_mixer) {
959956
/* virtual widget */
960957
struct snd_ar_control *scontrol = dobj->private;
@@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
963960
kfree(scontrol);
964961
return 0;
965962
}
963+
mod = dobj->private;
964+
if (!mod)
965+
return 0;
966+
967+
cont = mod->container;
966968

967969
mutex_lock(&apm->lock);
968970
idr_remove(&apm->modules_idr, mod->instance_id);

0 commit comments

Comments
 (0)