Commit fd1a2a90 authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-v3.18-2' of...

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.
parents c497d9f9 bdf20b42
...@@ -146,7 +146,7 @@ struct pm860x_priv { ...@@ -146,7 +146,7 @@ struct pm860x_priv {
struct pm860x_det det; struct pm860x_det det;
int irq[4]; int irq[4];
unsigned char name[4][MAX_NAME_LEN]; unsigned char name[4][MAX_NAME_LEN+1];
}; };
/* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */ /* -9450dB to 0dB in 150dB steps ( mute instead of -9450dB) */
......
...@@ -765,12 +765,18 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) ...@@ -765,12 +765,18 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
return -ENOSYS; return -ENOSYS;
ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port); ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port);
if (ret) if (ret) {
goto out; of_node_put(np);
return ret;
}
ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port); ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port);
if (ret) if (ret) {
goto out; of_node_put(np);
return ret;
}
of_node_put(np);
} }
dev_set_drvdata(&pdev->dev, priv); dev_set_drvdata(&pdev->dev, priv);
...@@ -783,8 +789,6 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) ...@@ -783,8 +789,6 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783, ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783,
mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async)); mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async));
out:
of_node_put(np);
return ret; return ret;
} }
......
...@@ -78,7 +78,7 @@ static const struct snd_soc_dapm_widget imx_es8328_dapm_widgets[] = { ...@@ -78,7 +78,7 @@ static const struct snd_soc_dapm_widget imx_es8328_dapm_widgets[] = {
static int imx_es8328_probe(struct platform_device *pdev) static int imx_es8328_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device_node *ssi_np, *codec_np; struct device_node *ssi_np = NULL, *codec_np = NULL;
struct platform_device *ssi_pdev; struct platform_device *ssi_pdev;
struct imx_es8328_data *data; struct imx_es8328_data *data;
u32 int_port, ext_port; u32 int_port, ext_port;
...@@ -104,6 +104,7 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -104,6 +104,7 @@ static int imx_es8328_probe(struct platform_device *pdev)
if (ext_port > MUX_PORT_MAX || ext_port == 0) { if (ext_port > MUX_PORT_MAX || ext_port == 0) {
dev_err(dev, "mux-ext-port: hardware only has %d mux ports\n", dev_err(dev, "mux-ext-port: hardware only has %d mux ports\n",
MUX_PORT_MAX); MUX_PORT_MAX);
ret = -EINVAL;
goto fail; goto fail;
} }
......
...@@ -501,6 +501,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev) ...@@ -501,6 +501,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
priv->snd_card.dai_link = dai_link; priv->snd_card.dai_link = dai_link;
priv->snd_card.num_links = num_links; priv->snd_card.num_links = num_links;
priv->gpio_hp_det = -ENOENT;
priv->gpio_mic_det = -ENOENT;
/* Get room for the other properties */ /* Get room for the other properties */
priv->dai_props = devm_kzalloc(dev, priv->dai_props = devm_kzalloc(dev,
sizeof(*priv->dai_props) * num_links, sizeof(*priv->dai_props) * num_links,
......
...@@ -108,8 +108,10 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) ...@@ -108,8 +108,10 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
while (val) { while (val) {
regmap_read(i2s->regmap, I2S_CLR, &val); regmap_read(i2s->regmap, I2S_CLR, &val);
retry--; retry--;
if (!retry) if (!retry) {
dev_warn(i2s->dev, "fail to clear\n"); dev_warn(i2s->dev, "fail to clear\n");
break;
}
} }
} }
} }
......
...@@ -4192,10 +4192,10 @@ void snd_soc_remove_platform(struct snd_soc_platform *platform) ...@@ -4192,10 +4192,10 @@ void snd_soc_remove_platform(struct snd_soc_platform *platform)
snd_soc_component_del_unlocked(&platform->component); snd_soc_component_del_unlocked(&platform->component);
mutex_unlock(&client_mutex); mutex_unlock(&client_mutex);
snd_soc_component_cleanup(&platform->component);
dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n", dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n",
platform->component.name); platform->component.name);
snd_soc_component_cleanup(&platform->component);
} }
EXPORT_SYMBOL_GPL(snd_soc_remove_platform); EXPORT_SYMBOL_GPL(snd_soc_remove_platform);
......
...@@ -592,9 +592,9 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, ...@@ -592,9 +592,9 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
int shared; int shared;
struct snd_kcontrol *kcontrol; struct snd_kcontrol *kcontrol;
bool wname_in_long_name, kcname_in_long_name; bool wname_in_long_name, kcname_in_long_name;
char *long_name; char *long_name = NULL;
const char *name; const char *name;
int ret; int ret = 0;
prefix = soc_dapm_prefix(dapm); prefix = soc_dapm_prefix(dapm);
if (prefix) if (prefix)
...@@ -653,15 +653,17 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, ...@@ -653,15 +653,17 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name, kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name,
prefix); prefix);
kfree(long_name); if (!kcontrol) {
if (!kcontrol) ret = -ENOMEM;
return -ENOMEM; goto exit_free;
}
kcontrol->private_free = dapm_kcontrol_free; kcontrol->private_free = dapm_kcontrol_free;
ret = dapm_kcontrol_data_alloc(w, kcontrol); ret = dapm_kcontrol_data_alloc(w, kcontrol);
if (ret) { if (ret) {
snd_ctl_free_one(kcontrol); snd_ctl_free_one(kcontrol);
return ret; goto exit_free;
} }
ret = snd_ctl_add(card, kcontrol); 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,17 +671,18 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
dev_err(dapm->dev, dev_err(dapm->dev,
"ASoC: failed to add widget %s dapm kcontrol %s: %d\n", "ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
w->name, name, ret); w->name, name, ret);
return ret; goto exit_free;
} }
} }
ret = dapm_kcontrol_add_widget(kcontrol, w); ret = dapm_kcontrol_add_widget(kcontrol, w);
if (ret) if (ret == 0)
return ret;
w->kcontrols[kci] = kcontrol; w->kcontrols[kci] = kcontrol;
return 0; exit_free:
kfree(long_name);
return ret;
} }
/* create new dapm mixer control */ /* create new dapm mixer control */
......
...@@ -352,7 +352,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) ...@@ -352,7 +352,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream)
} else { } else {
for (i = 0; i < rtd->num_codecs; i++) { for (i = 0; i < rtd->num_codecs; i++) {
codec_dai = rtd->codec_dais[i]; codec_dai = rtd->codec_dais[i];
if (codec_dai->driver->playback.sig_bits == 0) { if (codec_dai->driver->capture.sig_bits == 0) {
bits = 0; bits = 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment