ASoC: soc-core: export function to find codec
Drivers might need to use the ASoC core function to find out whether a particular codec is already registered with ALSA core or not. Export the function so that drivers can use it outside of the file. Change-Id: I2e4fb191afab9dccf1be3d380f54a81797b2d6e5 Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
This commit is contained in:
parent
df4fdb8676
commit
5ca310ff90
|
@ -1252,6 +1252,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
||||||
const char *propname);
|
const char *propname);
|
||||||
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
|
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
|
||||||
const char *prefix);
|
const char *prefix);
|
||||||
|
int soc_check_aux_dev_byname(struct snd_soc_card *card, const char *codec_name);
|
||||||
|
|
||||||
#include <sound/soc-dai.h>
|
#include <sound/soc-dai.h>
|
||||||
|
|
||||||
|
|
|
@ -1520,6 +1520,22 @@ static int soc_check_aux_dev(struct snd_soc_card *card, int num)
|
||||||
return -EPROBE_DEFER;
|
return -EPROBE_DEFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int soc_check_aux_dev_byname(struct snd_soc_card *card, const char *codec_name)
|
||||||
|
{
|
||||||
|
struct snd_soc_codec *codec;
|
||||||
|
|
||||||
|
/* find CODEC from registered CODECs*/
|
||||||
|
list_for_each_entry(codec, &codec_list, list) {
|
||||||
|
if (!strcmp(codec->name, codec_name))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dev_err(card->dev, "ASoC: %s not registered\n", codec_name);
|
||||||
|
|
||||||
|
return -EPROBE_DEFER;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(soc_check_aux_dev_byname);
|
||||||
|
|
||||||
static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
|
static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
|
||||||
{
|
{
|
||||||
struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num];
|
struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num];
|
||||||
|
|
Loading…
Reference in New Issue