Commit d4c6005f authored by Mark Brown's avatar Mark Brown

ASoC: Add context parameter to card DAPM callbacks

The card callback will get called for each DAPM context in the card so it
can be useful for it to know which device is currently undergoing a
transition.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 171ec6b0
...@@ -726,8 +726,10 @@ struct snd_soc_card { ...@@ -726,8 +726,10 @@ struct snd_soc_card {
/* callbacks */ /* callbacks */
int (*set_bias_level)(struct snd_soc_card *, int (*set_bias_level)(struct snd_soc_card *,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level); enum snd_soc_bias_level level);
int (*set_bias_level_post)(struct snd_soc_card *, int (*set_bias_level_post)(struct snd_soc_card *,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level); enum snd_soc_bias_level level);
long pmdown_time; long pmdown_time;
......
...@@ -92,6 +92,7 @@ static struct snd_soc_ops at91sam9g20ek_ops = { ...@@ -92,6 +92,7 @@ static struct snd_soc_ops at91sam9g20ek_ops = {
}; };
static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
static int mclk_on; static int mclk_on;
......
...@@ -427,6 +427,7 @@ static struct snd_soc_ops ams_delta_ops = { ...@@ -427,6 +427,7 @@ static struct snd_soc_ops ams_delta_ops = {
/* Board specific codec bias level control */ /* Board specific codec bias level control */
static int ams_delta_set_bias_level(struct snd_soc_card *card, static int ams_delta_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct snd_soc_codec *codec = card->rtd->codec; struct snd_soc_codec *codec = card->rtd->codec;
......
...@@ -20,11 +20,15 @@ ...@@ -20,11 +20,15 @@
#define WM8915_HPSEL_GPIO 214 #define WM8915_HPSEL_GPIO 214
static int speyside_set_bias_level(struct snd_soc_card *card, static int speyside_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
int ret; int ret;
if (dapm->dev != codec_dai->dev)
return 0;
switch (level) { switch (level) {
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_MCLK2, ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_MCLK2,
......
...@@ -142,7 +142,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, ...@@ -142,7 +142,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
trace_snd_soc_bias_level_start(card, level); trace_snd_soc_bias_level_start(card, level);
if (card && card->set_bias_level) if (card && card->set_bias_level)
ret = card->set_bias_level(card, level); ret = card->set_bias_level(card, dapm, level);
if (ret != 0) if (ret != 0)
goto out; goto out;
...@@ -154,7 +154,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, ...@@ -154,7 +154,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
goto out; goto out;
if (card && card->set_bias_level_post) if (card && card->set_bias_level_post)
ret = card->set_bias_level_post(card, level); ret = card->set_bias_level_post(card, dapm, level);
out: out:
trace_snd_soc_bias_level_done(card, level); trace_snd_soc_bias_level_done(card, level);
......
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