2020-05-28 08:47:46 +07:00
|
|
|
/* 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
|
|
|
|
|
2020-05-28 08:47:56 +07:00
|
|
|
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
|
|
|
|
const char *name);
|
2020-05-28 08:48:03 +07:00
|
|
|
int snd_soc_card_jack_new(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);
|
2020-05-28 08:47:56 +07:00
|
|
|
|
2020-05-28 08:48:11 +07:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
|
2020-05-28 08:48:20 +07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-05-28 08:47:46 +07:00
|
|
|
#endif /* __SOC_CARD_H */
|