summaryrefslogtreecommitdiff
path: root/sound/soc/sof/control.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2021-12-15 21:04:03 +0300
committerMark Brown <broonie@kernel.org>2021-12-16 01:16:47 +0300
commit47d7328f8cda15e60422c8ca36d067c4deb19b7e (patch)
treee3d1cf7d0596073fc800e2e5c977a2c22cfac1d0 /sound/soc/sof/control.c
parent68be4f0ed40cce833cb313871c52878025e40596 (diff)
downloadlinux-47d7328f8cda15e60422c8ca36d067c4deb19b7e.tar.xz
ASoC: SOF: Drop ctrl_type parameter for snd_sof_ipc_set_get_comp_data()
The SOF_CTRL_TYPE_VALUE_COMP_* type is not used by the firmware nor in the kernel side. It is also not clear what action should be taken for such type. With this in mind: The correct ipc_cmd can be selected based on the `ctrl_cmd` and the `set` parameters: if the ctrl_cmd is SOF_CTRL_CMD_BINARY then SOF_CTRL_TYPE_DATA_* otherwise SOF_CTRL_TYPE_VALUE_CHAN_*. The SET or GET direction can be selected with the use of `set` parameter. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20211215180404.53254-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/control.c')
-rw-r--r--sound/soc/sof/control.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c
index dac0b630b6a0..ef61936dad59 100644
--- a/sound/soc/sof/control.c
+++ b/sound/soc/sof/control.c
@@ -83,8 +83,7 @@ static void snd_sof_refresh_control(struct snd_sof_control *scontrol)
/* refresh the component data from DSP */
scontrol->comp_data_dirty = false;
- ret = snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_VALUE_CHAN_GET, false);
+ ret = snd_sof_ipc_set_get_comp_data(scontrol, false);
if (ret < 0) {
dev_err(scomp->dev, "error: failed to get control data: %d\n", ret);
/* Set the flag to re-try next time to get the data */
@@ -135,8 +134,7 @@ int snd_sof_volume_put(struct snd_kcontrol *kcontrol,
/* notify DSP of mixer updates */
if (pm_runtime_active(scomp->dev))
- snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_VALUE_CHAN_SET, true);
+ snd_sof_ipc_set_get_comp_data(scontrol, true);
return change;
}
@@ -205,8 +203,7 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol,
/* notify DSP of mixer updates */
if (pm_runtime_active(scomp->dev))
- snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_VALUE_CHAN_SET, true);
+ snd_sof_ipc_set_get_comp_data(scontrol, true);
return change;
}
@@ -251,8 +248,7 @@ int snd_sof_enum_put(struct snd_kcontrol *kcontrol,
/* notify DSP of enum updates */
if (pm_runtime_active(scomp->dev))
- snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_VALUE_CHAN_SET, true);
+ snd_sof_ipc_set_get_comp_data(scontrol, true);
return change;
}
@@ -326,8 +322,7 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol,
/* notify DSP of byte control updates */
if (pm_runtime_active(scomp->dev))
- snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_DATA_SET, true);
+ snd_sof_ipc_set_get_comp_data(scontrol, true);
return 0;
}
@@ -403,8 +398,7 @@ int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
/* notify DSP of byte control updates */
if (pm_runtime_active(scomp->dev))
- snd_sof_ipc_set_get_comp_data(scontrol,
- SOF_CTRL_TYPE_DATA_SET, true);
+ snd_sof_ipc_set_get_comp_data(scontrol, true);
return 0;
}
@@ -441,7 +435,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
cdata->data->magic = SOF_ABI_MAGIC;
cdata->data->abi = SOF_ABI_VERSION;
/* get all the component data from DSP */
- ret = snd_sof_ipc_set_get_comp_data(scontrol, SOF_CTRL_TYPE_DATA_GET, false);
+ ret = snd_sof_ipc_set_get_comp_data(scontrol, false);
if (ret < 0)
goto out;