aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc-dapm.h10
-rw-r--r--sound/soc/soc-dapm.c16
2 files changed, 20 insertions, 6 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index a7def6a9a030..fcc929da0339 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -140,9 +140,19 @@
140#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 140#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
141{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 141{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
142 .shift = wshift, .invert = winvert} 142 .shift = wshift, .invert = winvert}
143#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
144 wevent, wflags) \
145{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
146 .shift = wshift, .invert = winvert, \
147 .event = wevent, .event_flags = wflags}
143#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 148#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
144{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 149{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
145 .shift = wshift, .invert = winvert} 150 .shift = wshift, .invert = winvert}
151#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
152 wevent, wflags) \
153{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
154 .shift = wshift, .invert = winvert, \
155 .event = wevent, .event_flags = wflags}
146 156
147/* generic register modifier widget */ 157/* generic register modifier widget */
148#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 158#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 713d12586705..a6d73379ab32 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -598,18 +598,22 @@ static int dapm_power_widget(struct snd_soc_codec *codec, int event,
598 if (w->id == snd_soc_dapm_adc && w->active) { 598 if (w->id == snd_soc_dapm_adc && w->active) {
599 in = is_connected_input_ep(w); 599 in = is_connected_input_ep(w);
600 dapm_clear_walk(w->codec); 600 dapm_clear_walk(w->codec);
601 w->power = (in != 0) ? 1 : 0; 601 power = (in != 0) ? 1 : 0;
602 dapm_update_bits(w); 602 if (power == w->power)
603 return 0; 603 return 0;
604 w->power = power;
605 return dapm_generic_apply_power(w);
604 } 606 }
605 607
606 /* active DAC */ 608 /* active DAC */
607 if (w->id == snd_soc_dapm_dac && w->active) { 609 if (w->id == snd_soc_dapm_dac && w->active) {
608 out = is_connected_output_ep(w); 610 out = is_connected_output_ep(w);
609 dapm_clear_walk(w->codec); 611 dapm_clear_walk(w->codec);
610 w->power = (out != 0) ? 1 : 0; 612 power = (out != 0) ? 1 : 0;
611 dapm_update_bits(w); 613 if (power == w->power)
612 return 0; 614 return 0;
615 w->power = power;
616 return dapm_generic_apply_power(w);
613 } 617 }
614 618
615 /* pre and post event widgets */ 619 /* pre and post event widgets */