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

TOMOYO Linux Cross Reference
Linux/include/sound/soc-card.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
  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 
 11 enum snd_soc_card_subclass {
 12         SND_SOC_CARD_CLASS_ROOT         = 0,
 13         SND_SOC_CARD_CLASS_RUNTIME      = 1,
 14 };
 15 
 16 static inline void snd_soc_card_mutex_lock_root(struct snd_soc_card *card)
 17 {
 18         mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_ROOT);
 19 }
 20 
 21 static inline void snd_soc_card_mutex_lock(struct snd_soc_card *card)
 22 {
 23         mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 24 }
 25 
 26 static inline void snd_soc_card_mutex_unlock(struct snd_soc_card *card)
 27 {
 28         mutex_unlock(&card->mutex);
 29 }
 30 
 31 struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
 32                                                const char *name);
 33 struct snd_kcontrol *snd_soc_card_get_kcontrol_locked(struct snd_soc_card *soc_card,
 34                                                       const char *name);
 35 int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
 36                           struct snd_soc_jack *jack);
 37 int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,
 38                                int type, struct snd_soc_jack *jack,
 39                                struct snd_soc_jack_pin *pins,
 40                                unsigned int num_pins);
 41 
 42 int snd_soc_card_suspend_pre(struct snd_soc_card *card);
 43 int snd_soc_card_suspend_post(struct snd_soc_card *card);
 44 int snd_soc_card_resume_pre(struct snd_soc_card *card);
 45 int snd_soc_card_resume_post(struct snd_soc_card *card);
 46 
 47 int snd_soc_card_probe(struct snd_soc_card *card);
 48 int snd_soc_card_late_probe(struct snd_soc_card *card);
 49 void snd_soc_card_fixup_controls(struct snd_soc_card *card);
 50 int snd_soc_card_remove(struct snd_soc_card *card);
 51 
 52 int snd_soc_card_set_bias_level(struct snd_soc_card *card,
 53                                 struct snd_soc_dapm_context *dapm,
 54                                 enum snd_soc_bias_level level);
 55 int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
 56                                      struct snd_soc_dapm_context *dapm,
 57                                      enum snd_soc_bias_level level);
 58 
 59 int snd_soc_card_add_dai_link(struct snd_soc_card *card,
 60                               struct snd_soc_dai_link *dai_link);
 61 void snd_soc_card_remove_dai_link(struct snd_soc_card *card,
 62                                   struct snd_soc_dai_link *dai_link);
 63 
 64 #ifdef CONFIG_PCI
 65 static inline void snd_soc_card_set_pci_ssid(struct snd_soc_card *card,
 66                                              unsigned short vendor,
 67                                              unsigned short device)
 68 {
 69         card->pci_subsystem_vendor = vendor;
 70         card->pci_subsystem_device = device;
 71         card->pci_subsystem_set = true;
 72 }
 73 
 74 static inline int snd_soc_card_get_pci_ssid(struct snd_soc_card *card,
 75                                             unsigned short *vendor,
 76                                             unsigned short *device)
 77 {
 78         if (!card->pci_subsystem_set)
 79                 return -ENOENT;
 80 
 81         *vendor = card->pci_subsystem_vendor;
 82         *device = card->pci_subsystem_device;
 83 
 84         return 0;
 85 }
 86 #else /* !CONFIG_PCI */
 87 static inline void snd_soc_card_set_pci_ssid(struct snd_soc_card *card,
 88                                              unsigned short vendor,
 89                                              unsigned short device)
 90 {
 91 }
 92 
 93 static inline int snd_soc_card_get_pci_ssid(struct snd_soc_card *card,
 94                                             unsigned short *vendor,
 95                                             unsigned short *device)
 96 {
 97         return -ENOENT;
 98 }
 99 #endif /* CONFIG_PCI */
100 
101 /* device driver data */
102 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
103                                             void *data)
104 {
105         card->drvdata = data;
106 }
107 
108 static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
109 {
110         return card->drvdata;
111 }
112 
113 static inline
114 struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
115                                                const char *dai_name)
116 {
117         struct snd_soc_pcm_runtime *rtd;
118 
119         for_each_card_rtds(card, rtd) {
120                 if (!strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, dai_name))
121                         return snd_soc_rtd_to_codec(rtd, 0);
122         }
123 
124         return NULL;
125 }
126 
127 #endif /* __SOC_CARD_H */
128 

~ [ 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