~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/amd/acp/acp-mach.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2 /*
  3  * This file is provided under a dual BSD/GPLv2 license. When using or
  4  * redistributing this file, you may do so under either license.
  5  *
  6  * Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
  7  *
  8  * Author: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
  9  */
 10 #ifndef __ACP_MACH_H
 11 #define __ACP_MACH_H
 12 
 13 #include <sound/core.h>
 14 #include <sound/jack.h>
 15 #include <sound/pcm_params.h>
 16 #include <sound/soc-dapm.h>
 17 #include <linux/input.h>
 18 #include <linux/module.h>
 19 #include <sound/soc.h>
 20 
 21 #define TDM_CHANNELS    8
 22 
 23 #define ACP_OPS(priv, cb)       ((priv)->ops.cb)
 24 
 25 #define acp_get_drvdata(card) ((struct acp_card_drvdata *)(card)->drvdata)
 26 
 27 enum be_id {
 28         HEADSET_BE_ID = 0,
 29         AMP_BE_ID,
 30         DMIC_BE_ID,
 31         BT_BE_ID,
 32 };
 33 
 34 enum cpu_endpoints {
 35         NONE = 0,
 36         I2S_HS,
 37         I2S_SP,
 38         I2S_BT,
 39         DMIC,
 40 };
 41 
 42 enum codec_endpoints {
 43         DUMMY = 0,
 44         RT5682,
 45         RT1019,
 46         MAX98360A,
 47         RT5682S,
 48         NAU8825,
 49         NAU8821,
 50         MAX98388,
 51         ES83XX,
 52 };
 53 
 54 enum platform_end_point {
 55         RENOIR = 0,
 56         REMBRANDT,
 57         ACP63,
 58         ACP70,
 59 };
 60 
 61 struct acp_mach_ops {
 62         int (*probe)(struct snd_soc_card *card);
 63         int (*configure_link)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
 64         int (*configure_widgets)(struct snd_soc_card *card);
 65         int (*suspend_pre)(struct snd_soc_card *card);
 66         int (*resume_post)(struct snd_soc_card *card);
 67 };
 68 
 69 struct acp_card_drvdata {
 70         unsigned int hs_cpu_id;
 71         unsigned int amp_cpu_id;
 72         unsigned int bt_cpu_id;
 73         unsigned int dmic_cpu_id;
 74         unsigned int hs_codec_id;
 75         unsigned int amp_codec_id;
 76         unsigned int bt_codec_id;
 77         unsigned int dmic_codec_id;
 78         unsigned int dai_fmt;
 79         unsigned int platform;
 80         struct clk *wclk;
 81         struct clk *bclk;
 82         struct acp_mach_ops ops;
 83         struct snd_soc_acpi_mach *acpi_mach;
 84         void *mach_priv;
 85         bool soc_mclk;
 86         bool tdm_mode;
 87 };
 88 
 89 int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
 90 int acp_legacy_dai_links_create(struct snd_soc_card *card);
 91 extern const struct dmi_system_id acp_quirk_table[];
 92 
 93 static inline int acp_ops_probe(struct snd_soc_card *card)
 94 {
 95         int ret = 1;
 96         struct acp_card_drvdata *priv = acp_get_drvdata(card);
 97 
 98         if (ACP_OPS(priv, probe))
 99                 ret = ACP_OPS(priv, probe)(card);
100         return ret;
101 }
102 
103 static inline int acp_ops_configure_link(struct snd_soc_card *card,
104                                          struct snd_soc_dai_link *dai_link)
105 {
106         int ret = 1;
107         struct acp_card_drvdata *priv = acp_get_drvdata(card);
108 
109         if (ACP_OPS(priv, configure_link))
110                 ret = ACP_OPS(priv, configure_link)(card, dai_link);
111         return ret;
112 }
113 
114 static inline int acp_ops_configure_widgets(struct snd_soc_card *card)
115 {
116         int ret = 1;
117         struct acp_card_drvdata *priv = acp_get_drvdata(card);
118 
119         if (ACP_OPS(priv, configure_widgets))
120                 ret = ACP_OPS(priv, configure_widgets)(card);
121         return ret;
122 }
123 
124 static inline int acp_ops_suspend_pre(struct snd_soc_card *card)
125 {
126         int ret = 1;
127         struct acp_card_drvdata *priv = acp_get_drvdata(card);
128 
129         if (ACP_OPS(priv, suspend_pre))
130                 ret = ACP_OPS(priv, suspend_pre)(card);
131         return ret;
132 }
133 
134 static inline int acp_ops_resume_post(struct snd_soc_card *card)
135 {
136         int ret = 1;
137         struct acp_card_drvdata *priv = acp_get_drvdata(card);
138 
139         if (ACP_OPS(priv, resume_post))
140                 ret = ACP_OPS(priv, resume_post)(card);
141         return ret;
142 }
143 
144 #endif
145 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php