aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-09 01:30:41 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-09 01:30:41 -0400
commitfd1a2a90d08b0052fa52bd36cebd0592c9e537c2 (patch)
tree6a0d03afeb4476803ac37c66b6fa7fb4c03aa5a2
parentc497d9f917542a71e1654b31368d18153b6f1987 (diff)
parentbdf20b4291eaa3b327398b8dd330065ad8e6d3ce (diff)
Merge tag 'asoc-v3.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.18 A few small fixes, mostly small although a few really nasty ones like the interaction between GPIO 0 and simple-card.
-rw-r--r--sound/soc/codecs/88pm860x-codec.c2
-rw-r--r--sound/soc/codecs/mc13783.c16
-rw-r--r--sound/soc/fsl/imx-es8328.c3
-rw-r--r--sound/soc/generic/simple-card.c3
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c4
-rw-r--r--sound/soc/soc-core.c4
-rw-r--r--sound/soc/soc-dapm.c25
-rw-r--r--sound/soc/soc-pcm.c2
8 files changed, 36 insertions, 23 deletions
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 4c3b0af39fd8..e88a6b67f781 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -146,7 +146,7 @@ struct pm860x_priv {
146 struct pm860x_det det; 146 struct pm860x_det det;
147 147
148 int irq[4]; 148 int irq[4];
149 unsigned char name[4][MAX_NAME_LEN]; 149 unsigned char name[4][MAX_NAME_LEN+1];
150}; 150};
151 151
152/* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */ 152/* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 388f90a597fa..71f775aad7c7 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -765,12 +765,18 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
765 return -ENOSYS; 765 return -ENOSYS;
766 766
767 ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port); 767 ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port);
768 if (ret) 768 if (ret) {
769 goto out; 769 of_node_put(np);
770 return ret;
771 }
770 772
771 ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port); 773 ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port);
772 if (ret) 774 if (ret) {
773 goto out; 775 of_node_put(np);
776 return ret;
777 }
778
779 of_node_put(np);
774 } 780 }
775 781
776 dev_set_drvdata(&pdev->dev, priv); 782 dev_set_drvdata(&pdev->dev, priv);
@@ -783,8 +789,6 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
783 ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783, 789 ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783,
784 mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async)); 790 mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async));
785 791
786out:
787 of_node_put(np);
788 return ret; 792 return ret;
789} 793}
790 794
diff --git a/sound/soc/fsl/imx-es8328.c b/sound/soc/fsl/imx-es8328.c
index 653e66d150c8..f8cf10e16ce9 100644
--- a/sound/soc/fsl/imx-es8328.c
+++ b/sound/soc/fsl/imx-es8328.c
@@ -78,7 +78,7 @@ static const struct snd_soc_dapm_widget imx_es8328_dapm_widgets[] = {
78static int imx_es8328_probe(struct platform_device *pdev) 78static int imx_es8328_probe(struct platform_device *pdev)
79{ 79{
80 struct device_node *np = pdev->dev.of_node; 80 struct device_node *np = pdev->dev.of_node;
81 struct device_node *ssi_np, *codec_np; 81 struct device_node *ssi_np = NULL, *codec_np = NULL;
82 struct platform_device *ssi_pdev; 82 struct platform_device *ssi_pdev;
83 struct imx_es8328_data *data; 83 struct imx_es8328_data *data;
84 u32 int_port, ext_port; 84 u32 int_port, ext_port;
@@ -104,6 +104,7 @@ static int imx_es8328_probe(struct platform_device *pdev)
104 if (ext_port > MUX_PORT_MAX || ext_port == 0) { 104 if (ext_port > MUX_PORT_MAX || ext_port == 0) {
105 dev_err(dev, "mux-ext-port: hardware only has %d mux ports\n", 105 dev_err(dev, "mux-ext-port: hardware only has %d mux ports\n",
106 MUX_PORT_MAX); 106 MUX_PORT_MAX);
107 ret = -EINVAL;
107 goto fail; 108 goto fail;
108 } 109 }
109 110
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fcb431fe20b4..d1b7293c133e 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -501,6 +501,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
501 priv->snd_card.dai_link = dai_link; 501 priv->snd_card.dai_link = dai_link;
502 priv->snd_card.num_links = num_links; 502 priv->snd_card.num_links = num_links;
503 503
504 priv->gpio_hp_det = -ENOENT;
505 priv->gpio_mic_det = -ENOENT;
506
504 /* Get room for the other properties */ 507 /* Get room for the other properties */
505 priv->dai_props = devm_kzalloc(dev, 508 priv->dai_props = devm_kzalloc(dev,
506 sizeof(*priv->dai_props) * num_links, 509 sizeof(*priv->dai_props) * num_links,
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 033487c9a164..f373e37f8305 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -108,8 +108,10 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
108 while (val) { 108 while (val) {
109 regmap_read(i2s->regmap, I2S_CLR, &val); 109 regmap_read(i2s->regmap, I2S_CLR, &val);
110 retry--; 110 retry--;
111 if (!retry) 111 if (!retry) {
112 dev_warn(i2s->dev, "fail to clear\n"); 112 dev_warn(i2s->dev, "fail to clear\n");
113 break;
114 }
113 } 115 }
114 } 116 }
115 } 117 }
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3d8cff629a18..4c8f8a23a0e9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4192,10 +4192,10 @@ void snd_soc_remove_platform(struct snd_soc_platform *platform)
4192 snd_soc_component_del_unlocked(&platform->component); 4192 snd_soc_component_del_unlocked(&platform->component);
4193 mutex_unlock(&client_mutex); 4193 mutex_unlock(&client_mutex);
4194 4194
4195 snd_soc_component_cleanup(&platform->component);
4196
4197 dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n", 4195 dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n",
4198 platform->component.name); 4196 platform->component.name);
4197
4198 snd_soc_component_cleanup(&platform->component);
4199} 4199}
4200EXPORT_SYMBOL_GPL(snd_soc_remove_platform); 4200EXPORT_SYMBOL_GPL(snd_soc_remove_platform);
4201 4201
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 2c456a376ade..c61cb9cedbcd 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -592,9 +592,9 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
592 int shared; 592 int shared;
593 struct snd_kcontrol *kcontrol; 593 struct snd_kcontrol *kcontrol;
594 bool wname_in_long_name, kcname_in_long_name; 594 bool wname_in_long_name, kcname_in_long_name;
595 char *long_name; 595 char *long_name = NULL;
596 const char *name; 596 const char *name;
597 int ret; 597 int ret = 0;
598 598
599 prefix = soc_dapm_prefix(dapm); 599 prefix = soc_dapm_prefix(dapm);
600 if (prefix) 600 if (prefix)
@@ -653,15 +653,17 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
653 653
654 kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name, 654 kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name,
655 prefix); 655 prefix);
656 kfree(long_name); 656 if (!kcontrol) {
657 if (!kcontrol) 657 ret = -ENOMEM;
658 return -ENOMEM; 658 goto exit_free;
659 }
660
659 kcontrol->private_free = dapm_kcontrol_free; 661 kcontrol->private_free = dapm_kcontrol_free;
660 662
661 ret = dapm_kcontrol_data_alloc(w, kcontrol); 663 ret = dapm_kcontrol_data_alloc(w, kcontrol);
662 if (ret) { 664 if (ret) {
663 snd_ctl_free_one(kcontrol); 665 snd_ctl_free_one(kcontrol);
664 return ret; 666 goto exit_free;
665 } 667 }
666 668
667 ret = snd_ctl_add(card, kcontrol); 669 ret = snd_ctl_add(card, kcontrol);
@@ -669,17 +671,18 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
669 dev_err(dapm->dev, 671 dev_err(dapm->dev,
670 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", 672 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
671 w->name, name, ret); 673 w->name, name, ret);
672 return ret; 674 goto exit_free;
673 } 675 }
674 } 676 }
675 677
676 ret = dapm_kcontrol_add_widget(kcontrol, w); 678 ret = dapm_kcontrol_add_widget(kcontrol, w);
677 if (ret) 679 if (ret == 0)
678 return ret; 680 w->kcontrols[kci] = kcontrol;
679 681
680 w->kcontrols[kci] = kcontrol; 682exit_free:
683 kfree(long_name);
681 684
682 return 0; 685 return ret;
683} 686}
684 687
685/* create new dapm mixer control */ 688/* create new dapm mixer control */
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 642c86240752..002311afdeaa 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -352,7 +352,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
352 } else { 352 } else {
353 for (i = 0; i < rtd->num_codecs; i++) { 353 for (i = 0; i < rtd->num_codecs; i++) {
354 codec_dai = rtd->codec_dais[i]; 354 codec_dai = rtd->codec_dais[i];
355 if (codec_dai->driver->playback.sig_bits == 0) { 355 if (codec_dai->driver->capture.sig_bits == 0) {
356 bits = 0; 356 bits = 0;
357 break; 357 break;
358 } 358 }