soc_dapm_async_complete(d);
}
-static void dapm_widget_update(struct snd_soc_card *card)
+static void dapm_widget_update(struct snd_soc_card *card, struct snd_soc_dapm_update *update)
{
- struct snd_soc_dapm_update *update = card->update;
struct snd_soc_dapm_widget_list *wlist;
struct snd_soc_dapm_widget *w = NULL;
unsigned int wi;
* o Input pin to Output pin (bypass, sidetone)
* o DAC to ADC (loopback).
*/
-static int dapm_power_widgets(struct snd_soc_card *card, int event)
+static int dapm_power_widgets(struct snd_soc_card *card, int event,
+ struct snd_soc_dapm_update *update)
{
struct snd_soc_dapm_widget *w;
struct snd_soc_dapm_context *d;
/* Power down widgets first; try to avoid amplifying pops. */
dapm_seq_run(card, &down_list, event, false);
- dapm_widget_update(card);
+ dapm_widget_update(card, update);
/* Now power up. */
dapm_seq_run(card, &up_list, event, true);
/* test and update the power status of a mux widget */
static int soc_dapm_mux_update_power(struct snd_soc_card *card,
- struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e)
+ struct snd_kcontrol *kcontrol,
+ struct snd_soc_dapm_update *update,
+ int mux, struct soc_enum *e)
{
struct snd_soc_dapm_path *path;
int found = 0;
}
if (found)
- dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
+ dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, update);
return found;
}
int ret;
snd_soc_dapm_mutex_lock(card);
- card->update = update;
- ret = soc_dapm_mux_update_power(card, kcontrol, mux, e);
- card->update = NULL;
+ ret = soc_dapm_mux_update_power(card, kcontrol, update, mux, e);
snd_soc_dapm_mutex_unlock(card);
if (ret > 0)
snd_soc_dpcm_runtime_update(card);
/* test and update the power status of a mixer or switch widget */
static int soc_dapm_mixer_update_power(struct snd_soc_card *card,
struct snd_kcontrol *kcontrol,
+ struct snd_soc_dapm_update *update,
int connect, int rconnect)
{
struct snd_soc_dapm_path *path;
}
if (found)
- dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
+ dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, update);
return found;
}
int ret;
snd_soc_dapm_mutex_lock(card);
- card->update = update;
- ret = soc_dapm_mixer_update_power(card, kcontrol, connect, -1);
- card->update = NULL;
+ ret = soc_dapm_mixer_update_power(card, kcontrol, update, connect, -1);
snd_soc_dapm_mutex_unlock(card);
if (ret > 0)
snd_soc_dpcm_runtime_update(card);
if (!snd_soc_card_is_instantiated(dapm->card))
return 0;
- return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP);
+ return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP, NULL);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_sync_unlocked);
dapm_debugfs_add_widget(w);
}
- dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
+ dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP, NULL);
snd_soc_dapm_mutex_unlock(card);
return 0;
}
unsigned int val, rval = 0;
int connect, rconnect = -1, change, reg_change = 0;
struct snd_soc_dapm_update update = {};
+ struct snd_soc_dapm_update *pupdate = NULL;
int ret = 0;
val = (ucontrol->value.integer.value[0] & mask);
update.reg = reg;
update.mask = mask << shift;
update.val = val;
- card->update = &update;
+ pupdate = &update;
}
-
- ret = soc_dapm_mixer_update_power(card, kcontrol, connect,
- rconnect);
-
- card->update = NULL;
+ ret = soc_dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect);
}
snd_soc_dapm_mutex_unlock(card);
unsigned int val, change, reg_change = 0;
unsigned int mask;
struct snd_soc_dapm_update update = {};
+ struct snd_soc_dapm_update *pupdate = NULL;
int ret = 0;
if (item[0] >= e->items)
update.reg = e->reg;
update.mask = mask;
update.val = val;
- card->update = &update;
+ pupdate = &update;
}
-
- ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e);
-
- card->update = NULL;
+ ret = soc_dapm_mux_update_power(card, kcontrol, pupdate, item[0], e);
}
snd_soc_dapm_mutex_unlock(card);
for_each_rtd_dais(rtd, i, dai)
soc_dapm_dai_stream_event(dai, stream, event);
- dapm_power_widgets(rtd->card, event);
+ dapm_power_widgets(rtd->card, event, NULL);
}
/**