Skip to content

Commit 7b5df67

Browse files
committed
ASoC: SOF: control: skip rpm calls in ext_volatile_get if not implemented
Test earlier for the existence of ext_volatile_get callback and if it is missing, skip the rpm calls to avoid needles DSP power on. No change in functionality, we just skip the DSP power on in the unlikely case when the ext_volatile _get is not supported and yet the topology adds such control. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent c58a266 commit 7b5df67

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sound/soc/sof/control.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,18 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
187187
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
188188
int ret, err;
189189

190+
/* ignore the ext_volatile_get call if the callbacks are not provided */
191+
if (!tplg_ops || !tplg_ops->control ||
192+
!tplg_ops->control->bytes_ext_volatile_get)
193+
return 0;
194+
190195
ret = pm_runtime_resume_and_get(scomp->dev);
191196
if (ret < 0 && ret != -EACCES) {
192197
dev_err_ratelimited(scomp->dev, "%s: failed to resume %d\n", __func__, ret);
193198
return ret;
194199
}
195200

196-
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_volatile_get)
197-
ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size);
201+
ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size);
198202

199203
pm_runtime_mark_last_busy(scomp->dev);
200204
err = pm_runtime_put_autosuspend(scomp->dev);

0 commit comments

Comments
 (0)