Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
This commit is contained in:
commit
61710a655f
2 changed files with 19 additions and 17 deletions
|
@ -1716,6 +1716,7 @@ card_probe_error:
|
||||||
if (card->remove)
|
if (card->remove)
|
||||||
card->remove(card);
|
card->remove(card);
|
||||||
|
|
||||||
|
snd_soc_dapm_free(&card->dapm);
|
||||||
soc_cleanup_card_debugfs(card);
|
soc_cleanup_card_debugfs(card);
|
||||||
snd_card_free(card->snd_card);
|
snd_card_free(card->snd_card);
|
||||||
|
|
||||||
|
|
|
@ -358,9 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
|
||||||
data->widget =
|
data->widget =
|
||||||
snd_soc_dapm_new_control_unlocked(widget->dapm,
|
snd_soc_dapm_new_control_unlocked(widget->dapm,
|
||||||
&template);
|
&template);
|
||||||
|
kfree(name);
|
||||||
if (!data->widget) {
|
if (!data->widget) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_name;
|
goto err_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -389,11 +390,12 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
|
||||||
|
|
||||||
data->value = template.on_val;
|
data->value = template.on_val;
|
||||||
|
|
||||||
data->widget = snd_soc_dapm_new_control(widget->dapm,
|
data->widget = snd_soc_dapm_new_control_unlocked(
|
||||||
&template);
|
widget->dapm, &template);
|
||||||
|
kfree(name);
|
||||||
if (!data->widget) {
|
if (!data->widget) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_name;
|
goto err_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_soc_dapm_add_path(widget->dapm, data->widget,
|
snd_soc_dapm_add_path(widget->dapm, data->widget,
|
||||||
|
@ -408,8 +410,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_name:
|
|
||||||
kfree(name);
|
|
||||||
err_data:
|
err_data:
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -418,8 +418,6 @@ err_data:
|
||||||
static void dapm_kcontrol_free(struct snd_kcontrol *kctl)
|
static void dapm_kcontrol_free(struct snd_kcontrol *kctl)
|
||||||
{
|
{
|
||||||
struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl);
|
struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl);
|
||||||
if (data->widget)
|
|
||||||
kfree(data->widget->name);
|
|
||||||
kfree(data->wlist);
|
kfree(data->wlist);
|
||||||
kfree(data);
|
kfree(data);
|
||||||
}
|
}
|
||||||
|
@ -1952,6 +1950,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
struct snd_soc_dapm_widget *w = file->private_data;
|
struct snd_soc_dapm_widget *w = file->private_data;
|
||||||
|
struct snd_soc_card *card = w->dapm->card;
|
||||||
char *buf;
|
char *buf;
|
||||||
int in, out;
|
int in, out;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
@ -1961,6 +1960,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
mutex_lock(&card->dapm_mutex);
|
||||||
|
|
||||||
/* Supply widgets are not handled by is_connected_{input,output}_ep() */
|
/* Supply widgets are not handled by is_connected_{input,output}_ep() */
|
||||||
if (w->is_supply) {
|
if (w->is_supply) {
|
||||||
in = 0;
|
in = 0;
|
||||||
|
@ -2007,6 +2008,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
|
||||||
p->sink->name);
|
p->sink->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_unlock(&card->dapm_mutex);
|
||||||
|
|
||||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
||||||
|
|
||||||
kfree(buf);
|
kfree(buf);
|
||||||
|
@ -2281,11 +2284,15 @@ static ssize_t dapm_widget_show(struct device *dev,
|
||||||
struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
|
struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
|
|
||||||
|
mutex_lock(&rtd->card->dapm_mutex);
|
||||||
|
|
||||||
for (i = 0; i < rtd->num_codecs; i++) {
|
for (i = 0; i < rtd->num_codecs; i++) {
|
||||||
struct snd_soc_codec *codec = rtd->codec_dais[i]->codec;
|
struct snd_soc_codec *codec = rtd->codec_dais[i]->codec;
|
||||||
count += dapm_widget_show_codec(codec, buf + count);
|
count += dapm_widget_show_codec(codec, buf + count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_unlock(&rtd->card->dapm_mutex);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3334,16 +3341,10 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix = soc_dapm_prefix(dapm);
|
prefix = soc_dapm_prefix(dapm);
|
||||||
if (prefix) {
|
if (prefix)
|
||||||
w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name);
|
w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name);
|
||||||
if (widget->sname)
|
else
|
||||||
w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix,
|
|
||||||
widget->sname);
|
|
||||||
} else {
|
|
||||||
w->name = kasprintf(GFP_KERNEL, "%s", widget->name);
|
w->name = kasprintf(GFP_KERNEL, "%s", widget->name);
|
||||||
if (widget->sname)
|
|
||||||
w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname);
|
|
||||||
}
|
|
||||||
if (w->name == NULL) {
|
if (w->name == NULL) {
|
||||||
kfree(w);
|
kfree(w);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3792,7 +3793,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!w->sname || !strstr(w->sname, dai_w->name))
|
if (!w->sname || !strstr(w->sname, dai_w->sname))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (dai_w->id == snd_soc_dapm_dai_in) {
|
if (dai_w->id == snd_soc_dapm_dai_in) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue