|
Jiri Slaby |
ba7816 |
From: Rander Wang <rander.wang@intel.com>
|
|
Jiri Slaby |
ba7816 |
Date: Tue, 7 Mar 2023 13:06:56 +0200
|
|
Jiri Slaby |
ba7816 |
Subject: [PATCH] ASoC: SOF: IPC4: update gain ipc msg definition to align with
|
|
Jiri Slaby |
ba7816 |
fw
|
|
Jiri Slaby |
ba7816 |
MIME-Version: 1.0
|
|
Jiri Slaby |
ba7816 |
Content-Type: text/plain; charset=UTF-8
|
|
Jiri Slaby |
ba7816 |
Content-Transfer-Encoding: 8bit
|
|
Jiri Slaby |
ba7816 |
References: bsc#1012628
|
|
Jiri Slaby |
ba7816 |
Patch-mainline: 6.2.10
|
|
Jiri Slaby |
ba7816 |
Git-commit: e45cd86c3a78bfb9875a5eb8ab5dab459b59bbe2
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
[ Upstream commit e45cd86c3a78bfb9875a5eb8ab5dab459b59bbe2 ]
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
Recent firmware changes modified the curve duration from 32 to 64 bits,
|
|
Jiri Slaby |
ba7816 |
which breaks volume ramps. A simple solution would be to change the
|
|
Jiri Slaby |
ba7816 |
definition, but unfortunately the ASoC topology framework only supports
|
|
Jiri Slaby |
ba7816 |
up to 32 bit tokens.
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
This patch suggests breaking the 64 bit value in low and high parts, with
|
|
Jiri Slaby |
ba7816 |
only the low-part extracted from topology and high-part only zeroes. Since
|
|
Jiri Slaby |
ba7816 |
the curve duration is represented in hundred of nanoseconds, we can still
|
|
Jiri Slaby |
ba7816 |
represent a 400s ramp, which is just fine. The defacto ABI change has no
|
|
Jiri Slaby |
ba7816 |
effect on existing users since the IPC4 firmware has not been released just
|
|
Jiri Slaby |
ba7816 |
yet.
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
Link: https://github.com/thesofproject/linux/issues/4026
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
Signed-off-by: Rander Wang <rander.wang@intel.com>
|
|
Jiri Slaby |
ba7816 |
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
|
|
Jiri Slaby |
ba7816 |
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
|
Jiri Slaby |
ba7816 |
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
|
|
Jiri Slaby |
ba7816 |
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
|
|
Jiri Slaby |
ba7816 |
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
|
|
Jiri Slaby |
ba7816 |
Link: https://lore.kernel.org/r/20230307110656.1816-1-peter.ujfalusi@linux.intel.com
|
|
Jiri Slaby |
ba7816 |
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
Jiri Slaby |
ba7816 |
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
|
Jiri Slaby |
ba7816 |
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
|
Jiri Slaby |
ba7816 |
---
|
|
Jiri Slaby |
ba7816 |
sound/soc/sof/ipc4-control.c | 3 ++-
|
|
Jiri Slaby |
ba7816 |
sound/soc/sof/ipc4-topology.c | 4 ++--
|
|
Jiri Slaby |
ba7816 |
sound/soc/sof/ipc4-topology.h | 6 ++++--
|
|
Jiri Slaby |
ba7816 |
3 files changed, 8 insertions(+), 5 deletions(-)
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c
|
|
Jiri Slaby |
ba7816 |
index 0d5a578c..7442ec1c 100644
|
|
Jiri Slaby |
ba7816 |
--- a/sound/soc/sof/ipc4-control.c
|
|
Jiri Slaby |
ba7816 |
+++ b/sound/soc/sof/ipc4-control.c
|
|
Jiri Slaby |
ba7816 |
@@ -84,7 +84,8 @@ sof_ipc4_set_volume_data(struct snd_sof_dev *sdev, struct snd_sof_widget *swidge
|
|
Jiri Slaby |
ba7816 |
}
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
/* set curve type and duration from topology */
|
|
Jiri Slaby |
ba7816 |
- data.curve_duration = gain->data.curve_duration;
|
|
Jiri Slaby |
ba7816 |
+ data.curve_duration_l = gain->data.curve_duration_l;
|
|
Jiri Slaby |
ba7816 |
+ data.curve_duration_h = gain->data.curve_duration_h;
|
|
Jiri Slaby |
ba7816 |
data.curve_type = gain->data.curve_type;
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
msg->data_ptr = &dat;;
|
|
Jiri Slaby |
ba7816 |
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
|
|
Jiri Slaby |
ba7816 |
index 65da1cf7..6da6137f 100644
|
|
Jiri Slaby |
ba7816 |
--- a/sound/soc/sof/ipc4-topology.c
|
|
Jiri Slaby |
ba7816 |
+++ b/sound/soc/sof/ipc4-topology.c
|
|
Jiri Slaby |
ba7816 |
@@ -107,7 +107,7 @@ static const struct sof_topology_token gain_tokens[] = {
|
|
Jiri Slaby |
ba7816 |
get_token_u32, offsetof(struct sof_ipc4_gain_data, curve_type)},
|
|
Jiri Slaby |
ba7816 |
{SOF_TKN_GAIN_RAMP_DURATION,
|
|
Jiri Slaby |
ba7816 |
SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
|
|
Jiri Slaby |
ba7816 |
- offsetof(struct sof_ipc4_gain_data, curve_duration)},
|
|
Jiri Slaby |
ba7816 |
+ offsetof(struct sof_ipc4_gain_data, curve_duration_l)},
|
|
Jiri Slaby |
ba7816 |
{SOF_TKN_GAIN_VAL, SND_SOC_TPLG_TUPLE_TYPE_WORD,
|
|
Jiri Slaby |
ba7816 |
get_token_u32, offsetof(struct sof_ipc4_gain_data, init_val)},
|
|
Jiri Slaby |
ba7816 |
};
|
|
Jiri Slaby |
ba7816 |
@@ -670,7 +670,7 @@ static int sof_ipc4_widget_setup_comp_pga(struct snd_sof_widget *swidget)
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
dev_dbg(scomp->dev,
|
|
Jiri Slaby |
ba7816 |
"pga widget %s: ramp type: %d, ramp duration %d, initial gain value: %#x, cpc %d\n",
|
|
Jiri Slaby |
ba7816 |
- swidget->widget->name, gain->data.curve_type, gain->data.curve_duration,
|
|
Jiri Slaby |
ba7816 |
+ swidget->widget->name, gain->data.curve_type, gain->data.curve_duration_l,
|
|
Jiri Slaby |
ba7816 |
gain->data.init_val, gain->base_config.cpc);
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
ret = sof_ipc4_widget_setup_msg(swidget, &gain->msg);
|
|
Jiri Slaby |
ba7816 |
diff --git a/sound/soc/sof/ipc4-topology.h b/sound/soc/sof/ipc4-topology.h
|
|
Jiri Slaby |
ba7816 |
index 2363a7cc..cf9d2785 100644
|
|
Jiri Slaby |
ba7816 |
--- a/sound/soc/sof/ipc4-topology.h
|
|
Jiri Slaby |
ba7816 |
+++ b/sound/soc/sof/ipc4-topology.h
|
|
Jiri Slaby |
ba7816 |
@@ -217,14 +217,16 @@ struct sof_ipc4_control_data {
|
|
Jiri Slaby |
ba7816 |
* @init_val: Initial value
|
|
Jiri Slaby |
ba7816 |
* @curve_type: Curve type
|
|
Jiri Slaby |
ba7816 |
* @reserved: reserved for future use
|
|
Jiri Slaby |
ba7816 |
- * @curve_duration: Curve duration
|
|
Jiri Slaby |
ba7816 |
+ * @curve_duration_l: Curve duration low part
|
|
Jiri Slaby |
ba7816 |
+ * @curve_duration_h: Curve duration high part
|
|
Jiri Slaby |
ba7816 |
*/
|
|
Jiri Slaby |
ba7816 |
struct sof_ipc4_gain_data {
|
|
Jiri Slaby |
ba7816 |
uint32_t channels;
|
|
Jiri Slaby |
ba7816 |
uint32_t init_val;
|
|
Jiri Slaby |
ba7816 |
uint32_t curve_type;
|
|
Jiri Slaby |
ba7816 |
uint32_t reserved;
|
|
Jiri Slaby |
ba7816 |
- uint32_t curve_duration;
|
|
Jiri Slaby |
ba7816 |
+ uint32_t curve_duration_l;
|
|
Jiri Slaby |
ba7816 |
+ uint32_t curve_duration_h;
|
|
Jiri Slaby |
ba7816 |
} __aligned(8);
|
|
Jiri Slaby |
ba7816 |
|
|
Jiri Slaby |
ba7816 |
/**
|
|
Jiri Slaby |
ba7816 |
--
|
|
Jiri Slaby |
ba7816 |
2.35.3
|
|
Jiri Slaby |
ba7816 |
|