Skip to content

Commit 8fc2622

Browse files
committed
Make the SOF pcm_hw_params DSP op IPC agnostic
Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>: In preparation for supporting the newly introduced IPC version in the SOF firmware, this patchset adds the changes required to make the pcm_hw_params DSP op IPC agnostic.
2 parents c0fc71e + 00f1925 commit 8fc2622

19 files changed

Lines changed: 95 additions & 83 deletions

File tree

sound/soc/sof/amd/acp-pcm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include "acp-dsp-offset.h"
1818

1919
int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
20-
struct snd_pcm_hw_params *params, struct sof_ipc_stream_params *ipc_params)
20+
struct snd_pcm_hw_params *params,
21+
struct snd_sof_platform_stream_params *platform_params)
2122
{
2223
struct snd_pcm_runtime *runtime = substream->runtime;
2324
struct acp_dsp_stream *stream = runtime->private_data;
@@ -35,8 +36,9 @@ int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substr
3536
return ret;
3637
}
3738

38-
ipc_params->buffer.phy_addr = stream->reg_offset;
39-
ipc_params->stream_tag = stream->stream_tag;
39+
platform_params->use_phy_address = true;
40+
platform_params->phy_addr = stream->reg_offset;
41+
platform_params->stream_tag = stream->stream_tag;
4042

4143
/* write buffer size of stream in scratch memory */
4244

sound/soc/sof/amd/acp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ int acp_dsp_stream_put(struct snd_sof_dev *sdev, struct acp_dsp_stream *acp_stre
201201
int acp_pcm_open(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream);
202202
int acp_pcm_close(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream);
203203
int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
204-
struct snd_pcm_hw_params *params, struct sof_ipc_stream_params *ipc_params);
204+
struct snd_pcm_hw_params *params,
205+
struct snd_sof_platform_stream_params *platform_params);
205206

206207
extern const struct snd_sof_dsp_ops sof_renoir_ops;
207208

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/imx/imx8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static const struct snd_sof_dsp_ops sof_imx8_ops = {
509509
.get_window_offset = imx8_get_window_offset,
510510

511511
.ipc_msg_data = sof_ipc_msg_data,
512-
.ipc_pcm_params = sof_ipc_pcm_params,
512+
.set_stream_data_offset = sof_set_stream_data_offset,
513513

514514
/* module loading */
515515
.load_module = snd_sof_parse_module_memcpy,
@@ -572,7 +572,7 @@ static const struct snd_sof_dsp_ops sof_imx8x_ops = {
572572
.get_window_offset = imx8_get_window_offset,
573573

574574
.ipc_msg_data = sof_ipc_msg_data,
575-
.ipc_pcm_params = sof_ipc_pcm_params,
575+
.set_stream_data_offset = sof_set_stream_data_offset,
576576

577577
/* module loading */
578578
.load_module = snd_sof_parse_module_memcpy,

sound/soc/sof/imx/imx8m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static const struct snd_sof_dsp_ops sof_imx8m_ops = {
435435
.get_window_offset = imx8m_get_window_offset,
436436

437437
.ipc_msg_data = sof_ipc_msg_data,
438-
.ipc_pcm_params = sof_ipc_pcm_params,
438+
.set_stream_data_offset = sof_set_stream_data_offset,
439439

440440
/* module loading */
441441
.load_module = snd_sof_parse_module_memcpy,

sound/soc/sof/intel/apl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const struct snd_sof_dsp_ops sof_apl_ops = {
5656
.get_window_offset = hda_dsp_ipc_get_window_offset,
5757

5858
.ipc_msg_data = hda_ipc_msg_data,
59-
.ipc_pcm_params = hda_ipc_pcm_params,
59+
.set_stream_data_offset = hda_set_stream_data_offset,
6060

6161
/* machine driver */
6262
.machine_select = hda_machine_select,

sound/soc/sof/intel/bdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static const struct snd_sof_dsp_ops sof_bdw_ops = {
596596
.get_window_offset = bdw_get_window_offset,
597597

598598
.ipc_msg_data = sof_ipc_msg_data,
599-
.ipc_pcm_params = sof_ipc_pcm_params,
599+
.set_stream_data_offset = sof_set_stream_data_offset,
600600

601601
/* machine driver */
602602
.machine_select = bdw_machine_select,

sound/soc/sof/intel/byt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static const struct snd_sof_dsp_ops sof_byt_ops = {
250250
.get_window_offset = atom_get_window_offset,
251251

252252
.ipc_msg_data = sof_ipc_msg_data,
253-
.ipc_pcm_params = sof_ipc_pcm_params,
253+
.set_stream_data_offset = sof_set_stream_data_offset,
254254

255255
/* machine driver */
256256
.machine_select = atom_machine_select,
@@ -332,7 +332,7 @@ static const struct snd_sof_dsp_ops sof_cht_ops = {
332332
.get_window_offset = atom_get_window_offset,
333333

334334
.ipc_msg_data = sof_ipc_msg_data,
335-
.ipc_pcm_params = sof_ipc_pcm_params,
335+
.set_stream_data_offset = sof_set_stream_data_offset,
336336

337337
/* machine driver */
338338
.machine_select = atom_machine_select,

sound/soc/sof/intel/cnl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
274274
.get_window_offset = hda_dsp_ipc_get_window_offset,
275275

276276
.ipc_msg_data = hda_ipc_msg_data,
277-
.ipc_pcm_params = hda_ipc_pcm_params,
277+
.set_stream_data_offset = hda_set_stream_data_offset,
278278

279279
/* machine driver */
280280
.machine_select = hda_machine_select,

sound/soc/sof/intel/hda-ipc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,12 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,
267267
return 0;
268268
}
269269

270-
int hda_ipc_pcm_params(struct snd_sof_dev *sdev,
271-
struct snd_pcm_substream *substream,
272-
const struct sof_ipc_pcm_params_reply *reply)
270+
int hda_set_stream_data_offset(struct snd_sof_dev *sdev,
271+
struct snd_pcm_substream *substream,
272+
size_t posn_offset)
273273
{
274274
struct hdac_stream *hstream = substream->runtime->private_data;
275275
struct sof_intel_hda_stream *hda_stream;
276-
/* validate offset */
277-
size_t posn_offset = reply->posn_offset;
278276

279277
hda_stream = container_of(hstream, struct sof_intel_hda_stream,
280278
hext_stream.hstream);

0 commit comments

Comments
 (0)