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>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20251215132946.2155-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2025-12-15 15:29:40 +02:00 committed by Mark Brown
parent b8e54b447c
commit 2c77ff200f
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -187,14 +187,18 @@ 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);
ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size);
err = pm_runtime_put_autosuspend(scomp->dev);
if (err < 0)