diff options
author | Mark Brown <broonie@kernel.org> | 2017-11-10 16:30:48 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-10 16:30:48 -0500 |
commit | 73e13d0f6c1b3d69f0379500ba6d17d8a43a50c6 (patch) | |
tree | 35b4cfbc17bb3b9c0d3a4382ec8f7325ba077a24 | |
parent | 4d0210e6d0aec4b95c762e2af1afa688cc512547 (diff) | |
parent | e0dac41b8c21d41534b04d520c1927c2b0ac9b5e (diff) |
Merge remote-tracking branch 'asoc/topic/component' into asoc-next
-rw-r--r-- | include/sound/soc.h | 7 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 34 |
2 files changed, 30 insertions, 11 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index d22de9712c45..580da1e4f141 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -468,6 +468,11 @@ int snd_soc_register_codec(struct device *dev, | |||
468 | const struct snd_soc_codec_driver *codec_drv, | 468 | const struct snd_soc_codec_driver *codec_drv, |
469 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 469 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
470 | void snd_soc_unregister_codec(struct device *dev); | 470 | void snd_soc_unregister_codec(struct device *dev); |
471 | int snd_soc_add_component(struct device *dev, | ||
472 | struct snd_soc_component *component, | ||
473 | const struct snd_soc_component_driver *component_driver, | ||
474 | struct snd_soc_dai_driver *dai_drv, | ||
475 | int num_dai); | ||
471 | int snd_soc_register_component(struct device *dev, | 476 | int snd_soc_register_component(struct device *dev, |
472 | const struct snd_soc_component_driver *component_driver, | 477 | const struct snd_soc_component_driver *component_driver, |
473 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 478 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
@@ -1487,6 +1492,8 @@ int snd_soc_component_set_sysclk(struct snd_soc_component *component, | |||
1487 | int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, | 1492 | int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, |
1488 | int source, unsigned int freq_in, | 1493 | int source, unsigned int freq_in, |
1489 | unsigned int freq_out); | 1494 | unsigned int freq_out); |
1495 | int snd_soc_component_set_jack(struct snd_soc_component *component, | ||
1496 | struct snd_soc_jack *jack, void *data); | ||
1490 | 1497 | ||
1491 | #ifdef CONFIG_REGMAP | 1498 | #ifdef CONFIG_REGMAP |
1492 | 1499 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index fee4b0ef5566..3a1c3b44de5e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3371,20 +3371,14 @@ static void snd_soc_component_del_unlocked(struct snd_soc_component *component) | |||
3371 | list_del(&component->list); | 3371 | list_del(&component->list); |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | int snd_soc_register_component(struct device *dev, | 3374 | int snd_soc_add_component(struct device *dev, |
3375 | const struct snd_soc_component_driver *component_driver, | 3375 | struct snd_soc_component *component, |
3376 | struct snd_soc_dai_driver *dai_drv, | 3376 | const struct snd_soc_component_driver *component_driver, |
3377 | int num_dai) | 3377 | struct snd_soc_dai_driver *dai_drv, |
3378 | int num_dai) | ||
3378 | { | 3379 | { |
3379 | struct snd_soc_component *component; | ||
3380 | int ret; | 3380 | int ret; |
3381 | 3381 | ||
3382 | component = kzalloc(sizeof(*component), GFP_KERNEL); | ||
3383 | if (!component) { | ||
3384 | dev_err(dev, "ASoC: Failed to allocate memory\n"); | ||
3385 | return -ENOMEM; | ||
3386 | } | ||
3387 | |||
3388 | ret = snd_soc_component_initialize(component, component_driver, dev); | 3382 | ret = snd_soc_component_initialize(component, component_driver, dev); |
3389 | if (ret) | 3383 | if (ret) |
3390 | goto err_free; | 3384 | goto err_free; |
@@ -3408,6 +3402,24 @@ err_free: | |||
3408 | kfree(component); | 3402 | kfree(component); |
3409 | return ret; | 3403 | return ret; |
3410 | } | 3404 | } |
3405 | EXPORT_SYMBOL_GPL(snd_soc_add_component); | ||
3406 | |||
3407 | int snd_soc_register_component(struct device *dev, | ||
3408 | const struct snd_soc_component_driver *component_driver, | ||
3409 | struct snd_soc_dai_driver *dai_drv, | ||
3410 | int num_dai) | ||
3411 | { | ||
3412 | struct snd_soc_component *component; | ||
3413 | |||
3414 | component = kzalloc(sizeof(*component), GFP_KERNEL); | ||
3415 | if (!component) { | ||
3416 | dev_err(dev, "ASoC: Failed to allocate memory\n"); | ||
3417 | return -ENOMEM; | ||
3418 | } | ||
3419 | |||
3420 | return snd_soc_add_component(dev, component, component_driver, | ||
3421 | dai_drv, num_dai); | ||
3422 | } | ||
3411 | EXPORT_SYMBOL_GPL(snd_soc_register_component); | 3423 | EXPORT_SYMBOL_GPL(snd_soc_register_component); |
3412 | 3424 | ||
3413 | /** | 3425 | /** |