Skip to content

Commit

Permalink
ASoC: dont call dapm_sync while reporting jack always
Browse files Browse the repository at this point in the history
While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
always. This should be required when we have pins associated with jack and
reporting enables or disables these.
So add a check for this case

Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Vinod Koul authored and broonie committed Oct 22, 2013
1 parent 1dd275b commit 30a765d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/soc-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
struct snd_soc_codec *codec;
struct snd_soc_dapm_context *dapm;
struct snd_soc_jack_pin *pin;
unsigned int sync = 0;
int enable;

trace_snd_soc_jack_report(jack, mask, status);
Expand Down Expand Up @@ -92,12 +93,16 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
snd_soc_dapm_enable_pin(dapm, pin->pin);
else
snd_soc_dapm_disable_pin(dapm, pin->pin);

/* we need to sync for this case only */
sync = 1;
}

/* Report before the DAPM sync to help users updating micbias status */
blocking_notifier_call_chain(&jack->notifier, jack->status, jack);

snd_soc_dapm_sync(dapm);
if (sync)
snd_soc_dapm_sync(dapm);

snd_jack_report(jack->jack, jack->status);

Expand Down

0 comments on commit 30a765d

Please sign in to comment.