Skip to content

Commit eb3dcfb

Browse files
ujfalusiplbossart
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>
1 parent edfe8d0 commit eb3dcfb

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
@@ -222,7 +222,7 @@ struct snd_sof_dsp_ops {
222222
/* host configure DSP HW parameters */
223223
int (*ipc_pcm_params)(struct snd_sof_dev *sdev,
224224
struct snd_pcm_substream *substream,
225-
const struct sof_ipc_pcm_params_reply *reply); /* mandatory */
225+
const struct sof_ipc_pcm_params_reply *reply); /* optional */
226226

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

0 commit comments

Comments
 (0)