Make the SOF pcm_hw_params DSP op IPC agnostic
cover Make the SOF pcm_hw_params DSP op IPC agnostic
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.
Peter Ujfalusi (10):
ASoC: SOF: sof-priv: Remove stale snd_sof_ipc_stream_pcm_params()
declaration
ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral
ASoC: SOF: pcm: Remove sof_pcm_dsp_params() wrapper
ASoC: SOF: Introduce optional callback to configure stream data offset
ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional
ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()
ASoC: SOF: Intel: hda-ipc: Add hda_set_stream_data_offset()
ASoC: SOF: Intel: Convert to use the generic set_stream_data_offset
ops
ASoC: SOF: imx: Convert to use the generic set_stream_data_offset ops
ASoC: SOF: Remove ipc_pcm_params() ops
sound/soc/sof/amd/acp-pcm.c | 8 ++++--- sound/soc/sof/amd/acp.h | 3 ++- sound/soc/sof/core.c | 3 +-- sound/soc/sof/imx/imx8.c | 4 ++-- sound/soc/sof/imx/imx8m.c | 2 +- sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/bdw.c | 2 +- sound/soc/sof/intel/byt.c | 4 ++-- sound/soc/sof/intel/cnl.c | 2 +- sound/soc/sof/intel/hda-ipc.c | 8 +++---- sound/soc/sof/intel/hda-pcm.c | 18 ++++---------- sound/soc/sof/intel/hda.h | 8 +++---- sound/soc/sof/intel/icl.c | 2 +- sound/soc/sof/intel/pci-tng.c | 2 +- sound/soc/sof/intel/tgl.c | 2 +- sound/soc/sof/ops.h | 21 +++++++++------- sound/soc/sof/pcm.c | 45 ++++++++++++++++++++--------------- sound/soc/sof/sof-priv.h | 33 +++++++++++++++++-------- sound/soc/sof/stream-ipc.c | 9 ++++--- 19 files changed, 95 insertions(+), 83 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/10 ASoC: SOF: sof-priv: Remove stale snd_sof_ipc_stream_pcm_params() declaration
From: Peter Ujfalusi <[email protected]>
The implementation for snd_sof_ipc_stream_pcm_params() does not exist, remove it from the header file.
--- sound/soc/sof/sof-priv.h | 2 -- 1 file changed, 2 deletions(-)
sound/soc/sof/sof-priv.h +0 -2
@@ -520,8 +520,6 @@ void snd_sof_ipc_free(struct snd_sof_dev *sdev);void snd_sof_ipc_get_reply (struct snd_sof_dev *sdev);void snd_sof_ipc_reply (struct snd_sof_dev *sdev,u32 msg_id);void snd_sof_ipc_msgs_rx (struct snd_sof_dev *sdev); -int snd_sof_ipc_stream_pcm_params (struct snd_sof_dev *sdev, -struct sof_ipc_pcm_params *params);int snd_sof_ipc_valid (struct snd_sof_dev *sdev); int sof_ipc_tx_message(struct snd_sof_ipc *ipc, u32 header, void *msg_data, size_t msg_bytes, void *reply_data,
Signature · 1 line
2.25.1
PATCH 2/10 ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Do not send IPC structure directly via pcm_hw_params to make it IPC agnostic.
A new struct is created to retrieve the needed platform parameters and if there is a need it can be extended with new options.
--- sound/soc/sof/amd/acp-pcm.c | 8 +++++--- sound/soc/sof/amd/acp.h | 3 ++- sound/soc/sof/intel/hda-pcm.c | 18 ++++-------------- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/ops.h | 6 +++--- sound/soc/sof/pcm.c | 21 ++++++++++++++++++++- sound/soc/sof/sof-priv.h | 17 ++++++++++++++++- 7 files changed, 51 insertions(+), 24 deletions(-)
sound/soc/sof/amd/acp-pcm.c +5 -3
@@ -17,7 +17,8 @@#include "acp-dsp-offset.h" int acp_pcm_hw_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream, -struct snd_pcm_hw_params *params,struct sof_ipc_stream_params *ipc_params) +struct snd_pcm_hw_params *params, +struct snd_sof_platform_stream_params *platform_params) {struct snd_pcm_runtime *runtime = substream->runtime;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 *substrreturn ret; } - ipc_params->buffer.phy_addr = stream->reg_offset; - ipc_params->stream_tag = stream->stream_tag; + platform_params->use_phy_address = true; + platform_params->phy_addr = stream->reg_offset; + platform_params->stream_tag = stream->stream_tag;/* write buffer size of stream in scratch memory */
sound/soc/sof/amd/acp.h +2 -1
@@ -201,7 +201,8 @@ int acp_dsp_stream_put(struct snd_sof_dev *sdev, struct acp_dsp_stream *acp_streint acp_pcm_open (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream);int acp_pcm_close (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream);int acp_pcm_hw_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream, -struct snd_pcm_hw_params *params,struct sof_ipc_stream_params *ipc_params); +struct snd_pcm_hw_params *params, +struct snd_sof_platform_stream_params *platform_params);extern const struct snd_sof_dsp_ops sof_renoir_ops;
sound/soc/sof/intel/hda-pcm.c +4 -14
@@ -93,13 +93,12 @@ u32 hda_dsp_get_bits(struct snd_sof_dev *sdev, int sample_bits)int hda_dsp_pcm_hw_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params, -struct sof_ipc_stream_params *ipc_params) +struct snd_sof_platform_stream_params *platform_params) {struct hdac_stream *hstream = substream->runtime->private_data;struct hdac_ext_stream *hext_stream =stream_to_hdac_ext_stream (hstream);struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;struct snd_dma_buffer *dmab; -struct sof_ipc_fw_version *v = &sdev->fw_ready.version;int ret;u32 size, rate, bits;
@@ -130,19 +129,10 @@ int hda_dsp_pcm_hw_params(struct snd_sof_dev *sdev,else hda_dsp_stream_spib_config (sdev, hext_stream,HDA_DSP_SPIB_DISABLE ,0 ); -/* update no_stream_position flag for ipc params */ -if (hda && hda->no_ipc_position) { -/* For older ABIs set host_period_bytes to zero to inform -* FW we don't want position updates. Newer versions use -* no_stream_position for this purpose. -*/ -if (v->abi_version <SOF_ABI_VER (3 ,10 ,0 )) - ipc_params->host_period_bytes =0 ; -else - ipc_params->no_stream_position =1 ; - } +if (hda) + platform_params->no_ipc_position = hda->no_ipc_position; - ipc_params->stream_tag = hstream->stream_tag; + platform_params->stream_tag = hstream->stream_tag;return 0 ; }
sound/soc/sof/intel/hda.h +1 -1
@@ -524,7 +524,7 @@ int hda_dsp_pcm_close(struct snd_sof_dev *sdev,int hda_dsp_pcm_hw_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params, -struct sof_ipc_stream_params *ipc_params); +struct snd_sof_platform_stream_params *platform_params);int hda_dsp_stream_hw_free (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream); int hda_dsp_pcm_trigger(struct snd_sof_dev *sdev,
sound/soc/sof/ops.h +3 -3
@@ -420,11 +420,11 @@ static inline int snd_sof_pcm_platform_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, - struct sof_ipc_stream_params *ipc_params) + struct snd_sof_platform_stream_params *platform_params) { if (sof_ops(sdev) && sof_ops(sdev)->pcm_hw_params) - return sof_ops(sdev)->pcm_hw_params(sdev, substream, - params, ipc_params); + return sof_ops(sdev)->pcm_hw_params(sdev, substream, params, + platform_params);return 0 ; }
sound/soc/sof/pcm.c +20 -1
@@ -162,6 +162,8 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,struct snd_soc_pcm_runtime *rtd =asoc_substream_to_rtd (substream);struct snd_pcm_runtime *runtime = substream->runtime;struct snd_sof_dev *sdev =snd_soc_component_get_drvdata (component); +struct snd_sof_platform_stream_params platform_params = {0 }; +struct sof_ipc_fw_version *v = &sdev->fw_ready.version;struct snd_sof_pcm *spcm;struct sof_ipc_pcm_params pcm;struct sof_ipc_pcm_params_reply ipc_params_reply;
@@ -242,12 +244,29 @@ static int sof_pcm_hw_params(struct snd_soc_component *component, ret =snd_sof_pcm_platform_hw_params (sdev, substream, params, - &pcm.params); + &platform_params);if (ret <0 ) {dev_err (component->dev,"error: platform hw params failed\n" );return ret; } +/* Update the IPC message with information from the platform */ + pcm.params.stream_tag = platform_params.stream_tag; + +if (platform_params.use_phy_address) + pcm.params.buffer.phy_addr = platform_params.phy_addr; + +if (platform_params.no_ipc_position) { +/* For older ABIs set host_period_bytes to zero to inform +* FW we don't want position updates. Newer versions use +* no_stream_position for this purpose. +*/ +if (v->abi_version <SOF_ABI_VER (3 ,10 ,0 )) + pcm.params.host_period_bytes =0 ; +else + pcm.params.no_stream_position =1 ; + } +dev_dbg (component->dev,"stream_tag %d" , pcm.params.stream_tag);/* if this is a repeated hw_params without hw_free, skip setting up widgets */
sound/soc/sof/sof-priv.h +16 -1
@@ -105,6 +105,21 @@ struct snd_soc_tplg_ops;struct snd_soc_component ;struct snd_sof_pdata ; +/** +* struct snd_sof_platform_stream_params - platform dependent stream parameters +* @stream_tag: Stream tag to use +* @use_phy_addr: Use the provided @phy_addr for configuration +* @phy_addr: Platform dependent address to be used, if @use_phy_addr +* is true +* @no_ipc_position: Disable position update IPC from firmware +*/ +struct snd_sof_platform_stream_params { +u16 stream_tag; +bool use_phy_address; +u32 phy_addr; +bool no_ipc_position; +}; +/* * SOF DSP HW abstraction operations. * Used to abstract DSP HW architecture and any IO busses between host CPU
@@ -183,7 +198,7 @@ struct snd_sof_dsp_ops {int (*pcm_hw_params)(struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params, -struct sof_ipc_stream_params *ipc_params);/* optional */ +struct snd_sof_platform_stream_params *platform_params);/* optional */ /* host stream hw_free */ int (*pcm_hw_free)(struct snd_sof_dev *sdev,
Signature · 1 line
2.25.1
PATCH 3/10 ASoC: SOF: pcm: Remove sof_pcm_dsp_params() wrapper
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Call directly for snd_sof_ipc_pcm_params() from sof_pcm_hw_params() and remove the wrapper for it.
--- sound/soc/sof/pcm.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-)
sound/soc/sof/pcm.c +5 -18
@@ -36,22 +36,6 @@ static int create_page_table(struct snd_soc_component *component, spcm->stream[stream].page_table.area, size); } -static int sof_pcm_dsp_params (struct snd_sof_pcm *spcm,struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) -{ -struct snd_soc_component *scomp = spcm->scomp; -struct snd_sof_dev *sdev =snd_soc_component_get_drvdata (scomp); - -/* validate offset */ -int ret =snd_sof_ipc_pcm_params (sdev, substream, reply); - -if (ret <0 ) -dev_err (scomp->dev,"error: got wrong reply for PCM %d\n" , - spcm->pcm.pcm_id); - -return ret; -} -/* * sof pcm period elapse work */
@@ -285,9 +269,12 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,return ret; } - ret =sof_pcm_dsp_params (spcm, substream, &ipc_params_reply); -if (ret <0 ) + ret =snd_sof_ipc_pcm_params (sdev, substream, &ipc_params_reply); +if (ret <0 ) { +dev_err (component->dev,"%s: got wrong reply for PCM %d\n" , + __func__, spcm->pcm.pcm_id);return ret; + } spcm->prepared[substream->stream] = true;
Signature · 1 line
2.25.1
PATCH 4/10 ASoC: SOF: Introduce optional callback to configure stream data offset
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Each running audio stream's data have distinct start offset within the stream mailbox area from/to where the host can read/write.
Instead of using the struct sof_ipc_pcm_params_reply to configure this offset, add an optional callback which is IPC agnostic.
--- sound/soc/sof/ops.h | 13 +++++++++++++ sound/soc/sof/pcm.c | 8 ++++++++ sound/soc/sof/sof-priv.h | 5 +++++ 3 files changed, 26 insertions(+)
sound/soc/sof/ops.h +13 -0
@@ -476,6 +476,19 @@ snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev,return sof_ops (sdev)->ipc_pcm_params (sdev, substream, reply); } +/* host side configuration of the stream's data offset in stream mailbox area */ +static inline int +snd_sof_set_stream_data_offset (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset) +{ +if (sof_ops (sdev) &&sof_ops (sdev)->set_stream_data_offset) +return sof_ops (sdev)->set_stream_data_offset (sdev, substream, + posn_offset); + +return 0 ; +} +/* host stream pointer */ static inline snd_pcm_uframes_t snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev,
sound/soc/sof/pcm.c +8 -0
@@ -276,6 +276,14 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,return ret; } + ret =snd_sof_set_stream_data_offset (sdev, substream, + ipc_params_reply.posn_offset); +if (ret <0 ) { +dev_err (component->dev,"%s: invalid stream data offset for PCM %d\n" , + __func__, spcm->pcm.pcm_id); +return ret; + } + spcm->prepared[substream->stream] = true;/* save pcm hw_params */
sound/soc/sof/sof-priv.h +5 -0
@@ -226,6 +226,11 @@ struct snd_sof_dsp_ops {struct snd_pcm_substream *substream, const struct sof_ipc_pcm_params_reply *reply); /* mandatory */ +/* host side configuration of the stream's data offset in stream mailbox area */ +int (*set_stream_data_offset)(struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset);/* optional */ +/* pre/post firmware run */ int (*pre_fw_run)(struct snd_sof_dev *sof_dev);/* optional */ int (*post_fw_run)(struct snd_sof_dev *sof_dev);/* optional */
Signature · 1 line
2.25.1
PATCH 5/10 ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
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.
--- sound/soc/sof/core.c | 3 +-- sound/soc/sof/ops.h | 5 ++++- sound/soc/sof/sof-priv.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
sound/soc/sof/core.c +1 -2
@@ -361,8 +361,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)if (!sof_ops (sdev) || !sof_ops (sdev)->probe || !sof_ops (sdev)->run || !sof_ops (sdev)->block_read || !sof_ops (sdev)->block_write || !sof_ops (sdev)->send_msg || !sof_ops (sdev)->load_firmware || - !sof_ops (sdev)->ipc_msg_data || !sof_ops (sdev)->ipc_pcm_params || - !sof_ops (sdev)->fw_ready) { + !sof_ops (sdev)->ipc_msg_data || !sof_ops (sdev)->fw_ready) {dev_err (dev,"error: missing mandatory ops\n" );return -EINVAL ; }
sound/soc/sof/ops.h +4 -1
@@ -473,7 +473,10 @@ snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream, const struct sof_ipc_pcm_params_reply *reply) { - return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply); + if (sof_ops(sdev) && sof_ops(sdev)->ipc_pcm_params) + return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply); + +return 0 ; }/* host side configuration of the stream's data offset in stream mailbox area */
sound/soc/sof/sof-priv.h +1 -1
@@ -224,7 +224,7 @@ struct snd_sof_dsp_ops {/* host configure DSP HW parameters */ int (*ipc_pcm_params)(struct snd_sof_dev *sdev,struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply);/* mandatory */ +const struct sof_ipc_pcm_params_reply *reply);/* optional */ /* host side configuration of the stream's data offset in stream mailbox area */ int (*set_stream_data_offset)(struct snd_sof_dev *sdev,
Signature · 1 line
2.25.1
PATCH 6/10 ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Add implementation for the generic set_stream_data_offset() callback in core to be used by platforms.
Convert the sof_ipc_pcm_params() to a wrapper for the new function.
--- sound/soc/sof/sof-priv.h | 3 +++ sound/soc/sof/stream-ipc.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-)
sound/soc/sof/sof-priv.h +3 -0
@@ -626,6 +626,9 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev,int sof_ipc_pcm_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,const struct sof_ipc_pcm_params_reply *reply); +int sof_set_stream_data_offset (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset);int sof_stream_pcm_open (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream);
sound/soc/sof/stream-ipc.c +11 -4
@@ -45,12 +45,11 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev, }EXPORT_SYMBOL (sof_ipc_msg_data); -int sof_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) +int sof_set_stream_data_offset (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset) {struct sof_stream *stream = substream->runtime->private_data; -size_t posn_offset = reply->posn_offset;/* check if offset is overflow or it is not aligned */ if (posn_offset > sdev->stream_box.size ||
@@ -64,6 +63,14 @@ int sof_ipc_pcm_params(struct snd_sof_dev *sdev,return 0 ; } +EXPORT_SYMBOL (sof_set_stream_data_offset); + +int sof_ipc_pcm_params (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +const struct sof_ipc_pcm_params_reply *reply) +{ +return sof_set_stream_data_offset (sdev, substream, reply->posn_offset); +}EXPORT_SYMBOL (sof_ipc_pcm_params); int sof_stream_pcm_open(struct snd_sof_dev *sdev,
Signature · 1 line
2.25.1
PATCH 7/10 ASoC: SOF: Intel: hda-ipc: Add hda_set_stream_data_offset()
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Add implementation for the generic set_stream_data_offset() callback to be used by HDA platforms.
Convert the hda_ipc_pcm_params() to a wrapper for the new function.
--- sound/soc/sof/intel/hda-ipc.c | 15 ++++++++++----- sound/soc/sof/intel/hda.h | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-)
sound/soc/sof/intel/hda-ipc.c +10 -5
@@ -267,14 +267,12 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,return 0 ; } -int hda_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) +int hda_set_stream_data_offset (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset) {struct hdac_stream *hstream = substream->runtime->private_data;struct sof_intel_hda_stream *hda_stream; -/* validate offset */ -size_t posn_offset = reply->posn_offset; hda_stream = container_of(hstream, struct sof_intel_hda_stream, hext_stream.hstream);
@@ -291,3 +289,10 @@ int hda_ipc_pcm_params(struct snd_sof_dev *sdev,return 0 ; } + +int hda_ipc_pcm_params (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +const struct sof_ipc_pcm_params_reply *reply) +{ +return hda_set_stream_data_offset (sdev, substream, reply->posn_offset); +}
sound/soc/sof/intel/hda.h +3 -0
@@ -569,6 +569,9 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,int hda_ipc_pcm_params (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,const struct sof_ipc_pcm_params_reply *reply); +int hda_set_stream_data_offset (struct snd_sof_dev *sdev, +struct snd_pcm_substream *substream, +size_t posn_offset);/* * DSP IPC Operations.
Signature · 1 line
2.25.1
PATCH 8/10 ASoC: SOF: Intel: Convert to use the generic set_stream_data_offset ops
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Switch from the IPC dependent ipc_pcm_params() ops to the IPC neutral set_stream_data_offset().
Remove the no longer used hda_ipc_pcm_params() function as well.
--- sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/bdw.c | 2 +- sound/soc/sof/intel/byt.c | 4 ++-- sound/soc/sof/intel/cnl.c | 2 +- sound/soc/sof/intel/hda-ipc.c | 7 ------- sound/soc/sof/intel/hda.h | 3 --- sound/soc/sof/intel/icl.c | 2 +- sound/soc/sof/intel/pci-tng.c | 2 +- sound/soc/sof/intel/tgl.c | 2 +- 9 files changed, 8 insertions(+), 18 deletions(-)
sound/soc/sof/intel/apl.c +1 -1
@@ -56,7 +56,7 @@ const struct snd_sof_dsp_ops sof_apl_ops = { .get_window_offset = hda_dsp_ipc_get_window_offset, .ipc_msg_data = hda_ipc_msg_data, - .ipc_pcm_params = hda_ipc_pcm_params, + .set_stream_data_offset = hda_set_stream_data_offset,/* machine driver */ .machine_select = hda_machine_select,
sound/soc/sof/intel/bdw.c +1 -1
@@ -596,7 +596,7 @@ static const struct snd_sof_dsp_ops sof_bdw_ops = { .get_window_offset = bdw_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* machine driver */ .machine_select = bdw_machine_select,
sound/soc/sof/intel/byt.c +2 -2
@@ -250,7 +250,7 @@ static const struct snd_sof_dsp_ops sof_byt_ops = { .get_window_offset = atom_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* machine driver */ .machine_select = atom_machine_select,
@@ -332,7 +332,7 @@ static const struct snd_sof_dsp_ops sof_cht_ops = { .get_window_offset = atom_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* machine driver */ .machine_select = atom_machine_select,
sound/soc/sof/intel/cnl.c +1 -1
@@ -274,7 +274,7 @@ const struct snd_sof_dsp_ops sof_cnl_ops = { .get_window_offset = hda_dsp_ipc_get_window_offset, .ipc_msg_data = hda_ipc_msg_data, - .ipc_pcm_params = hda_ipc_pcm_params, + .set_stream_data_offset = hda_set_stream_data_offset,/* machine driver */ .machine_select = hda_machine_select,
sound/soc/sof/intel/hda-ipc.c +0 -7
@@ -289,10 +289,3 @@ int hda_set_stream_data_offset(struct snd_sof_dev *sdev,return 0 ; } - -int hda_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) -{ -return hda_set_stream_data_offset (sdev, substream, reply->posn_offset); -}
sound/soc/sof/intel/hda.h +0 -3
@@ -566,9 +566,6 @@ int hda_dsp_stream_spib_config(struct snd_sof_dev *sdev,int hda_ipc_msg_data (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,void *p,size_t sz); -int hda_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply);int hda_set_stream_data_offset (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,size_t posn_offset);
sound/soc/sof/intel/icl.c +1 -1
@@ -118,7 +118,7 @@ const struct snd_sof_dsp_ops sof_icl_ops = { .get_window_offset = hda_dsp_ipc_get_window_offset, .ipc_msg_data = hda_ipc_msg_data, - .ipc_pcm_params = hda_ipc_pcm_params, + .set_stream_data_offset = hda_set_stream_data_offset,/* machine driver */ .machine_select = hda_machine_select,
sound/soc/sof/intel/pci-tng.c +1 -1
@@ -165,7 +165,7 @@ const struct snd_sof_dsp_ops sof_tng_ops = { .get_window_offset = atom_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* machine driver */ .machine_select = atom_machine_select,
sound/soc/sof/intel/tgl.c +1 -1
@@ -91,7 +91,7 @@ const struct snd_sof_dsp_ops sof_tgl_ops = { .get_window_offset = hda_dsp_ipc_get_window_offset, .ipc_msg_data = hda_ipc_msg_data, - .ipc_pcm_params = hda_ipc_pcm_params, + .set_stream_data_offset = hda_set_stream_data_offset,/* machine driver */ .machine_select = hda_machine_select,
Signature · 1 line
2.25.1
PATCH 9/10 ASoC: SOF: imx: Convert to use the generic set_stream_data_offset ops
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
Switch from the IPC dependent ipc_pcm_params() ops to the IPC neutral set_stream_data_offset().
--- sound/soc/sof/imx/imx8.c | 4 ++-- sound/soc/sof/imx/imx8m.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/sof/imx/imx8.c +2 -2
@@ -509,7 +509,7 @@ static const struct snd_sof_dsp_ops sof_imx8_ops = { .get_window_offset = imx8_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* module loading */ .load_module = snd_sof_parse_module_memcpy,
@@ -572,7 +572,7 @@ static const struct snd_sof_dsp_ops sof_imx8x_ops = { .get_window_offset = imx8_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* module loading */ .load_module = snd_sof_parse_module_memcpy,
sound/soc/sof/imx/imx8m.c +1 -1
@@ -435,7 +435,7 @@ static const struct snd_sof_dsp_ops sof_imx8m_ops = { .get_window_offset = imx8m_get_window_offset, .ipc_msg_data = sof_ipc_msg_data, - .ipc_pcm_params = sof_ipc_pcm_params, + .set_stream_data_offset = sof_set_stream_data_offset,/* module loading */ .load_module = snd_sof_parse_module_memcpy,
Signature · 1 line
2.25.1
PATCH 10/10 ASoC: SOF: Remove ipc_pcm_params() ops
In reply to Ranjani SridharanFrom: Peter Ujfalusi <[email protected]>
All users have been converted to use the IPC agnostic set_stream_data_offsett()
Remove all code related to the old API.
--- sound/soc/sof/ops.h | 13 ------------- sound/soc/sof/pcm.c | 7 ------- sound/soc/sof/sof-priv.h | 8 -------- sound/soc/sof/stream-ipc.c | 8 -------- 4 files changed, 36 deletions(-)
sound/soc/sof/ops.h +0 -13
@@ -466,19 +466,6 @@ static inline int snd_sof_ipc_msg_data(struct snd_sof_dev *sdev, {return sof_ops (sdev)->ipc_msg_data (sdev, substream, p, sz); } - -/* host configure DSP HW parameters */ -static inline int -snd_sof_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) -{ -if (sof_ops (sdev) &&sof_ops (sdev)->ipc_pcm_params) -return sof_ops (sdev)->ipc_pcm_params (sdev, substream, reply); - -return 0 ; -} -/* host side configuration of the stream's data offset in stream mailbox area */ static inline int snd_sof_set_stream_data_offset(struct snd_sof_dev *sdev,
sound/soc/sof/pcm.c +0 -7
@@ -269,13 +269,6 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,return ret; } - ret =snd_sof_ipc_pcm_params (sdev, substream, &ipc_params_reply); -if (ret <0 ) { -dev_err (component->dev,"%s: got wrong reply for PCM %d\n" , - __func__, spcm->pcm.pcm_id); -return ret; - } - ret =snd_sof_set_stream_data_offset (sdev, substream, ipc_params_reply.posn_offset);if (ret <0 ) {
sound/soc/sof/sof-priv.h +0 -8
@@ -221,11 +221,6 @@ struct snd_sof_dsp_ops {struct snd_pcm_substream *substream, void *p, size_t sz); /* mandatory */ -/* host configure DSP HW parameters */ -int (*ipc_pcm_params)(struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply);/* optional */ -/* host side configuration of the stream's data offset in stream mailbox area */ int (*set_stream_data_offset)(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
@@ -623,9 +618,6 @@ int sof_fw_ready(struct snd_sof_dev *sdev, u32 msg_id);int sof_ipc_msg_data (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,void *p,size_t sz); -int sof_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply);int sof_set_stream_data_offset (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream,size_t posn_offset);
sound/soc/sof/stream-ipc.c +0 -8
@@ -65,14 +65,6 @@ int sof_set_stream_data_offset(struct snd_sof_dev *sdev, }EXPORT_SYMBOL (sof_set_stream_data_offset); -int sof_ipc_pcm_params (struct snd_sof_dev *sdev, -struct snd_pcm_substream *substream, -const struct sof_ipc_pcm_params_reply *reply) -{ -return sof_set_stream_data_offset (sdev, substream, reply->posn_offset); -} -EXPORT_SYMBOL (sof_ipc_pcm_params); -int sof_stream_pcm_open (struct snd_sof_dev *sdev,struct snd_pcm_substream *substream) {
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 18 lines · Ranjani Sridharan
In preparation for supporting the newly introduced IPC version in the SOF firmware, this patchset adds the changes required to make the
pcm_hw_paramsDSP op IPC agnostic.Peter Ujfalusi (10):
ASoC: SOF: sof-priv: Remove stalesnd_sof_ipc_stream_pcm_params()
declaration
ASoC: SOF: Makepcm_hw_paramssnd_sof_dsp_opscallback IPC neutral
ASoC: SOF: pcm: Removesof_pcm_dsp_params()wrapper
ASoC: SOF: Introduce optional callback to configure stream data offset
ASoC: SOF: Marksnd_sof_dsp_ops.ipc_pcm_params()callback optional
ASoC: SOF: stream-ipc: Addsof_set_stream_data_offset()
ASoC: SOF: Intel: hda-ipc: Addhda_set_stream_data_offset()
ASoC: SOF: Intel: Convert to use the genericset_stream_data_offset
ops
ASoC: SOF: imx: Convert to use the genericset_stream_data_offsetops
ASoC: SOF: Removeipc_pcm_params()ops
Quoted 1 line
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[01/10] ASoC: SOF: sof-priv: Remove stale snd_sof_ipc_stream_pcm_params() declaration
commit: d7bc6ddef016d851cb0ff97ae16ac98d5f3c85ee
[02/10] ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral
commit: 31f60a0c943d6a7e84b06686b1ed86ddadf484fa
[03/10] ASoC: SOF: pcm: Remove sof_pcm_dsp_params() wrapper
commit: d1b1146fc708eff661c2becb9bf78374adde6db7
[04/10] ASoC: SOF: Introduce optional callback to configure stream data offset
commit: 757ce8103c9e5b83cf18a669fe38484b0be3cfaf
[05/10] ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional
commit: a6db22a68b0b2183184659d27c0a74df96f0d6d0
[06/10] ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()
commit: 9a0a809a5aaeb09458c5f0d26fac63c213b0adb6
[07/10] ASoC: SOF: Intel: hda-ipc: Add hda_set_stream_data_offset()
commit: 29e3aa0bb934e44c6ec0127cbe96983dc9b82b0e
[08/10] ASoC: SOF: Intel: Convert to use the generic set_stream_data_offset ops
commit: cf73363e4a55579e3131f5de38c3b7b70bb4d639
[09/10] ASoC: SOF: imx: Convert to use the generic set_stream_data_offset ops
commit: f0383aded3c6e61e044b90662bf99b3d850c5d90
[10/10] ASoC: SOF: Remove ipc_pcm_params() ops
commit: 00f19253633710877880ad062d6cee3c13deb9a5All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark