Unverified Commit 2c77ff20 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

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: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarLiam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20251215132946.2155-3-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b8e54b44
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -187,13 +187,17 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
	const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
	int ret, err;

	/* ignore the ext_volatile_get call if the callbacks are not provided */
	if (!tplg_ops || !tplg_ops->control ||
	    !tplg_ops->control->bytes_ext_volatile_get)
		return 0;

	ret = pm_runtime_resume_and_get(scomp->dev);
	if (ret < 0 && ret != -EACCES) {
		dev_err_ratelimited(scomp->dev, "%s: failed to resume %d\n", __func__, ret);
		return ret;
	}

	if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_volatile_get)
	ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size);

	err = pm_runtime_put_autosuspend(scomp->dev);