Commit a0149a6b authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: Introduce IPC ops for kcontrol IO

Introduce IPC-specific ops for kcontrol IO in struct ipc_tplg_ops.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220317175044.1752400-5-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 657774ac
...@@ -45,6 +45,28 @@ struct snd_sof_dai_config_data { ...@@ -45,6 +45,28 @@ struct snd_sof_dai_config_data {
int dai_data; /* contains DAI-specific information */ int dai_data; /* contains DAI-specific information */
}; };
/**
* struct ipc_tplg_control_ops - IPC-specific ops for topology kcontrol IO
*/
struct ipc_tplg_control_ops {
bool (*volume_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*volume_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
bool (*switch_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*switch_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
bool (*enum_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*enum_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_ext_get)(struct snd_sof_control *scontrol,
const unsigned int __user *binary_data, unsigned int size);
int (*bytes_ext_volatile_get)(struct snd_sof_control *scontrol,
const unsigned int __user *binary_data, unsigned int size);
int (*bytes_ext_put)(struct snd_sof_control *scontrol,
const unsigned int __user *binary_data, unsigned int size);
/* update control data based on notification from the DSP */
void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message);
};
/** /**
* struct sof_ipc_tplg_widget_ops - IPC-specific ops for topology widgets * struct sof_ipc_tplg_widget_ops - IPC-specific ops for topology widgets
* @ipc_setup: Function pointer for setting up widget IPC params * @ipc_setup: Function pointer for setting up widget IPC params
...@@ -67,6 +89,7 @@ struct sof_ipc_tplg_widget_ops { ...@@ -67,6 +89,7 @@ struct sof_ipc_tplg_widget_ops {
* @widget: Array of pointers to IPC-specific ops for widgets. This should always be of size * @widget: Array of pointers to IPC-specific ops for widgets. This should always be of size
* SND_SOF_DAPM_TYPE_COUNT i.e one per widget type. Unsupported widget types will be * SND_SOF_DAPM_TYPE_COUNT i.e one per widget type. Unsupported widget types will be
* initialized to 0. * initialized to 0.
* @control: Pointer to the IPC-specific ops for topology kcontrol IO
* @route_setup: Function pointer for setting up pipeline connections * @route_setup: Function pointer for setting up pipeline connections
* @token_list: List of all tokens supported by the IPC version. The size of the token_list * @token_list: List of all tokens supported by the IPC version. The size of the token_list
* array should be SOF_TOKEN_COUNT. The unused elements in the array will be * array should be SOF_TOKEN_COUNT. The unused elements in the array will be
...@@ -80,6 +103,7 @@ struct sof_ipc_tplg_widget_ops { ...@@ -80,6 +103,7 @@ struct sof_ipc_tplg_widget_ops {
*/ */
struct sof_ipc_tplg_ops { struct sof_ipc_tplg_ops {
const struct sof_ipc_tplg_widget_ops *widget; const struct sof_ipc_tplg_widget_ops *widget;
const struct ipc_tplg_control_ops *control;
int (*route_setup)(struct snd_sof_dev *sdev, struct snd_sof_route *sroute); int (*route_setup)(struct snd_sof_dev *sdev, struct snd_sof_route *sroute);
const struct sof_token_info *token_list; const struct sof_token_info *token_list;
int (*control_setup)(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol); int (*control_setup)(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment