summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-09-13 18:59:45 +0300
committerMark Brown <broonie@kernel.org>2024-09-13 18:59:45 +0300
commit0b117e58409efce351f435618e2b6023804c0988 (patch)
tree781048703caaab0019ff71e72d152ddce3a5f91b /include
parent2ed1a4a5c0058dfd78f5037576d668a37d0ec609 (diff)
parent6d8348ddc56ed43ba39d1e8adda13299201f32ed (diff)
downloadlinux-0b117e58409efce351f435618e2b6023804c0988.tar.xz
AMD SoundWire machine driver code refactor
Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>: This patch series moves common Soundwire endpoint parsing and dai creation logic to common placeholder from Intel generic SoundWire machine driver code to make it generic. AMD SoundWire machine driver code is refactored to use these functions for SoundWire endpoint parsing and dai creation logic. Link: https://github.com/thesofproject/linux/pull/5171
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc_sdw_utils.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h
index e366b7968c2d..f68c1f193b3b 100644
--- a/include/sound/soc_sdw_utils.h
+++ b/include/sound/soc_sdw_utils.h
@@ -93,6 +93,27 @@ struct asoc_sdw_mc_private {
int codec_info_list_count;
};
+struct asoc_sdw_endpoint {
+ struct list_head list;
+
+ u32 link_mask;
+ const char *codec_name;
+ const char *name_prefix;
+ bool include_sidecar;
+
+ struct asoc_sdw_codec_info *codec_info;
+ const struct asoc_sdw_dai_info *dai_info;
+};
+
+struct asoc_sdw_dailink {
+ bool initialised;
+
+ u8 group_id;
+ u32 link_mask[SNDRV_PCM_STREAM_LAST + 1];
+ int num_devs[SNDRV_PCM_STREAM_LAST + 1];
+ struct list_head endpoints;
+};
+
extern struct asoc_sdw_codec_info codec_info_list[];
int asoc_sdw_get_codec_info_list_count(void);
@@ -140,6 +161,16 @@ int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *d
int (*init)(struct snd_soc_pcm_runtime *rtd),
const struct snd_soc_ops *ops);
+int asoc_sdw_count_sdw_endpoints(struct snd_soc_card *card, int *num_devs, int *num_ends);
+
+struct asoc_sdw_dailink *asoc_sdw_find_dailink(struct asoc_sdw_dailink *dailinks,
+ const struct snd_soc_acpi_endpoint *new);
+
+int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
+ struct asoc_sdw_dailink *soc_dais,
+ struct asoc_sdw_endpoint *soc_ends,
+ int *num_devs);
+
int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd);
/* DMIC support */