]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SOF: control: skip rpm calls in ext_volatile_get if not implemented
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Mon, 15 Dec 2025 13:29:40 +0000 (15:29 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 15 Dec 2025 14:07:41 +0000 (23:07 +0900)
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>
sound/soc/sof/control.c

index a3fd1d523c0940d2ef8c1bef0347daafda3656c9..9582ab5f1113c3114bed28a134920c70dcea66bb 100644 (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)