]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: Intel: avs: Add volume control for GAIN module
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Mon, 17 Feb 2025 10:21:09 +0000 (11:21 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 24 Feb 2025 16:01:54 +0000 (16:01 +0000)
The AudioDSP firmware's GAIN module has same initialization payload as
PEAKVOL and user volume setting can be applied up-front. Update existing
code to account for PEAKVOL and GAIN both.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250217102115.3539427-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/control.c

index dc7dc45e0a0a917fcc453ef6023622a2ce20b9d8..a55723289600a3758699207fd8e96e3c642093a4 100644 (file)
@@ -31,8 +31,11 @@ static struct avs_path_module *avs_get_volume_module(struct avs_dev *adev, u32 i
        list_for_each_entry(path, &adev->path_list, node) {
                list_for_each_entry(ppl, &path->ppl_list, node) {
                        list_for_each_entry(mod, &ppl->mod_list, node) {
-                               if (guid_equal(&mod->template->cfg_ext->type, &AVS_PEAKVOL_MOD_UUID)
-                                   && mod->template->ctl_id == id) {
+                               guid_t *type = &mod->template->cfg_ext->type;
+
+                               if ((guid_equal(type, &AVS_PEAKVOL_MOD_UUID) ||
+                                    guid_equal(type, &AVS_GAIN_MOD_UUID)) &&
+                                   mod->template->ctl_id == id) {
                                        spin_unlock(&adev->path_list_lock);
                                        return mod;
                                }