ASoC: SOF: IPC4: update gain ipc msg definition to align with fw
authorRander Wang <rander.wang@intel.com>
Tue, 7 Mar 2023 11:06:56 +0000 (13:06 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Mar 2023 13:58:04 +0000 (13:58 +0000)
commite45cd86c3a78bfb9875a5eb8ab5dab459b59bbe2
tree2d6ae9e81b3181fcf1d8e810550bd162cd431966
parentc7e328f1cbf22efe23bc3cd7dd6bb14efccc28d0
ASoC: SOF: IPC4: update gain ipc msg definition to align with fw

Recent firmware changes modified the curve duration from 32 to 64 bits,
which breaks volume ramps. A simple solution would be to change the
definition, but unfortunately the ASoC topology framework only supports
up to 32 bit tokens.

This patch suggests breaking the 64 bit value in low and high parts, with
only the low-part extracted from topology and high-part only zeroes. Since
the curve duration is represented in hundred of nanoseconds, we can still
represent a 400s ramp, which is just fine. The defacto ABI change has no
effect on existing users since the IPC4 firmware has not been released just
yet.

Link: https://github.com/thesofproject/linux/issues/4026
Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307110656.1816-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-control.c
sound/soc/sof/ipc4-topology.c
sound/soc/sof/ipc4-topology.h