xref: /openbmc/linux/sound/soc/amd/acp/acp-mach.h (revision ac91c8c8)
1d4c750f2SAjit Kumar Pandey /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2d4c750f2SAjit Kumar Pandey /*
3d4c750f2SAjit Kumar Pandey  * This file is provided under a dual BSD/GPLv2 license. When using or
4d4c750f2SAjit Kumar Pandey  * redistributing this file, you may do so under either license.
5d4c750f2SAjit Kumar Pandey  *
6d4c750f2SAjit Kumar Pandey  * Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
7d4c750f2SAjit Kumar Pandey  *
8d4c750f2SAjit Kumar Pandey  * Author: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
9d4c750f2SAjit Kumar Pandey  */
10d4c750f2SAjit Kumar Pandey #ifndef __ACP_MACH_H
11d4c750f2SAjit Kumar Pandey #define __ACP_MACH_H
12d4c750f2SAjit Kumar Pandey 
13d4c750f2SAjit Kumar Pandey #include <sound/core.h>
14d4c750f2SAjit Kumar Pandey #include <sound/jack.h>
15d4c750f2SAjit Kumar Pandey #include <sound/pcm_params.h>
16d4c750f2SAjit Kumar Pandey #include <sound/soc-dapm.h>
17d4c750f2SAjit Kumar Pandey #include <linux/input.h>
18d4c750f2SAjit Kumar Pandey #include <linux/module.h>
19d4c750f2SAjit Kumar Pandey #include <sound/soc.h>
20d4c750f2SAjit Kumar Pandey 
2120055300SVenkata Prasad Potturu #define TDM_CHANNELS	8
2220055300SVenkata Prasad Potturu 
23d4c750f2SAjit Kumar Pandey enum be_id {
24d4c750f2SAjit Kumar Pandey 	HEADSET_BE_ID = 0,
25d4c750f2SAjit Kumar Pandey 	AMP_BE_ID,
26d4c750f2SAjit Kumar Pandey 	DMIC_BE_ID,
27d4c750f2SAjit Kumar Pandey };
28d4c750f2SAjit Kumar Pandey 
29d4c750f2SAjit Kumar Pandey enum cpu_endpoints {
30d4c750f2SAjit Kumar Pandey 	NONE = 0,
310439eb4dSV sujith kumar Reddy 	I2S_HS,
32d4c750f2SAjit Kumar Pandey 	I2S_SP,
33d4c750f2SAjit Kumar Pandey 	I2S_BT,
34d4c750f2SAjit Kumar Pandey 	DMIC,
35d4c750f2SAjit Kumar Pandey };
36d4c750f2SAjit Kumar Pandey 
37d4c750f2SAjit Kumar Pandey enum codec_endpoints {
38d4c750f2SAjit Kumar Pandey 	DUMMY = 0,
39d4c750f2SAjit Kumar Pandey 	RT5682,
40d4c750f2SAjit Kumar Pandey 	RT1019,
41cabc3aceSAjit Kumar Pandey 	MAX98360A,
428b725626SAjit Kumar Pandey 	RT5682S,
430439eb4dSV sujith kumar Reddy 	NAU8825,
444b526b32SVenkata Prasad Potturu 	NAU8821,
45*ac91c8c8SVenkata Prasad Potturu 	MAX98388,
46d4c750f2SAjit Kumar Pandey };
47d4c750f2SAjit Kumar Pandey 
48e8a33a94SV sujith kumar Reddy enum platform_end_point {
49e8a33a94SV sujith kumar Reddy 	RENOIR = 0,
50e8a33a94SV sujith kumar Reddy 	REMBRANDT,
51e8a33a94SV sujith kumar Reddy };
52e8a33a94SV sujith kumar Reddy 
53d4c750f2SAjit Kumar Pandey struct acp_card_drvdata {
54d4c750f2SAjit Kumar Pandey 	unsigned int hs_cpu_id;
55d4c750f2SAjit Kumar Pandey 	unsigned int amp_cpu_id;
56d4c750f2SAjit Kumar Pandey 	unsigned int dmic_cpu_id;
57d4c750f2SAjit Kumar Pandey 	unsigned int hs_codec_id;
58d4c750f2SAjit Kumar Pandey 	unsigned int amp_codec_id;
59d4c750f2SAjit Kumar Pandey 	unsigned int dmic_codec_id;
60d4c750f2SAjit Kumar Pandey 	unsigned int dai_fmt;
61e8a33a94SV sujith kumar Reddy 	unsigned int platform;
62d4c750f2SAjit Kumar Pandey 	struct clk *wclk;
63d4c750f2SAjit Kumar Pandey 	struct clk *bclk;
640439eb4dSV sujith kumar Reddy 	bool soc_mclk;
6520055300SVenkata Prasad Potturu 	bool tdm_mode;
66d4c750f2SAjit Kumar Pandey };
67d4c750f2SAjit Kumar Pandey 
68d4c750f2SAjit Kumar Pandey int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
69d4c750f2SAjit Kumar Pandey int acp_legacy_dai_links_create(struct snd_soc_card *card);
70d386a10cSVenkata Prasad Potturu extern const struct dmi_system_id acp_quirk_table[];
7117572892SV sujith kumar Reddy 
72d4c750f2SAjit Kumar Pandey #endif
73