diff options
author | Chunxu Li <chunxu.li@mediatek.com> | 2022-07-15 11:59:03 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-07-18 15:45:16 +0300 |
commit | 0caf1120c58395108344d5df4e09359b67e95094 (patch) | |
tree | baeae5d6483fb4ff5899b2c478369d4056564207 /sound/soc/mediatek/common/mtk-dsp-sof-common.h | |
parent | c3fc63479e372747ffa99b4602f962d2862a13b3 (diff) | |
download | linux-0caf1120c58395108344d5df4e09359b67e95094.tar.xz |
ASoC: mediatek: mt8195: extract SOF common code
The functions related to SOF can be reused in different machine drivers,
such as mt8195 or mt8186, so extract the common code to avoid duplication.
Set mtk_soc_card_data which include machine private data and SOF private
data as card drvdata, then the difference between machine private can be
ignored such as mt8195_mt6359_priv or mt8186_mt6366_priv, at the same
time the SOF related code can be reused in different machine drivers.
Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220715085903.7796-1-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek/common/mtk-dsp-sof-common.h')
-rw-r--r-- | sound/soc/mediatek/common/mtk-dsp-sof-common.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.h b/sound/soc/mediatek/common/mtk-dsp-sof-common.h new file mode 100644 index 000000000000..dd38c4a93574 --- /dev/null +++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * mtk-dsp-sof-common.h -- MediaTek dsp sof common definition + * + * Copyright (c) 2022 MediaTek Inc. + * Author: Chunxu Li <chunxu.li@mediatek.com> + */ + +#ifndef _MTK_DSP_SOF_COMMON_H_ +#define _MTK_DSP_SOF_COMMON_H_ + +#include <sound/soc.h> + +struct sof_conn_stream { + const char *normal_link; + const char *sof_link; + const char *sof_dma; + int stream_dir; +}; + +struct mtk_sof_priv { + const struct sof_conn_stream *conn_streams; + int num_streams; + int (*sof_dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params); +}; + +int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params); +int mtk_sof_card_probe(struct snd_soc_card *card); +int mtk_sof_card_late_probe(struct snd_soc_card *card); +int mtk_sof_dailink_parse_of(struct snd_soc_card *card, struct device_node *np, + const char *propname, struct snd_soc_dai_link *pre_dai_links, + int pre_num_links); + +#endif |