Skip to content

Commit a6db22a

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional
AMD is only implementing an empty function to pass the required test and it is going to be deprecated in favor of the IPC agnostic set_stream_data_offset() callback. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220310042720.976809-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 757ce81 commit a6db22a

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

sound/soc/sof/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
361361
if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run ||
362362
!sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write ||
363363
!sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware ||
364-
!sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params ||
365-
!sof_ops(sdev)->fw_ready) {
364+
!sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->fw_ready) {
366365
dev_err(dev, "error: missing mandatory ops\n");
367366
return -EINVAL;
368367
}

sound/soc/sof/ops.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,10 @@ snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev,
473473
struct snd_pcm_substream *substream,
474474
const struct sof_ipc_pcm_params_reply *reply)
475475
{
476-
return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply);
476+
if (sof_ops(sdev) && sof_ops(sdev)->ipc_pcm_params)
477+
return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply);
478+
479+
return 0;
477480
}
478481

479482
/* host side configuration of the stream's data offset in stream mailbox area */

sound/soc/sof/sof-priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ struct snd_sof_dsp_ops {
224224
/* host configure DSP HW parameters */
225225
int (*ipc_pcm_params)(struct snd_sof_dev *sdev,
226226
struct snd_pcm_substream *substream,
227-
const struct sof_ipc_pcm_params_reply *reply); /* mandatory */
227+
const struct sof_ipc_pcm_params_reply *reply); /* optional */
228228

229229
/* host side configuration of the stream's data offset in stream mailbox area */
230230
int (*set_stream_data_offset)(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)