Commit 8538a119 authored by Eero Nurkkala's avatar Eero Nurkkala Committed by Mark Brown

ASoC: remove io_mutex

Remove the io_mutex. It has a drawback of serializing
all accesses to snd_soc_update_bits() even when multiple
codecs are in use. In addition, it fails to actually do
its task - during snd_soc_update_bits(), dapm_update_bits()
may also be accessing the same register which may result in
an outdated register value.
Signed-off-by: default avatarEero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 98078bf9
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <sound/initval.h> #include <sound/initval.h>
static DEFINE_MUTEX(pcm_mutex); static DEFINE_MUTEX(pcm_mutex);
static DEFINE_MUTEX(io_mutex);
static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq); static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
...@@ -1346,14 +1345,12 @@ int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, ...@@ -1346,14 +1345,12 @@ int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
int change; int change;
unsigned int old, new; unsigned int old, new;
mutex_lock(&io_mutex);
old = snd_soc_read(codec, reg); old = snd_soc_read(codec, reg);
new = (old & ~mask) | value; new = (old & ~mask) | value;
change = old != new; change = old != new;
if (change) if (change)
snd_soc_write(codec, reg, new); snd_soc_write(codec, reg, new);
mutex_unlock(&io_mutex);
return change; return change;
} }
EXPORT_SYMBOL_GPL(snd_soc_update_bits); EXPORT_SYMBOL_GPL(snd_soc_update_bits);
...@@ -1376,11 +1373,9 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, ...@@ -1376,11 +1373,9 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
int change; int change;
unsigned int old, new; unsigned int old, new;
mutex_lock(&io_mutex);
old = snd_soc_read(codec, reg); old = snd_soc_read(codec, reg);
new = (old & ~mask) | value; new = (old & ~mask) | value;
change = old != new; change = old != new;
mutex_unlock(&io_mutex);
return change; return change;
} }
......
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