Merge remote-tracking branch 'asoc/topic/intel' into asoc-next
This commit is contained in:
@@ -653,7 +653,7 @@ static const struct snd_soc_dai_ops skl_link_dai_ops = {
|
||||
.trigger = skl_link_pcm_trigger,
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_driver skl_platform_dai[] = {
|
||||
static struct snd_soc_dai_driver skl_fe_dai[] = {
|
||||
{
|
||||
.name = "System Pin",
|
||||
.ops = &skl_pcm_dai_ops,
|
||||
@@ -797,8 +797,10 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
|
||||
.sig_bits = 32,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/* BE CPU Dais */
|
||||
static struct snd_soc_dai_driver skl_platform_dai[] = {
|
||||
{
|
||||
.name = "SSP0 Pin",
|
||||
.ops = &skl_be_ssp_dai_ops,
|
||||
@@ -976,6 +978,14 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
|
||||
},
|
||||
};
|
||||
|
||||
int skl_dai_load(struct snd_soc_component *cmp,
|
||||
struct snd_soc_dai_driver *pcm_dai)
|
||||
{
|
||||
pcm_dai->ops = &skl_pcm_dai_ops;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int skl_platform_open(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
@@ -1363,6 +1373,8 @@ int skl_platform_register(struct device *dev)
|
||||
int ret;
|
||||
struct hdac_ext_bus *ebus = dev_get_drvdata(dev);
|
||||
struct skl *skl = ebus_to_skl(ebus);
|
||||
struct snd_soc_dai_driver *dais;
|
||||
int num_dais = ARRAY_SIZE(skl_platform_dai);
|
||||
|
||||
INIT_LIST_HEAD(&skl->ppl_list);
|
||||
INIT_LIST_HEAD(&skl->bind_list);
|
||||
@@ -1372,14 +1384,38 @@ int skl_platform_register(struct device *dev)
|
||||
dev_err(dev, "soc platform registration failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
ret = snd_soc_register_component(dev, &skl_component,
|
||||
skl_platform_dai,
|
||||
ARRAY_SIZE(skl_platform_dai));
|
||||
if (ret) {
|
||||
dev_err(dev, "soc component registration failed %d\n", ret);
|
||||
snd_soc_unregister_platform(dev);
|
||||
|
||||
skl->dais = kmemdup(skl_platform_dai, sizeof(skl_platform_dai),
|
||||
GFP_KERNEL);
|
||||
if (!skl->dais) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!skl->use_tplg_pcm) {
|
||||
dais = krealloc(skl->dais, sizeof(skl_fe_dai) +
|
||||
sizeof(skl_platform_dai), GFP_KERNEL);
|
||||
if (!dais) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
skl->dais = dais;
|
||||
memcpy(&skl->dais[ARRAY_SIZE(skl_platform_dai)], skl_fe_dai,
|
||||
sizeof(skl_fe_dai));
|
||||
num_dais += ARRAY_SIZE(skl_fe_dai);
|
||||
}
|
||||
|
||||
ret = snd_soc_register_component(dev, &skl_component,
|
||||
skl->dais, num_dais);
|
||||
if (ret) {
|
||||
dev_err(dev, "soc component registration failed %d\n", ret);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
err:
|
||||
snd_soc_unregister_platform(dev);
|
||||
return ret;
|
||||
|
||||
}
|
||||
@@ -1399,5 +1435,7 @@ int skl_platform_unregister(struct device *dev)
|
||||
|
||||
snd_soc_unregister_component(dev);
|
||||
snd_soc_unregister_platform(dev);
|
||||
kfree(skl->dais);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Referens i nytt ärende
Block a user