1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * mtk-soundcard-driver.h -- MediaTek soundc 3 * mtk-soundcard-driver.h -- MediaTek soundcard driver common definition 4 * 4 * 5 * Copyright (c) 2022 MediaTek Inc. 5 * Copyright (c) 2022 MediaTek Inc. 6 * Author: Trevor Wu <trevor.wu@mediatek.com> 6 * Author: Trevor Wu <trevor.wu@mediatek.com> 7 */ 7 */ 8 8 9 #ifndef _MTK_SOUNDCARD_DRIVER_H_ 9 #ifndef _MTK_SOUNDCARD_DRIVER_H_ 10 #define _MTK_SOUNDCARD_DRIVER_H_ 10 #define _MTK_SOUNDCARD_DRIVER_H_ 11 11 12 struct mtk_sof_priv; 12 struct mtk_sof_priv; 13 struct mtk_soc_card_data; 13 struct mtk_soc_card_data; 14 struct snd_pcm_hw_constraint_list; 14 struct snd_pcm_hw_constraint_list; 15 15 16 enum mtk_pcm_constraint_type { 16 enum mtk_pcm_constraint_type { 17 MTK_CONSTRAINT_PLAYBACK, 17 MTK_CONSTRAINT_PLAYBACK, 18 MTK_CONSTRAINT_CAPTURE, 18 MTK_CONSTRAINT_CAPTURE, 19 MTK_CONSTRAINT_HDMIDP, 19 MTK_CONSTRAINT_HDMIDP, 20 MTK_CONSTRAINT_MAX 20 MTK_CONSTRAINT_MAX 21 }; 21 }; 22 22 23 struct mtk_pcm_constraints_data { 23 struct mtk_pcm_constraints_data { 24 const struct snd_pcm_hw_constraint_lis 24 const struct snd_pcm_hw_constraint_list *channels; 25 const struct snd_pcm_hw_constraint_lis 25 const struct snd_pcm_hw_constraint_list *rates; 26 }; 26 }; 27 27 28 struct mtk_platform_card_data { 28 struct mtk_platform_card_data { 29 struct snd_soc_card *card; 29 struct snd_soc_card *card; 30 struct snd_soc_jack *jacks; 30 struct snd_soc_jack *jacks; 31 const struct mtk_pcm_constraints_data 31 const struct mtk_pcm_constraints_data *pcm_constraints; 32 u8 num_jacks; 32 u8 num_jacks; 33 u8 num_pcm_constraints; 33 u8 num_pcm_constraints; 34 u8 flags; 34 u8 flags; 35 }; 35 }; 36 36 37 struct mtk_soundcard_pdata { 37 struct mtk_soundcard_pdata { 38 const char *card_name; 38 const char *card_name; 39 struct mtk_platform_card_data *card_da 39 struct mtk_platform_card_data *card_data; 40 const struct mtk_sof_priv *sof_priv; 40 const struct mtk_sof_priv *sof_priv; 41 41 42 int (*soc_probe)(struct mtk_soc_card_d 42 int (*soc_probe)(struct mtk_soc_card_data *card_data, bool legacy); 43 }; 43 }; 44 44 45 /* Common playback/capture card startup ops */ 45 /* Common playback/capture card startup ops */ 46 extern const struct snd_soc_ops mtk_soundcard_ 46 extern const struct snd_soc_ops mtk_soundcard_common_playback_ops; 47 extern const struct snd_soc_ops mtk_soundcard_ 47 extern const struct snd_soc_ops mtk_soundcard_common_capture_ops; 48 48 49 /* Exported for custom/extended soundcard star 49 /* Exported for custom/extended soundcard startup ops */ 50 int mtk_soundcard_startup(struct snd_pcm_subst 50 int mtk_soundcard_startup(struct snd_pcm_substream *substream, 51 enum mtk_pcm_constra 51 enum mtk_pcm_constraint_type ctype); 52 52 53 int parse_dai_link_info(struct snd_soc_card *c 53 int parse_dai_link_info(struct snd_soc_card *card); 54 void clean_card_reference(struct snd_soc_card 54 void clean_card_reference(struct snd_soc_card *card); 55 int mtk_soundcard_common_probe(struct platform 55 int mtk_soundcard_common_probe(struct platform_device *pdev); 56 #endif 56 #endif 57 57
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.