Skip to content

Commit 967885e

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: Introduce IPC-specific PCM ops
Introduce the IPC-specific PCM ops that will be used to abstract the PCM related IPC's. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220317175044.1752400-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 67ec2a0 commit 967885e

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

sound/soc/sof/sof-audio.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ struct snd_sof_dai_config_data {
4545
int dai_data; /* contains DAI-specific information */
4646
};
4747

48+
/**
49+
* struct sof_ipc_pcm_ops - IPC-specific PCM ops
50+
* @hw_params: Function pointer for hw_params
51+
* @hw_free: Function pointer for hw_free
52+
* @trigger: Function pointer for trigger
53+
* @dai_link_fixup: Function pointer for DAI link fixup
54+
*/
55+
struct sof_ipc_pcm_ops {
56+
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
57+
struct snd_pcm_hw_params *params,
58+
struct snd_sof_platform_stream_params *platform_params);
59+
int (*hw_free)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
60+
int (*trigger)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
61+
int cmd);
62+
int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
63+
};
64+
4865
/**
4966
* struct sof_ipc_tplg_control_ops - IPC-specific ops for topology kcontrol IO
5067
*/

sound/soc/sof/sof-priv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,18 @@ struct sof_ipc_pm_ops {
371371
};
372372

373373
struct sof_ipc_tplg_ops;
374+
struct sof_ipc_pcm_ops;
374375

375376
/**
376377
* struct sof_ipc_ops - IPC-specific ops
377378
* @tplg: Pointer to IPC-specific topology ops
378379
* @pm: Pointer to PM ops
380+
* @pcm: Pointer to PCM ops
379381
*/
380382
struct sof_ipc_ops {
381383
const struct sof_ipc_tplg_ops *tplg;
382384
const struct sof_ipc_pm_ops *pm;
385+
const struct sof_ipc_pcm_ops *pcm;
383386
};
384387

385388
/* SOF generic IPC data */

0 commit comments

Comments
 (0)