aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-12 06:33:34 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-12 06:37:23 -0400
commit80f48143ffde97c48c5e550e2fcd2c9f8e77e554 (patch)
tree1e12757fca9f28a65b2df6e3aaa6c97742b79d61 /sound/soc/soc-dapm.c
parentaeb87073f00524dbc4017aba1de5469948d134d4 (diff)
ASoC: Revert widget I/O locking for 3.4
The widget locking depends on some of the other locking changes which are queued up for 3.5 not 3.4 so revert the locking changes and reapply them in 3.5. This reverts commit 66bf93212f19548f5ed221356b2d70189cc18254 and 96acc357bedad69fbc94d1b923a960af5a411c6f. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 1ba2a711b54c..dcd11609f930 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -206,23 +206,7 @@ static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val)
206 return -1; 206 return -1;
207} 207}
208 208
209static inline void soc_widget_lock(struct snd_soc_dapm_widget *w) 209static int soc_widget_update_bits(struct snd_soc_dapm_widget *w,
210{
211 if (w->codec && !w->codec->using_regmap)
212 mutex_lock(&w->codec->mutex);
213 else if (w->platform)
214 mutex_lock(&w->platform->mutex);
215}
216
217static inline void soc_widget_unlock(struct snd_soc_dapm_widget *w)
218{
219 if (w->codec && !w->codec->using_regmap)
220 mutex_unlock(&w->codec->mutex);
221 else if (w->platform)
222 mutex_unlock(&w->platform->mutex);
223}
224
225static int soc_widget_update_bits_locked(struct snd_soc_dapm_widget *w,
226 unsigned short reg, unsigned int mask, unsigned int value) 210 unsigned short reg, unsigned int mask, unsigned int value)
227{ 211{
228 bool change; 212 bool change;
@@ -235,24 +219,18 @@ static int soc_widget_update_bits_locked(struct snd_soc_dapm_widget *w,
235 if (ret != 0) 219 if (ret != 0)
236 return ret; 220 return ret;
237 } else { 221 } else {
238 soc_widget_lock(w);
239 ret = soc_widget_read(w, reg); 222 ret = soc_widget_read(w, reg);
240 if (ret < 0) { 223 if (ret < 0)
241 soc_widget_unlock(w);
242 return ret; 224 return ret;
243 }
244 225
245 old = ret; 226 old = ret;
246 new = (old & ~mask) | (value & mask); 227 new = (old & ~mask) | (value & mask);
247 change = old != new; 228 change = old != new;
248 if (change) { 229 if (change) {
249 ret = soc_widget_write(w, reg, new); 230 ret = soc_widget_write(w, reg, new);
250 if (ret < 0) { 231 if (ret < 0)
251 soc_widget_unlock(w);
252 return ret; 232 return ret;
253 }
254 } 233 }
255 soc_widget_unlock(w);
256 } 234 }
257 235
258 return change; 236 return change;
@@ -869,7 +847,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w,
869 else 847 else
870 val = w->off_val; 848 val = w->off_val;
871 849
872 soc_widget_update_bits_locked(w, -(w->reg + 1), 850 soc_widget_update_bits(w, -(w->reg + 1),
873 w->mask << w->shift, val << w->shift); 851 w->mask << w->shift, val << w->shift);
874 852
875 return 0; 853 return 0;
@@ -1127,7 +1105,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
1127 "pop test : Applying 0x%x/0x%x to %x in %dms\n", 1105 "pop test : Applying 0x%x/0x%x to %x in %dms\n",
1128 value, mask, reg, card->pop_time); 1106 value, mask, reg, card->pop_time);
1129 pop_wait(card->pop_time); 1107 pop_wait(card->pop_time);
1130 soc_widget_update_bits_locked(w, reg, mask, value); 1108 soc_widget_update_bits(w, reg, mask, value);
1131 } 1109 }
1132 1110
1133 list_for_each_entry(w, pending, power_list) { 1111 list_for_each_entry(w, pending, power_list) {
@@ -1257,7 +1235,7 @@ static void dapm_widget_update(struct snd_soc_dapm_context *dapm)
1257 w->name, ret); 1235 w->name, ret);
1258 } 1236 }
1259 1237
1260 ret = soc_widget_update_bits_locked(w, update->reg, update->mask, 1238 ret = snd_soc_update_bits(w->codec, update->reg, update->mask,
1261 update->val); 1239 update->val);
1262 if (ret < 0) 1240 if (ret < 0)
1263 pr_err("%s DAPM update failed: %d\n", w->name, ret); 1241 pr_err("%s DAPM update failed: %d\n", w->name, ret);