mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
19aed2d6cd
snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
73 lines
2.1 KiB
C
73 lines
2.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0
|
|
*
|
|
* soc-card.h
|
|
*
|
|
* Copyright (C) 2019 Renesas Electronics Corp.
|
|
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
|
*/
|
|
#ifndef __SOC_CARD_H
|
|
#define __SOC_CARD_H
|
|
|
|
enum snd_soc_card_subclass {
|
|
SND_SOC_CARD_CLASS_INIT = 0,
|
|
SND_SOC_CARD_CLASS_RUNTIME = 1,
|
|
};
|
|
|
|
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
|
|
const char *name);
|
|
int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
|
|
struct snd_soc_jack *jack);
|
|
int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,
|
|
int type, struct snd_soc_jack *jack,
|
|
struct snd_soc_jack_pin *pins,
|
|
unsigned int num_pins);
|
|
|
|
int snd_soc_card_suspend_pre(struct snd_soc_card *card);
|
|
int snd_soc_card_suspend_post(struct snd_soc_card *card);
|
|
int snd_soc_card_resume_pre(struct snd_soc_card *card);
|
|
int snd_soc_card_resume_post(struct snd_soc_card *card);
|
|
|
|
int snd_soc_card_probe(struct snd_soc_card *card);
|
|
int snd_soc_card_late_probe(struct snd_soc_card *card);
|
|
int snd_soc_card_remove(struct snd_soc_card *card);
|
|
|
|
int snd_soc_card_set_bias_level(struct snd_soc_card *card,
|
|
struct snd_soc_dapm_context *dapm,
|
|
enum snd_soc_bias_level level);
|
|
int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
|
|
struct snd_soc_dapm_context *dapm,
|
|
enum snd_soc_bias_level level);
|
|
|
|
int snd_soc_card_add_dai_link(struct snd_soc_card *card,
|
|
struct snd_soc_dai_link *dai_link);
|
|
void snd_soc_card_remove_dai_link(struct snd_soc_card *card,
|
|
struct snd_soc_dai_link *dai_link);
|
|
|
|
/* device driver data */
|
|
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
|
|
void *data)
|
|
{
|
|
card->drvdata = data;
|
|
}
|
|
|
|
static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
|
|
{
|
|
return card->drvdata;
|
|
}
|
|
|
|
static inline
|
|
struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
|
|
const char *dai_name)
|
|
{
|
|
struct snd_soc_pcm_runtime *rtd;
|
|
|
|
for_each_card_rtds(card, rtd) {
|
|
if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
|
|
return asoc_rtd_to_codec(rtd, 0);
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
#endif /* __SOC_CARD_H */
|