aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc-dai.h2
-rw-r--r--include/sound/soc.h6
-rw-r--r--sound/soc/Kconfig5
-rw-r--r--sound/soc/Makefile3
-rw-r--r--sound/soc/intel/Kconfig1
-rw-r--r--sound/soc/intel/atom/sst-mfld-platform-pcm.c2
-rw-r--r--sound/soc/omap/rx51.c2
-rw-r--r--sound/soc/soc-compress.c12
-rw-r--r--sound/soc/soc-core.c4
-rw-r--r--sound/soc/soc-ops.c8
10 files changed, 30 insertions, 15 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 2df96b1384c7..238200ffba5b 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -214,7 +214,7 @@ struct snd_soc_dai_driver {
214 int (*suspend)(struct snd_soc_dai *dai); 214 int (*suspend)(struct snd_soc_dai *dai);
215 int (*resume)(struct snd_soc_dai *dai); 215 int (*resume)(struct snd_soc_dai *dai);
216 /* compress dai */ 216 /* compress dai */
217 bool compress_dai; 217 int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);
218 /* DAI is also used for the control bus */ 218 /* DAI is also used for the control bus */
219 bool bus_control; 219 bool bus_control;
220 220
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 824ee7b91734..904d69429087 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -452,7 +452,9 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
452int snd_soc_platform_write(struct snd_soc_platform *platform, 452int snd_soc_platform_write(struct snd_soc_platform *platform,
453 unsigned int reg, unsigned int val); 453 unsigned int reg, unsigned int val);
454int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); 454int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
455int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num); 455#ifdef CONFIG_SND_SOC_COMPRESS
456int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
457#endif
456 458
457struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, 459struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
458 const char *dai_link, int stream); 460 const char *dai_link, int stream);
@@ -605,7 +607,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
605 struct snd_ctl_elem_value *ucontrol); 607 struct snd_ctl_elem_value *ucontrol);
606int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol, 608int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
607 struct snd_ctl_elem_value *ucontrol); 609 struct snd_ctl_elem_value *ucontrol);
608int snd_soc_limit_volume(struct snd_soc_codec *codec, 610int snd_soc_limit_volume(struct snd_soc_card *card,
609 const char *name, int max); 611 const char *name, int max);
610int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, 612int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
611 struct snd_ctl_elem_info *uinfo); 613 struct snd_ctl_elem_info *uinfo);
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index 7de792b06007..7ff7d88e46dd 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -9,7 +9,6 @@ menuconfig SND_SOC
9 select SND_JACK if INPUT=y || INPUT=SND 9 select SND_JACK if INPUT=y || INPUT=SND
10 select REGMAP_I2C if I2C 10 select REGMAP_I2C if I2C
11 select REGMAP_SPI if SPI_MASTER 11 select REGMAP_SPI if SPI_MASTER
12 select SND_COMPRESS_OFFLOAD
13 ---help--- 12 ---help---
14 13
15 If you want ASoC support, you should say Y here and also to the 14 If you want ASoC support, you should say Y here and also to the
@@ -30,6 +29,10 @@ config SND_SOC_GENERIC_DMAENGINE_PCM
30 bool 29 bool
31 select SND_DMAENGINE_PCM 30 select SND_DMAENGINE_PCM
32 31
32config SND_SOC_COMPRESS
33 bool
34 select SND_COMPRESS_OFFLOAD
35
33config SND_SOC_TOPOLOGY 36config SND_SOC_TOPOLOGY
34 bool 37 bool
35 38
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index af0a5714e107..8eb06db32fa0 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -1,5 +1,6 @@
1snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o 1snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
2snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o 2snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o
3snd-soc-core-$(CONFIG_SND_SOC_COMPRESS) += soc-compress.o
3 4
4ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) 5ifneq ($(CONFIG_SND_SOC_TOPOLOGY),)
5snd-soc-core-objs += soc-topology.o 6snd-soc-core-objs += soc-topology.o
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 05fde5e6e257..221e3bd73adb 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -12,6 +12,7 @@ config SND_MFLD_MACHINE
12 12
13config SND_SST_MFLD_PLATFORM 13config SND_SST_MFLD_PLATFORM
14 tristate 14 tristate
15 select SND_SOC_COMPRESS
15 16
16config SND_SST_IPC 17config SND_SST_IPC
17 tristate 18 tristate
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 5e9c316c142a..0487cfaac538 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -512,7 +512,7 @@ static struct snd_soc_dai_driver sst_platform_dai[] = {
512}, 512},
513{ 513{
514 .name = "compress-cpu-dai", 514 .name = "compress-cpu-dai",
515 .compress_dai = 1, 515 .compress_new = snd_soc_new_compress,
516 .ops = &sst_compr_dai_ops, 516 .ops = &sst_compr_dai_ops,
517 .playback = { 517 .playback = {
518 .stream_name = "Compress Playback", 518 .stream_name = "Compress Playback",
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 3bebfb1d3a6f..99538900a253 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -297,7 +297,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
297 dev_err(card->dev, "Failed to add TPA6130A2 controls\n"); 297 dev_err(card->dev, "Failed to add TPA6130A2 controls\n");
298 return err; 298 return err;
299 } 299 }
300 snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42); 300 snd_soc_limit_volume(card, "TPA6130A2 Headphone Playback Volume", 42);
301 301
302 err = omap_mcbsp_st_add_controls(rtd, 2); 302 err = omap_mcbsp_st_add_controls(rtd, 2);
303 if (err < 0) { 303 if (err < 0) {
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 025c38fbe3c0..12a9820feac1 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -612,8 +612,15 @@ static struct snd_compr_ops soc_compr_dyn_ops = {
612 .get_codec_caps = soc_compr_get_codec_caps 612 .get_codec_caps = soc_compr_get_codec_caps
613}; 613};
614 614
615/* create a new compress */ 615/**
616int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) 616 * snd_soc_new_compress - create a new compress.
617 *
618 * @rtd: The runtime for which we will create compress
619 * @num: the device index number (zero based - shared with normal PCMs)
620 *
621 * Return: 0 for success, else error.
622 */
623int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
617{ 624{
618 struct snd_soc_codec *codec = rtd->codec; 625 struct snd_soc_codec *codec = rtd->codec;
619 struct snd_soc_platform *platform = rtd->platform; 626 struct snd_soc_platform *platform = rtd->platform;
@@ -703,3 +710,4 @@ compr_err:
703 kfree(compr); 710 kfree(compr);
704 return ret; 711 return ret;
705} 712}
713EXPORT_SYMBOL_GPL(snd_soc_new_compress);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3b471f9c98c6..24b096066a07 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1370,9 +1370,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
1370 soc_dpcm_debugfs_add(rtd); 1370 soc_dpcm_debugfs_add(rtd);
1371#endif 1371#endif
1372 1372
1373 if (cpu_dai->driver->compress_dai) { 1373 if (cpu_dai->driver->compress_new) {
1374 /*create compress_device"*/ 1374 /*create compress_device"*/
1375 ret = soc_new_compress(rtd, num); 1375 ret = cpu_dai->driver->compress_new(rtd, num);
1376 if (ret < 0) { 1376 if (ret < 0) {
1377 dev_err(card->dev, "ASoC: can't create compress %s\n", 1377 dev_err(card->dev, "ASoC: can't create compress %s\n",
1378 dai_link->stream_name); 1378 dai_link->stream_name);
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index 05977ae1ff2a..ecd38e52285a 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -588,16 +588,16 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);
588/** 588/**
589 * snd_soc_limit_volume - Set new limit to an existing volume control. 589 * snd_soc_limit_volume - Set new limit to an existing volume control.
590 * 590 *
591 * @codec: where to look for the control 591 * @card: where to look for the control
592 * @name: Name of the control 592 * @name: Name of the control
593 * @max: new maximum limit 593 * @max: new maximum limit
594 * 594 *
595 * Return 0 for success, else error. 595 * Return 0 for success, else error.
596 */ 596 */
597int snd_soc_limit_volume(struct snd_soc_codec *codec, 597int snd_soc_limit_volume(struct snd_soc_card *card,
598 const char *name, int max) 598 const char *name, int max)
599{ 599{
600 struct snd_card *card = codec->component.card->snd_card; 600 struct snd_card *snd_card = card->snd_card;
601 struct snd_kcontrol *kctl; 601 struct snd_kcontrol *kctl;
602 struct soc_mixer_control *mc; 602 struct soc_mixer_control *mc;
603 int found = 0; 603 int found = 0;
@@ -607,7 +607,7 @@ int snd_soc_limit_volume(struct snd_soc_codec *codec,
607 if (unlikely(!name || max <= 0)) 607 if (unlikely(!name || max <= 0))
608 return -EINVAL; 608 return -EINVAL;
609 609
610 list_for_each_entry(kctl, &card->controls, list) { 610 list_for_each_entry(kctl, &snd_card->controls, list) {
611 if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name))) { 611 if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name))) {
612 found = 1; 612 found = 1;
613 break; 613 break;