diff options
Diffstat (limited to 'sound/pci/ac97/ac97_patch.c')
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index a444a78c7c94..8bc79cbe3215 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/mutex.h> | ||
31 | |||
30 | #include <sound/core.h> | 32 | #include <sound/core.h> |
31 | #include <sound/pcm.h> | 33 | #include <sound/pcm.h> |
32 | #include <sound/control.h> | 34 | #include <sound/control.h> |
@@ -55,12 +57,12 @@ static int ac97_update_bits_page(struct snd_ac97 *ac97, unsigned short reg, unsi | |||
55 | unsigned short page_save; | 57 | unsigned short page_save; |
56 | int ret; | 58 | int ret; |
57 | 59 | ||
58 | down(&ac97->page_mutex); | 60 | mutex_lock(&ac97->page_mutex); |
59 | page_save = snd_ac97_read(ac97, AC97_INT_PAGING) & AC97_PAGE_MASK; | 61 | page_save = snd_ac97_read(ac97, AC97_INT_PAGING) & AC97_PAGE_MASK; |
60 | snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page); | 62 | snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page); |
61 | ret = snd_ac97_update_bits(ac97, reg, mask, value); | 63 | ret = snd_ac97_update_bits(ac97, reg, mask, value); |
62 | snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save); | 64 | snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save); |
63 | up(&ac97->page_mutex); /* unlock paging */ | 65 | mutex_unlock(&ac97->page_mutex); /* unlock paging */ |
64 | return ret; | 66 | return ret; |
65 | } | 67 | } |
66 | 68 | ||
@@ -897,12 +899,12 @@ static int snd_ac97_stac9708_put_bias(struct snd_kcontrol *kcontrol, struct snd_ | |||
897 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); | 899 | struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); |
898 | int err; | 900 | int err; |
899 | 901 | ||
900 | down(&ac97->page_mutex); | 902 | mutex_lock(&ac97->page_mutex); |
901 | snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0xabba); | 903 | snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0xabba); |
902 | err = snd_ac97_update_bits(ac97, AC97_SIGMATEL_BIAS2, 0x0010, | 904 | err = snd_ac97_update_bits(ac97, AC97_SIGMATEL_BIAS2, 0x0010, |
903 | (ucontrol->value.integer.value[0] & 1) << 4); | 905 | (ucontrol->value.integer.value[0] & 1) << 4); |
904 | snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0); | 906 | snd_ac97_write(ac97, AC97_SIGMATEL_BIAS1, 0); |
905 | up(&ac97->page_mutex); | 907 | mutex_unlock(&ac97->page_mutex); |
906 | return err; | 908 | return err; |
907 | } | 909 | } |
908 | 910 | ||