Skip to content

Commit

Permalink
ASoC: SOF: Introduce IPC-specific PCM ops
Browse files Browse the repository at this point in the history
Introduce the IPC-specific PCM ops that will be used to abstract the
PCM related IPC's.

Signed-off-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
ranj063 authored and broonie committed Mar 18, 2022
1 parent 67ec2a0 commit 967885e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sound/soc/sof/sof-audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ struct snd_sof_dai_config_data {
int dai_data; /* contains DAI-specific information */
};

/**
* struct sof_ipc_pcm_ops - IPC-specific PCM ops
* @hw_params: Function pointer for hw_params
* @hw_free: Function pointer for hw_free
* @trigger: Function pointer for trigger
* @dai_link_fixup: Function pointer for DAI link fixup
*/
struct sof_ipc_pcm_ops {
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_sof_platform_stream_params *platform_params);
int (*hw_free)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
int (*trigger)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
int cmd);
int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
};

/**
* struct sof_ipc_tplg_control_ops - IPC-specific ops for topology kcontrol IO
*/
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,18 @@ struct sof_ipc_pm_ops {
};

struct sof_ipc_tplg_ops;
struct sof_ipc_pcm_ops;

/**
* struct sof_ipc_ops - IPC-specific ops
* @tplg: Pointer to IPC-specific topology ops
* @pm: Pointer to PM ops
* @pcm: Pointer to PCM ops
*/
struct sof_ipc_ops {
const struct sof_ipc_tplg_ops *tplg;
const struct sof_ipc_pm_ops *pm;
const struct sof_ipc_pcm_ops *pcm;
};

/* SOF generic IPC data */
Expand Down

0 comments on commit 967885e

Please sign in to comment.