summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/skylake
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-03-01 19:55:59 +0000
committerMark Brown <broonie@kernel.org>2018-03-01 19:55:59 +0000
commita1f362d806b29669725c4c29b591b0a1bf9081cb (patch)
treea518245fe1af7a199a799e3be885fff85258e267 /sound/soc/intel/skylake
parentf7a9f77256e7fbd6150651bfab44f60c39f0b7a2 (diff)
parent03a0ddeda7ebafea8e99078581a50d856e3587a4 (diff)
downloadblackbird-op-linux-a1f362d806b29669725c4c29b591b0a1bf9081cb.tar.gz
blackbird-op-linux-a1f362d806b29669725c4c29b591b0a1bf9081cb.zip
Merge branch 'topic/component-platform' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
Diffstat (limited to 'sound/soc/intel/skylake')
-rw-r--r--sound/soc/intel/skylake/skl-debug.c2
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c52
-rw-r--r--sound/soc/intel/skylake/skl-topology.c28
-rw-r--r--sound/soc/intel/skylake/skl-topology.h2
-rw-r--r--sound/soc/intel/skylake/skl.h2
5 files changed, 35 insertions, 51 deletions
diff --git a/sound/soc/intel/skylake/skl-debug.c b/sound/soc/intel/skylake/skl-debug.c
index dc20d91f62e6..a016455a6ddb 100644
--- a/sound/soc/intel/skylake/skl-debug.c
+++ b/sound/soc/intel/skylake/skl-debug.c
@@ -231,7 +231,7 @@ struct skl_debug *skl_debugfs_init(struct skl *skl)
/* create the debugfs dir with platform component's debugfs as parent */
d->fs = debugfs_create_dir("dsp",
- skl->platform->component.debugfs_root);
+ skl->component->debugfs_root);
if (IS_ERR(d->fs) || !d->fs) {
dev_err(&skl->pci->dev, "debugfs root creation failed\n");
return NULL;
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 91d858e25fce..84e40faeb869 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1326,23 +1326,23 @@ static int skl_populate_modules(struct skl *skl)
return ret;
}
-static int skl_platform_soc_probe(struct snd_soc_platform *platform)
+static int skl_platform_soc_probe(struct snd_soc_component *component)
{
- struct hdac_ext_bus *ebus = dev_get_drvdata(platform->dev);
+ struct hdac_ext_bus *ebus = dev_get_drvdata(component->dev);
struct skl *skl = ebus_to_skl(ebus);
const struct skl_dsp_ops *ops;
int ret;
- pm_runtime_get_sync(platform->dev);
+ pm_runtime_get_sync(component->dev);
if ((ebus_to_hbus(ebus))->ppcap) {
- skl->platform = platform;
+ skl->component = component;
/* init debugfs */
skl->debugfs = skl_debugfs_init(skl);
- ret = skl_tplg_init(platform, ebus);
+ ret = skl_tplg_init(component, ebus);
if (ret < 0) {
- dev_err(platform->dev, "Failed to init topology!\n");
+ dev_err(component->dev, "Failed to init topology!\n");
return ret;
}
@@ -1352,17 +1352,17 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform)
return -EIO;
if (skl->skl_sst->is_first_boot == false) {
- dev_err(platform->dev, "DSP reports first boot done!!!\n");
+ dev_err(component->dev, "DSP reports first boot done!!!\n");
return -EIO;
}
/* disable dynamic clock gating during fw and lib download */
- skl->skl_sst->enable_miscbdcge(platform->dev, false);
+ skl->skl_sst->enable_miscbdcge(component->dev, false);
- ret = ops->init_fw(platform->dev, skl->skl_sst);
- skl->skl_sst->enable_miscbdcge(platform->dev, true);
+ ret = ops->init_fw(component->dev, skl->skl_sst);
+ skl->skl_sst->enable_miscbdcge(component->dev, true);
if (ret < 0) {
- dev_err(platform->dev, "Failed to boot first fw: %d\n", ret);
+ dev_err(component->dev, "Failed to boot first fw: %d\n", ret);
return ret;
}
skl_populate_modules(skl);
@@ -1375,22 +1375,20 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform)
skl->cfg.astate_cfg);
}
}
- pm_runtime_mark_last_busy(platform->dev);
- pm_runtime_put_autosuspend(platform->dev);
+ pm_runtime_mark_last_busy(component->dev);
+ pm_runtime_put_autosuspend(component->dev);
return 0;
}
-static const struct snd_soc_platform_driver skl_platform_drv = {
+
+static const struct snd_soc_component_driver skl_component = {
+ .name = "pcm",
.probe = skl_platform_soc_probe,
.ops = &skl_platform_ops,
.pcm_new = skl_pcm_new,
.pcm_free = skl_pcm_free,
};
-static const struct snd_soc_component_driver skl_component = {
- .name = "pcm",
-};
-
int skl_platform_register(struct device *dev)
{
int ret;
@@ -1402,12 +1400,6 @@ int skl_platform_register(struct device *dev)
INIT_LIST_HEAD(&skl->ppl_list);
INIT_LIST_HEAD(&skl->bind_list);
- ret = snd_soc_register_platform(dev, &skl_platform_drv);
- if (ret) {
- dev_err(dev, "soc platform registration failed %d\n", ret);
- return ret;
- }
-
skl->dais = kmemdup(skl_platform_dai, sizeof(skl_platform_dai),
GFP_KERNEL);
if (!skl->dais) {
@@ -1429,18 +1421,12 @@ int skl_platform_register(struct device *dev)
num_dais += ARRAY_SIZE(skl_fe_dai);
}
- ret = snd_soc_register_component(dev, &skl_component,
+ ret = devm_snd_soc_register_component(dev, &skl_component,
skl->dais, num_dais);
- if (ret) {
+ if (ret)
dev_err(dev, "soc component registration failed %d\n", ret);
- goto err;
- }
-
- return 0;
err:
- snd_soc_unregister_platform(dev);
return ret;
-
}
int skl_platform_unregister(struct device *dev)
@@ -1456,8 +1442,6 @@ int skl_platform_unregister(struct device *dev)
}
}
- snd_soc_unregister_component(dev);
- snd_soc_unregister_platform(dev);
kfree(skl->dais);
return 0;
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 17da3b58c214..3b1dca419883 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -2795,15 +2795,15 @@ static int skl_tplg_get_pvt_data(struct snd_soc_tplg_dapm_widget *tplg_w,
return 0;
}
-static void skl_clear_pin_config(struct snd_soc_platform *platform,
+static void skl_clear_pin_config(struct snd_soc_component *component,
struct snd_soc_dapm_widget *w)
{
int i;
struct skl_module_cfg *mconfig;
struct skl_pipe *pipe;
- if (!strncmp(w->dapm->component->name, platform->component.name,
- strlen(platform->component.name))) {
+ if (!strncmp(w->dapm->component->name, component->name,
+ strlen(component->name))) {
mconfig = w->priv;
pipe = mconfig->pipe;
for (i = 0; i < mconfig->module->max_input_pins; i++) {
@@ -2822,14 +2822,14 @@ static void skl_clear_pin_config(struct snd_soc_platform *platform,
void skl_cleanup_resources(struct skl *skl)
{
struct skl_sst *ctx = skl->skl_sst;
- struct snd_soc_platform *soc_platform = skl->platform;
+ struct snd_soc_component *soc_component = skl->component;
struct snd_soc_dapm_widget *w;
struct snd_soc_card *card;
- if (soc_platform == NULL)
+ if (soc_component == NULL)
return;
- card = soc_platform->component.card;
+ card = soc_component->card;
if (!card || !card->instantiated)
return;
@@ -2838,7 +2838,7 @@ void skl_cleanup_resources(struct skl *skl)
list_for_each_entry(w, &card->widgets, list) {
if (is_skl_dsp_widget_type(w, ctx->dev) && w->priv != NULL)
- skl_clear_pin_config(soc_platform, w);
+ skl_clear_pin_config(soc_component, w);
}
skl_clear_module_cnt(ctx->dsp);
@@ -3485,19 +3485,19 @@ static struct snd_soc_tplg_ops skl_tplg_ops = {
* widgets in a pipelines, so this helper - skl_tplg_create_pipe_widget_list()
* helps to get the SKL type widgets in that pipeline
*/
-static int skl_tplg_create_pipe_widget_list(struct snd_soc_platform *platform)
+static int skl_tplg_create_pipe_widget_list(struct snd_soc_component *component)
{
struct snd_soc_dapm_widget *w;
struct skl_module_cfg *mcfg = NULL;
struct skl_pipe_module *p_module = NULL;
struct skl_pipe *pipe;
- list_for_each_entry(w, &platform->component.card->widgets, list) {
- if (is_skl_dsp_widget_type(w, platform->dev) && w->priv) {
+ list_for_each_entry(w, &component->card->widgets, list) {
+ if (is_skl_dsp_widget_type(w, component->dev) && w->priv) {
mcfg = w->priv;
pipe = mcfg->pipe;
- p_module = devm_kzalloc(platform->dev,
+ p_module = devm_kzalloc(component->dev,
sizeof(*p_module), GFP_KERNEL);
if (!p_module)
return -ENOMEM;
@@ -3540,7 +3540,7 @@ static void skl_tplg_set_pipe_type(struct skl *skl, struct skl_pipe *pipe)
/*
* SKL topology init routine
*/
-int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)
+int skl_tplg_init(struct snd_soc_component *component, struct hdac_ext_bus *ebus)
{
int ret;
const struct firmware *fw;
@@ -3564,7 +3564,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)
* The complete tplg for SKL is loaded as index 0, we don't use
* any other index
*/
- ret = snd_soc_tplg_component_load(&platform->component,
+ ret = snd_soc_tplg_component_load(component,
&skl_tplg_ops, fw, 0);
if (ret < 0) {
dev_err(bus->dev, "tplg component load failed%d\n", ret);
@@ -3576,7 +3576,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)
skl->resource.max_mem = SKL_FW_MAX_MEM;
skl->tplg = fw;
- ret = skl_tplg_create_pipe_widget_list(platform);
+ ret = skl_tplg_create_pipe_widget_list(component);
if (ret < 0)
return ret;
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index a467129cc705..b1e0667c0ae0 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -469,7 +469,7 @@ int skl_dsp_set_dma_control(struct skl_sst *ctx, u32 *caps,
u32 caps_size, u32 node_id);
void skl_tplg_set_be_dmic_config(struct snd_soc_dai *dai,
struct skl_pipe_params *params, int stream);
-int skl_tplg_init(struct snd_soc_platform *platform,
+int skl_tplg_init(struct snd_soc_component *component,
struct hdac_ext_bus *ebus);
struct skl_module_cfg *skl_tplg_fe_get_cpr_module(
struct snd_soc_dai *dai, int stream);
diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h
index 2d13f3fd988a..ca46ad1d0a08 100644
--- a/sound/soc/intel/skylake/skl.h
+++ b/sound/soc/intel/skylake/skl.h
@@ -74,7 +74,7 @@ struct skl {
struct platform_device *dmic_dev;
struct platform_device *i2s_dev;
struct platform_device *clk_dev;
- struct snd_soc_platform *platform;
+ struct snd_soc_component *component;
struct snd_soc_dai_driver *dais;
struct nhlt_acpi_table *nhlt; /* nhlt ptr */
OpenPOWER on IntegriCloud