Skip to content

Commit 0b117e5

Browse files
committed
AMD SoundWire machine driver code refactor
Merge series from Vijendar Mukunda <[email protected]>: 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: thesofproject#5171
2 parents 2ed1a4a + 6d8348d commit 0b117e5

File tree

4 files changed

+354
-573
lines changed

4 files changed

+354
-573
lines changed

include/sound/soc_sdw_utils.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,27 @@ struct asoc_sdw_mc_private {
9393
int codec_info_list_count;
9494
};
9595

96+
struct asoc_sdw_endpoint {
97+
struct list_head list;
98+
99+
u32 link_mask;
100+
const char *codec_name;
101+
const char *name_prefix;
102+
bool include_sidecar;
103+
104+
struct asoc_sdw_codec_info *codec_info;
105+
const struct asoc_sdw_dai_info *dai_info;
106+
};
107+
108+
struct asoc_sdw_dailink {
109+
bool initialised;
110+
111+
u8 group_id;
112+
u32 link_mask[SNDRV_PCM_STREAM_LAST + 1];
113+
int num_devs[SNDRV_PCM_STREAM_LAST + 1];
114+
struct list_head endpoints;
115+
};
116+
96117
extern struct asoc_sdw_codec_info codec_info_list[];
97118
int asoc_sdw_get_codec_info_list_count(void);
98119

@@ -140,6 +161,16 @@ int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *d
140161
int (*init)(struct snd_soc_pcm_runtime *rtd),
141162
const struct snd_soc_ops *ops);
142163

164+
int asoc_sdw_count_sdw_endpoints(struct snd_soc_card *card, int *num_devs, int *num_ends);
165+
166+
struct asoc_sdw_dailink *asoc_sdw_find_dailink(struct asoc_sdw_dailink *dailinks,
167+
const struct snd_soc_acpi_endpoint *new);
168+
169+
int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
170+
struct asoc_sdw_dailink *soc_dais,
171+
struct asoc_sdw_endpoint *soc_ends,
172+
int *num_devs);
173+
143174
int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd);
144175

145176
/* DMIC support */

0 commit comments

Comments
 (0)