diff options
author | Ranjani Sridharan <ranjani.sridharan@linux.intel.com> | 2022-04-26 20:17:33 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-29 15:05:54 +0300 |
commit | 48d2a1ceae03610a431535aca9106eab4201b191 (patch) | |
tree | 74747565969950f1e0668a4b68d1e9a09236fc48 /sound/soc/sof/sof-audio.h | |
parent | ce216cfa84a4e1c23b105e652c550bdeaac9e922 (diff) | |
download | linux-48d2a1ceae03610a431535aca9106eab4201b191.tar.xz |
ASoC: SOF: Add a new op to set up volume table
Add a new op set_up_volume_table for control IPC ops. Define and set
the op for IPC3.
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>
Link: https://lore.kernel.org/r/20220426171743.171061-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-audio.h')
-rw-r--r-- | sound/soc/sof/sof-audio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index f36c4f62bc99..d8ab8600e328 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -39,6 +39,8 @@ */ #define VOLUME_FWL 16 +#define SOF_TLV_ITEMS 3 + struct snd_sof_widget; struct snd_sof_route; struct snd_sof_control; @@ -88,6 +90,9 @@ struct sof_ipc_tplg_control_ops { void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message); /* Optional callback to setup kcontrols associated with an swidget */ int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget); + /* mandatory callback to set up volume table for volume kcontrols */ + int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS], + int size); }; /** @@ -463,4 +468,5 @@ int sof_update_ipc_object(struct snd_soc_component *scomp, void *object, enum so size_t object_size, int token_instance_num); int sof_pcm_setup_connected_widgets(struct snd_sof_dev *sdev, struct snd_soc_pcm_runtime *rtd, struct snd_sof_pcm *spcm, int dir); +u32 vol_compute_gain(u32 value, int *tlv); #endif |