summaryrefslogtreecommitdiff
path: root/include/linux/soundwire
diff options
context:
space:
mode:
authorRander Wang <rander.wang@linux.intel.com>2019-12-11 19:45:02 -0600
committerVinod Koul <vkoul@kernel.org>2019-12-12 09:17:06 +0530
commit4b206d34b92224496c42226c4b6d92719056c8b6 (patch)
tree11e16db0ce2f1c8c73a5c0f9966c1a38fe4d42e7 /include/linux/soundwire
parentf98f690fb03c2a8d21dfa31aa1042480cf6f7f9b (diff)
soundwire: intel: update stream callbacks for hwparams/free stream operations
The SoundWire DAIs for Intel platform are created in drivers/soundwire/intel.c, while the communication with the Intel DSP is all controlled in soc/sof/intel When the DAI status changes, a callback is used to bridge the gap between the two subsystems. The naming of the existing 'config_stream' callback does not map well with any of ALSA/ASoC concepts. This patch renames it as 'params_stream' to be more self-explanatory. A new 'free_stream' callback is added in case any resources allocated in the 'params_stream' stage need to be released. In the SOF implementation, this is used in the hw_free case to release the DMA channels over IPC. These two callbacks now rely on structures which expose the link_id and alh_stream_id (required by the firmware IPC), instead of a list of parameters. The 'void *' definitions are changed to use explicit types, as suggested on alsa-devel during earlier reviews. Signed-off-by: Rander Wang <rander.wang@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191212014507.28050-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/soundwire')
-rw-r--r--include/linux/soundwire/sdw_intel.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h
index 034eca8df748..3ccb38d48eef 100644
--- a/include/linux/soundwire/sdw_intel.h
+++ b/include/linux/soundwire/sdw_intel.h
@@ -5,14 +5,38 @@
#define __SDW_INTEL_H
/**
+ * struct sdw_intel_stream_params_data: configuration passed during
+ * the @params_stream callback, e.g. for interaction with DSP
+ * firmware.
+ */
+struct sdw_intel_stream_params_data {
+ struct snd_pcm_substream *substream;
+ struct snd_soc_dai *dai;
+ struct snd_pcm_hw_params *hw_params;
+ int link_id;
+ int alh_stream_id;
+};
+
+/**
+ * struct sdw_intel_stream_free_data: configuration passed during
+ * the @free_stream callback, e.g. for interaction with DSP
+ * firmware.
+ */
+struct sdw_intel_stream_free_data {
+ struct snd_pcm_substream *substream;
+ struct snd_soc_dai *dai;
+ int link_id;
+};
+
+/**
* struct sdw_intel_ops: Intel audio driver callback ops
*
- * @config_stream: configure the stream with the hw_params
- * the first argument containing the context is mandatory
*/
struct sdw_intel_ops {
- int (*config_stream)(void *arg, void *substream,
- void *dai, void *hw_params, int stream_num);
+ int (*params_stream)(struct device *dev,
+ struct sdw_intel_stream_params_data *params_data);
+ int (*free_stream)(struct device *dev,
+ struct sdw_intel_stream_free_data *free_data);
};
/**