Merge tag 'pull-elfcore' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-block.git] / include / sound / soc-card.h
CommitLineData
1793936b
KM
1/* SPDX-License-Identifier: GPL-2.0
2 *
3 * soc-card.h
4 *
5 * Copyright (C) 2019 Renesas Electronics Corp.
6 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7 */
8#ifndef __SOC_CARD_H
9#define __SOC_CARD_H
10
bf5bb8db
KM
11enum snd_soc_card_subclass {
12 SND_SOC_CARD_CLASS_INIT = 0,
13 SND_SOC_CARD_CLASS_RUNTIME = 1,
14};
15
209c6cdf
KM
16struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
17 const char *name);
3359e9b6 18int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
19aed2d6
AO
19 struct snd_soc_jack *jack);
20int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,
21 int type, struct snd_soc_jack *jack,
22 struct snd_soc_jack_pin *pins,
23 unsigned int num_pins);
209c6cdf 24
130dc08c 25int snd_soc_card_suspend_pre(struct snd_soc_card *card);
d17b60b2 26int snd_soc_card_suspend_post(struct snd_soc_card *card);
934c752c 27int snd_soc_card_resume_pre(struct snd_soc_card *card);
739443d1 28int snd_soc_card_resume_post(struct snd_soc_card *card);
130dc08c 29
73de4b02 30int snd_soc_card_probe(struct snd_soc_card *card);
5c0eac03 31int snd_soc_card_late_probe(struct snd_soc_card *card);
df4d27b1 32void snd_soc_card_fixup_controls(struct snd_soc_card *card);
b0275d95 33int snd_soc_card_remove(struct snd_soc_card *card);
73de4b02 34
39caefda
KM
35int snd_soc_card_set_bias_level(struct snd_soc_card *card,
36 struct snd_soc_dapm_context *dapm,
37 enum snd_soc_bias_level level);
d41278ea
KM
38int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
39 struct snd_soc_dapm_context *dapm,
40 enum snd_soc_bias_level level);
39caefda 41
cbc7a6b5
KM
42int snd_soc_card_add_dai_link(struct snd_soc_card *card,
43 struct snd_soc_dai_link *dai_link);
fcbbcc32
KM
44void snd_soc_card_remove_dai_link(struct snd_soc_card *card,
45 struct snd_soc_dai_link *dai_link);
cbc7a6b5 46
63efed58
KM
47/* device driver data */
48static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
49 void *data)
50{
51 card->drvdata = data;
52}
53
54static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
55{
56 return card->drvdata;
57}
58
65a75718
KM
59static inline
60struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
61 const char *dai_name)
62{
63 struct snd_soc_pcm_runtime *rtd;
64
65 for_each_card_rtds(card, rtd) {
66 if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
67 return asoc_rtd_to_codec(rtd, 0);
68 }
69
70 return NULL;
71}
72
1793936b 73#endif /* __SOC_CARD_H */