Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next
Tento commit je obsažen v:

@@ -1266,6 +1266,50 @@ static void rtd_release(struct device *dev)
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static int soc_aux_dev_init(struct snd_soc_card *card,
|
||||
struct snd_soc_codec *codec,
|
||||
int num)
|
||||
{
|
||||
struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num];
|
||||
struct snd_soc_pcm_runtime *rtd = &card->rtd_aux[num];
|
||||
int ret;
|
||||
|
||||
rtd->card = card;
|
||||
|
||||
/* do machine specific initialization */
|
||||
if (aux_dev->init) {
|
||||
ret = aux_dev->init(&codec->dapm);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
rtd->codec = codec;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int soc_dai_link_init(struct snd_soc_card *card,
|
||||
struct snd_soc_codec *codec,
|
||||
int num)
|
||||
{
|
||||
struct snd_soc_dai_link *dai_link = &card->dai_link[num];
|
||||
struct snd_soc_pcm_runtime *rtd = &card->rtd[num];
|
||||
int ret;
|
||||
|
||||
rtd->card = card;
|
||||
|
||||
/* do machine specific initialization */
|
||||
if (dai_link->init) {
|
||||
ret = dai_link->init(rtd);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
rtd->codec = codec;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int soc_post_component_init(struct snd_soc_card *card,
|
||||
struct snd_soc_codec *codec,
|
||||
int num, int dailess)
|
||||
@@ -1280,26 +1324,20 @@ static int soc_post_component_init(struct snd_soc_card *card,
|
||||
dai_link = &card->dai_link[num];
|
||||
rtd = &card->rtd[num];
|
||||
name = dai_link->name;
|
||||
ret = soc_dai_link_init(card, codec, num);
|
||||
} else {
|
||||
aux_dev = &card->aux_dev[num];
|
||||
rtd = &card->rtd_aux[num];
|
||||
name = aux_dev->name;
|
||||
ret = soc_aux_dev_init(card, codec, num);
|
||||
}
|
||||
rtd->card = card;
|
||||
|
||||
/* do machine specific initialization */
|
||||
if (!dailess && dai_link->init)
|
||||
ret = dai_link->init(rtd);
|
||||
else if (dailess && aux_dev->init)
|
||||
ret = aux_dev->init(&codec->dapm);
|
||||
if (ret < 0) {
|
||||
dev_err(card->dev, "ASoC: failed to init %s: %d\n", name, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* register the rtd device */
|
||||
rtd->codec = codec;
|
||||
|
||||
rtd->dev = kzalloc(sizeof(struct device), GFP_KERNEL);
|
||||
if (!rtd->dev)
|
||||
return -ENOMEM;
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele