aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-23 14:25:18 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-23 14:25:18 -0400
commit83097a9c677101645665ac7222e06ebd03a9e997 (patch)
tree7e4eb8a7a19607c28ff75a35fb2bdec42121bb55 /sound
parent60d509fa6a9c4653a86ad830e4c4b30360b23f0e (diff)
parent60b6f1a1e578a5f8a245d4b7622ebf2bad7798cb (diff)
Merge remote-tracking branch 'asoc/topic/core' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/Kconfig2
-rw-r--r--sound/soc/soc-core.c29
-rw-r--r--sound/soc/soc-dapm.c1
-rw-r--r--sound/soc/soc-io.c5
-rw-r--r--sound/soc/soc-utils.c25
5 files changed, 42 insertions, 20 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 45b72561c615..350b86458971 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -324,7 +324,7 @@ config SND_SOC_TLV320AIC23
324 tristate 324 tristate
325 325
326config SND_SOC_TLV320AIC26 326config SND_SOC_TLV320AIC26
327 tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE 327 tristate
328 depends on SPI 328 depends on SPI
329 329
330config SND_SOC_TLV320AIC32X4 330config SND_SOC_TLV320AIC32X4
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ff4b45a5d796..c70f9e072043 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3908,7 +3908,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dais);
3908 * @platform: platform to register 3908 * @platform: platform to register
3909 */ 3909 */
3910int snd_soc_register_platform(struct device *dev, 3910int snd_soc_register_platform(struct device *dev,
3911 struct snd_soc_platform_driver *platform_drv) 3911 const struct snd_soc_platform_driver *platform_drv)
3912{ 3912{
3913 struct snd_soc_platform *platform; 3913 struct snd_soc_platform *platform;
3914 3914
@@ -4024,8 +4024,8 @@ int snd_soc_register_codec(struct device *dev,
4024 /* create CODEC component name */ 4024 /* create CODEC component name */
4025 codec->name = fmt_single_name(dev, &codec->id); 4025 codec->name = fmt_single_name(dev, &codec->id);
4026 if (codec->name == NULL) { 4026 if (codec->name == NULL) {
4027 kfree(codec); 4027 ret = -ENOMEM;
4028 return -ENOMEM; 4028 goto fail_codec;
4029 } 4029 }
4030 4030
4031 if (codec_drv->compress_type) 4031 if (codec_drv->compress_type)
@@ -4064,7 +4064,7 @@ int snd_soc_register_codec(struct device *dev,
4064 reg_size, GFP_KERNEL); 4064 reg_size, GFP_KERNEL);
4065 if (!codec->reg_def_copy) { 4065 if (!codec->reg_def_copy) {
4066 ret = -ENOMEM; 4066 ret = -ENOMEM;
4067 goto fail; 4067 goto fail_codec_name;
4068 } 4068 }
4069 } 4069 }
4070 } 4070 }
@@ -4088,18 +4088,22 @@ int snd_soc_register_codec(struct device *dev,
4088 mutex_unlock(&client_mutex); 4088 mutex_unlock(&client_mutex);
4089 4089
4090 /* register any DAIs */ 4090 /* register any DAIs */
4091 if (num_dai) { 4091 ret = snd_soc_register_dais(dev, dai_drv, num_dai);
4092 ret = snd_soc_register_dais(dev, dai_drv, num_dai); 4092 if (ret < 0) {
4093 if (ret < 0) 4093 dev_err(codec->dev, "ASoC: Failed to regster DAIs: %d\n", ret);
4094 dev_err(codec->dev, "ASoC: Failed to regster" 4094 goto fail_codec_name;
4095 " DAIs: %d\n", ret);
4096 } 4095 }
4097 4096
4098 dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); 4097 dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name);
4099 return 0; 4098 return 0;
4100 4099
4101fail: 4100fail_codec_name:
4101 mutex_lock(&client_mutex);
4102 list_del(&codec->list);
4103 mutex_unlock(&client_mutex);
4104
4102 kfree(codec->name); 4105 kfree(codec->name);
4106fail_codec:
4103 kfree(codec); 4107 kfree(codec);
4104 return ret; 4108 return ret;
4105} 4109}
@@ -4113,7 +4117,6 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec);
4113void snd_soc_unregister_codec(struct device *dev) 4117void snd_soc_unregister_codec(struct device *dev)
4114{ 4118{
4115 struct snd_soc_codec *codec; 4119 struct snd_soc_codec *codec;
4116 int i;
4117 4120
4118 list_for_each_entry(codec, &codec_list, list) { 4121 list_for_each_entry(codec, &codec_list, list) {
4119 if (dev == codec->dev) 4122 if (dev == codec->dev)
@@ -4122,9 +4125,7 @@ void snd_soc_unregister_codec(struct device *dev)
4122 return; 4125 return;
4123 4126
4124found: 4127found:
4125 if (codec->num_dai) 4128 snd_soc_unregister_dais(dev, codec->num_dai);
4126 for (i = 0; i < codec->num_dai; i++)
4127 snd_soc_unregister_dai(dev);
4128 4129
4129 mutex_lock(&client_mutex); 4130 mutex_lock(&client_mutex);
4130 list_del(&codec->list); 4131 list_del(&codec->list);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d6d9ba2e6916..33acd8b892dc 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3137,7 +3137,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3137 break; 3137 break;
3138 } 3138 }
3139 3139
3140 dapm->n_widgets++;
3141 w->dapm = dapm; 3140 w->dapm = dapm;
3142 w->codec = dapm->codec; 3141 w->codec = dapm->codec;
3143 w->platform = dapm->platform; 3142 w->platform = dapm->platform;
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 29183ef2b93d..8ca9ecc5ac57 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -158,10 +158,7 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
158 return -EINVAL; 158 return -EINVAL;
159 } 159 }
160 160
161 if (IS_ERR(codec->control_data)) 161 return PTR_RET(codec->control_data);
162 return PTR_ERR(codec->control_data);
163
164 return 0;
165} 162}
166EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io); 163EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);
167#else 164#else
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index fe4541df498c..4b3be6c3c91e 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -90,8 +90,33 @@ static struct snd_soc_platform_driver dummy_platform = {
90}; 90};
91 91
92static struct snd_soc_codec_driver dummy_codec; 92static struct snd_soc_codec_driver dummy_codec;
93
94#define STUB_RATES SNDRV_PCM_RATE_8000_192000
95#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
96 SNDRV_PCM_FMTBIT_U8 | \
97 SNDRV_PCM_FMTBIT_S16_LE | \
98 SNDRV_PCM_FMTBIT_U16_LE | \
99 SNDRV_PCM_FMTBIT_S24_LE | \
100 SNDRV_PCM_FMTBIT_U24_LE | \
101 SNDRV_PCM_FMTBIT_S32_LE | \
102 SNDRV_PCM_FMTBIT_U32_LE | \
103 SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
93static struct snd_soc_dai_driver dummy_dai = { 104static struct snd_soc_dai_driver dummy_dai = {
94 .name = "snd-soc-dummy-dai", 105 .name = "snd-soc-dummy-dai",
106 .playback = {
107 .stream_name = "Playback",
108 .channels_min = 1,
109 .channels_max = 384,
110 .rates = STUB_RATES,
111 .formats = STUB_FORMATS,
112 },
113 .capture = {
114 .stream_name = "Capture",
115 .channels_min = 1,
116 .channels_max = 384,
117 .rates = STUB_RATES,
118 .formats = STUB_FORMATS,
119 },
95}; 120};
96 121
97static int snd_soc_dummy_probe(struct platform_device *pdev) 122static int snd_soc_dummy_probe(struct platform_device *pdev)