diff options
-rw-r--r-- | sound/soc/codecs/wm8903.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index c038b3e04398..ffbe6df3453a 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/regmap.h> | 26 | #include <linux/regmap.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/irq.h> | 28 | #include <linux/irq.h> |
29 | #include <linux/mutex.h> | ||
29 | #include <sound/core.h> | 30 | #include <sound/core.h> |
30 | #include <sound/jack.h> | 31 | #include <sound/jack.h> |
31 | #include <sound/pcm.h> | 32 | #include <sound/pcm.h> |
@@ -123,6 +124,7 @@ struct wm8903_priv { | |||
123 | int sysclk; | 124 | int sysclk; |
124 | int irq; | 125 | int irq; |
125 | 126 | ||
127 | struct mutex lock; | ||
126 | int fs; | 128 | int fs; |
127 | int deemph; | 129 | int deemph; |
128 | 130 | ||
@@ -457,7 +459,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol, | |||
457 | if (deemph > 1) | 459 | if (deemph > 1) |
458 | return -EINVAL; | 460 | return -EINVAL; |
459 | 461 | ||
460 | mutex_lock(&codec->mutex); | 462 | mutex_lock(&wm8903->lock); |
461 | if (wm8903->deemph != deemph) { | 463 | if (wm8903->deemph != deemph) { |
462 | wm8903->deemph = deemph; | 464 | wm8903->deemph = deemph; |
463 | 465 | ||
@@ -465,7 +467,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol, | |||
465 | 467 | ||
466 | ret = 1; | 468 | ret = 1; |
467 | } | 469 | } |
468 | mutex_unlock(&codec->mutex); | 470 | mutex_unlock(&wm8903->lock); |
469 | 471 | ||
470 | return ret; | 472 | return ret; |
471 | } | 473 | } |
@@ -2023,6 +2025,8 @@ static int wm8903_i2c_probe(struct i2c_client *i2c, | |||
2023 | GFP_KERNEL); | 2025 | GFP_KERNEL); |
2024 | if (wm8903 == NULL) | 2026 | if (wm8903 == NULL) |
2025 | return -ENOMEM; | 2027 | return -ENOMEM; |
2028 | |||
2029 | mutex_init(&wm8903->lock); | ||
2026 | wm8903->dev = &i2c->dev; | 2030 | wm8903->dev = &i2c->dev; |
2027 | 2031 | ||
2028 | wm8903->regmap = devm_regmap_init_i2c(i2c, &wm8903_regmap); | 2032 | wm8903->regmap = devm_regmap_init_i2c(i2c, &wm8903_regmap); |