diff mbox series

[05/11] ASoC: SOF: expose a couple of functions

Message ID 20220426171743.171061-6-ranjani.sridharan@linux.intel.com (mailing list archive)
State Accepted
Commit 7b3a5be546a131f806fa015d1c78987daf1eb5c9
Headers show
Series ASoC: SOF: Miscellaneous preparatory patches for IPC4 | expand

Commit Message

Ranjani Sridharan April 26, 2022, 5:17 p.m. UTC
Expose the mixer_to_ipc() and ipc_to_mixer() functions for reuse in
IPC4.

Signed-off-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>
---
 sound/soc/sof/ipc3-control.c | 20 --------------------
 sound/soc/sof/sof-audio.h    | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/ipc3-control.c b/sound/soc/sof/ipc3-control.c
index bea26e73a741..4347adcc6543 100644
--- a/sound/soc/sof/ipc3-control.c
+++ b/sound/soc/sof/ipc3-control.c
@@ -90,26 +90,6 @@  static int sof_ipc3_set_get_kcontrol_data(struct snd_sof_control *scontrol, bool
 	return iops->set_get_data(sdev, cdata, cdata->rhdr.hdr.size, set);
 }
 
-static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size)
-{
-	if (value >= size)
-		return volume_map[size - 1];
-
-	return volume_map[value];
-}
-
-static inline u32 ipc_to_mixer(u32 value, u32 *volume_map, int size)
-{
-	int i;
-
-	for (i = 0; i < size; i++) {
-		if (volume_map[i] >= value)
-			return i;
-	}
-
-	return i - 1;
-}
-
 static void snd_sof_refresh_control(struct snd_sof_control *scontrol)
 {
 	struct sof_ipc_ctrl_data *cdata = scontrol->ipc_control_data;
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h
index eb882ed7d0e4..e3cfc813975b 100644
--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -48,6 +48,26 @@  enum sof_widget_op {
 
 #define SOF_TLV_ITEMS 3
 
+static inline u32 mixer_to_ipc(unsigned int value, u32 *volume_map, int size)
+{
+	if (value >= size)
+		return volume_map[size - 1];
+
+	return volume_map[value];
+}
+
+static inline u32 ipc_to_mixer(u32 value, u32 *volume_map, int size)
+{
+	int i;
+
+	for (i = 0; i < size; i++) {
+		if (volume_map[i] >= value)
+			return i;
+	}
+
+	return i - 1;
+}
+
 struct snd_sof_widget;
 struct snd_sof_route;
 struct snd_sof_control;