diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 10:34:20 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:25:29 -0500 |
commit | 62932df8fb20ba2fb53a95fa52445eba22e821fe (patch) | |
tree | 335178d7438395a68a453a9c23624b3e9fc5ec40 /sound/pci/ice1712 | |
parent | 8b7547f95cbe8a5940df62ed730646fdfcba5fda (diff) |
[ALSA] semaphore -> mutex (PCI part)
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r-- | sound/pci/ice1712/aureon.c | 38 | ||||
-rw-r--r-- | sound/pci/ice1712/delta.c | 26 | ||||
-rw-r--r-- | sound/pci/ice1712/hoontech.c | 26 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 7 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1712.h | 10 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 37 | ||||
-rw-r--r-- | sound/pci/ice1712/phase.c | 10 | ||||
-rw-r--r-- | sound/pci/ice1712/pontis.c | 86 |
8 files changed, 126 insertions, 114 deletions
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 2175f6721347..0f7f4d8263c0 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <linux/interrupt.h> | 53 | #include <linux/interrupt.h> |
54 | #include <linux/init.h> | 54 | #include <linux/init.h> |
55 | #include <linux/slab.h> | 55 | #include <linux/slab.h> |
56 | #include <linux/mutex.h> | ||
57 | |||
56 | #include <sound/core.h> | 58 | #include <sound/core.h> |
57 | 59 | ||
58 | #include "ice1712.h" | 60 | #include "ice1712.h" |
@@ -210,14 +212,14 @@ static int aureon_ac97_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
210 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 212 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
211 | unsigned short vol; | 213 | unsigned short vol; |
212 | 214 | ||
213 | down(&ice->gpio_mutex); | 215 | mutex_lock(&ice->gpio_mutex); |
214 | 216 | ||
215 | vol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F); | 217 | vol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F); |
216 | ucontrol->value.integer.value[0] = 0x1F - (vol & 0x1F); | 218 | ucontrol->value.integer.value[0] = 0x1F - (vol & 0x1F); |
217 | if (kcontrol->private_value & AUREON_AC97_STEREO) | 219 | if (kcontrol->private_value & AUREON_AC97_STEREO) |
218 | ucontrol->value.integer.value[1] = 0x1F - ((vol >> 8) & 0x1F); | 220 | ucontrol->value.integer.value[1] = 0x1F - ((vol >> 8) & 0x1F); |
219 | 221 | ||
220 | up(&ice->gpio_mutex); | 222 | mutex_unlock(&ice->gpio_mutex); |
221 | return 0; | 223 | return 0; |
222 | } | 224 | } |
223 | 225 | ||
@@ -252,11 +254,11 @@ static int aureon_ac97_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
252 | { | 254 | { |
253 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 255 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
254 | 256 | ||
255 | down(&ice->gpio_mutex); | 257 | mutex_lock(&ice->gpio_mutex); |
256 | 258 | ||
257 | ucontrol->value.integer.value[0] = aureon_ac97_read(ice, kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1; | 259 | ucontrol->value.integer.value[0] = aureon_ac97_read(ice, kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1; |
258 | 260 | ||
259 | up(&ice->gpio_mutex); | 261 | mutex_unlock(&ice->gpio_mutex); |
260 | return 0; | 262 | return 0; |
261 | } | 263 | } |
262 | 264 | ||
@@ -288,11 +290,11 @@ static int aureon_ac97_micboost_get(struct snd_kcontrol *kcontrol, struct snd_ct | |||
288 | { | 290 | { |
289 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 291 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
290 | 292 | ||
291 | down(&ice->gpio_mutex); | 293 | mutex_lock(&ice->gpio_mutex); |
292 | 294 | ||
293 | ucontrol->value.integer.value[0] = aureon_ac97_read(ice, AC97_MIC) & 0x0020 ? 0 : 1; | 295 | ucontrol->value.integer.value[0] = aureon_ac97_read(ice, AC97_MIC) & 0x0020 ? 0 : 1; |
294 | 296 | ||
295 | up(&ice->gpio_mutex); | 297 | mutex_unlock(&ice->gpio_mutex); |
296 | return 0; | 298 | return 0; |
297 | } | 299 | } |
298 | 300 | ||
@@ -488,11 +490,11 @@ static int aureon_ac97_mmute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e | |||
488 | { | 490 | { |
489 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 491 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
490 | 492 | ||
491 | down(&ice->gpio_mutex); | 493 | mutex_lock(&ice->gpio_mutex); |
492 | 494 | ||
493 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_OUT_MUX1) >> 1) & 0x01; | 495 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_OUT_MUX1) >> 1) & 0x01; |
494 | 496 | ||
495 | up(&ice->gpio_mutex); | 497 | mutex_unlock(&ice->gpio_mutex); |
496 | return 0; | 498 | return 0; |
497 | } | 499 | } |
498 | 500 | ||
@@ -557,9 +559,9 @@ static int wm_pcm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
557 | { | 559 | { |
558 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 560 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
559 | 561 | ||
560 | down(&ice->gpio_mutex); | 562 | mutex_lock(&ice->gpio_mutex); |
561 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? 0 : 1; | 563 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? 0 : 1; |
562 | up(&ice->gpio_mutex); | 564 | mutex_unlock(&ice->gpio_mutex); |
563 | return 0; | 565 | return 0; |
564 | } | 566 | } |
565 | 567 | ||
@@ -782,11 +784,11 @@ static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
782 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 784 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
783 | unsigned short val; | 785 | unsigned short val; |
784 | 786 | ||
785 | down(&ice->gpio_mutex); | 787 | mutex_lock(&ice->gpio_mutex); |
786 | val = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; | 788 | val = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; |
787 | val = val > PCM_MIN ? (val - PCM_MIN) : 0; | 789 | val = val > PCM_MIN ? (val - PCM_MIN) : 0; |
788 | ucontrol->value.integer.value[0] = val; | 790 | ucontrol->value.integer.value[0] = val; |
789 | up(&ice->gpio_mutex); | 791 | mutex_unlock(&ice->gpio_mutex); |
790 | return 0; | 792 | return 0; |
791 | } | 793 | } |
792 | 794 | ||
@@ -827,12 +829,12 @@ static int wm_adc_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
827 | unsigned short val; | 829 | unsigned short val; |
828 | int i; | 830 | int i; |
829 | 831 | ||
830 | down(&ice->gpio_mutex); | 832 | mutex_lock(&ice->gpio_mutex); |
831 | for (i = 0; i < 2; i++) { | 833 | for (i = 0; i < 2; i++) { |
832 | val = wm_get(ice, WM_ADC_GAIN + i); | 834 | val = wm_get(ice, WM_ADC_GAIN + i); |
833 | ucontrol->value.integer.value[i] = ~val>>5 & 0x1; | 835 | ucontrol->value.integer.value[i] = ~val>>5 & 0x1; |
834 | } | 836 | } |
835 | up(&ice->gpio_mutex); | 837 | mutex_unlock(&ice->gpio_mutex); |
836 | return 0; | 838 | return 0; |
837 | } | 839 | } |
838 | 840 | ||
@@ -874,13 +876,13 @@ static int wm_adc_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
874 | int i, idx; | 876 | int i, idx; |
875 | unsigned short vol; | 877 | unsigned short vol; |
876 | 878 | ||
877 | down(&ice->gpio_mutex); | 879 | mutex_lock(&ice->gpio_mutex); |
878 | for (i = 0; i < 2; i++) { | 880 | for (i = 0; i < 2; i++) { |
879 | idx = WM_ADC_GAIN + i; | 881 | idx = WM_ADC_GAIN + i; |
880 | vol = wm_get(ice, idx) & 0x1f; | 882 | vol = wm_get(ice, idx) & 0x1f; |
881 | ucontrol->value.integer.value[i] = vol; | 883 | ucontrol->value.integer.value[i] = vol; |
882 | } | 884 | } |
883 | up(&ice->gpio_mutex); | 885 | mutex_unlock(&ice->gpio_mutex); |
884 | return 0; | 886 | return 0; |
885 | } | 887 | } |
886 | 888 | ||
@@ -951,11 +953,11 @@ static int wm_adc_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
951 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 953 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
952 | unsigned short val; | 954 | unsigned short val; |
953 | 955 | ||
954 | down(&ice->gpio_mutex); | 956 | mutex_lock(&ice->gpio_mutex); |
955 | val = wm_get(ice, WM_ADC_MUX); | 957 | val = wm_get(ice, WM_ADC_MUX); |
956 | ucontrol->value.integer.value[0] = val & 7; | 958 | ucontrol->value.integer.value[0] = val & 7; |
957 | ucontrol->value.integer.value[1] = (val >> 4) & 7; | 959 | ucontrol->value.integer.value[1] = (val >> 4) & 7; |
958 | up(&ice->gpio_mutex); | 960 | mutex_unlock(&ice->gpio_mutex); |
959 | return 0; | 961 | return 0; |
960 | } | 962 | } |
961 | 963 | ||
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 9a51d34e6817..4bbf1e2ae653 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/mutex.h> | ||
32 | |||
31 | #include <sound/core.h> | 33 | #include <sound/core.h> |
32 | #include <sound/cs8427.h> | 34 | #include <sound/cs8427.h> |
33 | #include <sound/asoundef.h> | 35 | #include <sound/asoundef.h> |
@@ -130,13 +132,13 @@ static int ap_cs8427_sendbytes(struct snd_i2c_device *device, unsigned char *byt | |||
130 | int res = count; | 132 | int res = count; |
131 | unsigned char tmp; | 133 | unsigned char tmp; |
132 | 134 | ||
133 | down(&ice->gpio_mutex); | 135 | mutex_lock(&ice->gpio_mutex); |
134 | tmp = ap_cs8427_codec_select(ice); | 136 | tmp = ap_cs8427_codec_select(ice); |
135 | ap_cs8427_write_byte(ice, (device->addr << 1) | 0, tmp); /* address + write mode */ | 137 | ap_cs8427_write_byte(ice, (device->addr << 1) | 0, tmp); /* address + write mode */ |
136 | while (count-- > 0) | 138 | while (count-- > 0) |
137 | ap_cs8427_write_byte(ice, *bytes++, tmp); | 139 | ap_cs8427_write_byte(ice, *bytes++, tmp); |
138 | ap_cs8427_codec_deassert(ice, tmp); | 140 | ap_cs8427_codec_deassert(ice, tmp); |
139 | up(&ice->gpio_mutex); | 141 | mutex_unlock(&ice->gpio_mutex); |
140 | return res; | 142 | return res; |
141 | } | 143 | } |
142 | 144 | ||
@@ -147,13 +149,13 @@ static int ap_cs8427_readbytes(struct snd_i2c_device *device, unsigned char *byt | |||
147 | int res = count; | 149 | int res = count; |
148 | unsigned char tmp; | 150 | unsigned char tmp; |
149 | 151 | ||
150 | down(&ice->gpio_mutex); | 152 | mutex_lock(&ice->gpio_mutex); |
151 | tmp = ap_cs8427_codec_select(ice); | 153 | tmp = ap_cs8427_codec_select(ice); |
152 | ap_cs8427_write_byte(ice, (device->addr << 1) | 1, tmp); /* address + read mode */ | 154 | ap_cs8427_write_byte(ice, (device->addr << 1) | 1, tmp); /* address + read mode */ |
153 | while (count-- > 0) | 155 | while (count-- > 0) |
154 | *bytes++ = ap_cs8427_read_byte(ice, tmp); | 156 | *bytes++ = ap_cs8427_read_byte(ice, tmp); |
155 | ap_cs8427_codec_deassert(ice, tmp); | 157 | ap_cs8427_codec_deassert(ice, tmp); |
156 | up(&ice->gpio_mutex); | 158 | mutex_unlock(&ice->gpio_mutex); |
157 | return res; | 159 | return res; |
158 | } | 160 | } |
159 | 161 | ||
@@ -180,7 +182,7 @@ static void snd_ice1712_delta_cs8403_spdif_write(struct snd_ice1712 *ice, unsign | |||
180 | /* send byte to transmitter */ | 182 | /* send byte to transmitter */ |
181 | mask1 = ICE1712_DELTA_SPDIF_OUT_STAT_CLOCK; | 183 | mask1 = ICE1712_DELTA_SPDIF_OUT_STAT_CLOCK; |
182 | mask2 = ICE1712_DELTA_SPDIF_OUT_STAT_DATA; | 184 | mask2 = ICE1712_DELTA_SPDIF_OUT_STAT_DATA; |
183 | down(&ice->gpio_mutex); | 185 | mutex_lock(&ice->gpio_mutex); |
184 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); | 186 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); |
185 | for (idx = 7; idx >= 0; idx--) { | 187 | for (idx = 7; idx >= 0; idx--) { |
186 | tmp &= ~(mask1 | mask2); | 188 | tmp &= ~(mask1 | mask2); |
@@ -194,7 +196,7 @@ static void snd_ice1712_delta_cs8403_spdif_write(struct snd_ice1712 *ice, unsign | |||
194 | } | 196 | } |
195 | tmp &= ~mask1; | 197 | tmp &= ~mask1; |
196 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); | 198 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); |
197 | up(&ice->gpio_mutex); | 199 | mutex_unlock(&ice->gpio_mutex); |
198 | } | 200 | } |
199 | 201 | ||
200 | 202 | ||
@@ -296,14 +298,14 @@ static void delta_1010_set_rate_val(struct snd_ice1712 *ice, unsigned int rate) | |||
296 | if (rate == 0) /* no hint - S/PDIF input is master, simply return */ | 298 | if (rate == 0) /* no hint - S/PDIF input is master, simply return */ |
297 | return; | 299 | return; |
298 | 300 | ||
299 | down(&ice->gpio_mutex); | 301 | mutex_lock(&ice->gpio_mutex); |
300 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); | 302 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); |
301 | tmp2 = tmp & ~ICE1712_DELTA_DFS; | 303 | tmp2 = tmp & ~ICE1712_DELTA_DFS; |
302 | if (rate > 48000) | 304 | if (rate > 48000) |
303 | tmp2 |= ICE1712_DELTA_DFS; | 305 | tmp2 |= ICE1712_DELTA_DFS; |
304 | if (tmp != tmp2) | 306 | if (tmp != tmp2) |
305 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp2); | 307 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp2); |
306 | up(&ice->gpio_mutex); | 308 | mutex_unlock(&ice->gpio_mutex); |
307 | } | 309 | } |
308 | 310 | ||
309 | /* | 311 | /* |
@@ -318,9 +320,9 @@ static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
318 | return; | 320 | return; |
319 | 321 | ||
320 | /* check before reset ak4524 to avoid unnecessary clicks */ | 322 | /* check before reset ak4524 to avoid unnecessary clicks */ |
321 | down(&ice->gpio_mutex); | 323 | mutex_lock(&ice->gpio_mutex); |
322 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); | 324 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); |
323 | up(&ice->gpio_mutex); | 325 | mutex_unlock(&ice->gpio_mutex); |
324 | tmp2 = tmp & ~ICE1712_DELTA_DFS; | 326 | tmp2 = tmp & ~ICE1712_DELTA_DFS; |
325 | if (rate > 48000) | 327 | if (rate > 48000) |
326 | tmp2 |= ICE1712_DELTA_DFS; | 328 | tmp2 |= ICE1712_DELTA_DFS; |
@@ -329,12 +331,12 @@ static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
329 | 331 | ||
330 | /* do it again */ | 332 | /* do it again */ |
331 | snd_akm4xxx_reset(ak, 1); | 333 | snd_akm4xxx_reset(ak, 1); |
332 | down(&ice->gpio_mutex); | 334 | mutex_lock(&ice->gpio_mutex); |
333 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ~ICE1712_DELTA_DFS; | 335 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ~ICE1712_DELTA_DFS; |
334 | if (rate > 48000) | 336 | if (rate > 48000) |
335 | tmp |= ICE1712_DELTA_DFS; | 337 | tmp |= ICE1712_DELTA_DFS; |
336 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); | 338 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); |
337 | up(&ice->gpio_mutex); | 339 | mutex_unlock(&ice->gpio_mutex); |
338 | snd_akm4xxx_reset(ak, 0); | 340 | snd_akm4xxx_reset(ak, 0); |
339 | } | 341 | } |
340 | 342 | ||
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c index 3f2f918536f5..3f27d04e7d3c 100644 --- a/sound/pci/ice1712/hoontech.c +++ b/sound/pci/ice1712/hoontech.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.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 | 33 | ||
32 | #include "ice1712.h" | 34 | #include "ice1712.h" |
@@ -48,31 +50,31 @@ static void __devinit snd_ice1712_stdsp24_gpio_write(struct snd_ice1712 *ice, un | |||
48 | 50 | ||
49 | static void __devinit snd_ice1712_stdsp24_darear(struct snd_ice1712 *ice, int activate) | 51 | static void __devinit snd_ice1712_stdsp24_darear(struct snd_ice1712 *ice, int activate) |
50 | { | 52 | { |
51 | down(&ice->gpio_mutex); | 53 | mutex_lock(&ice->gpio_mutex); |
52 | ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate); | 54 | ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate); |
53 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[0]); | 55 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[0]); |
54 | up(&ice->gpio_mutex); | 56 | mutex_unlock(&ice->gpio_mutex); |
55 | } | 57 | } |
56 | 58 | ||
57 | static void __devinit snd_ice1712_stdsp24_mute(struct snd_ice1712 *ice, int activate) | 59 | static void __devinit snd_ice1712_stdsp24_mute(struct snd_ice1712 *ice, int activate) |
58 | { | 60 | { |
59 | down(&ice->gpio_mutex); | 61 | mutex_lock(&ice->gpio_mutex); |
60 | ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate); | 62 | ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate); |
61 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); | 63 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
62 | up(&ice->gpio_mutex); | 64 | mutex_unlock(&ice->gpio_mutex); |
63 | } | 65 | } |
64 | 66 | ||
65 | static void __devinit snd_ice1712_stdsp24_insel(struct snd_ice1712 *ice, int activate) | 67 | static void __devinit snd_ice1712_stdsp24_insel(struct snd_ice1712 *ice, int activate) |
66 | { | 68 | { |
67 | down(&ice->gpio_mutex); | 69 | mutex_lock(&ice->gpio_mutex); |
68 | ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate); | 70 | ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate); |
69 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); | 71 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
70 | up(&ice->gpio_mutex); | 72 | mutex_unlock(&ice->gpio_mutex); |
71 | } | 73 | } |
72 | 74 | ||
73 | static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, int box, int chn, int activate) | 75 | static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, int box, int chn, int activate) |
74 | { | 76 | { |
75 | down(&ice->gpio_mutex); | 77 | mutex_lock(&ice->gpio_mutex); |
76 | 78 | ||
77 | /* select box */ | 79 | /* select box */ |
78 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); | 80 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); |
@@ -115,12 +117,12 @@ static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, i | |||
115 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, 0); | 117 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, 0); |
116 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); | 118 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
117 | 119 | ||
118 | up(&ice->gpio_mutex); | 120 | mutex_unlock(&ice->gpio_mutex); |
119 | } | 121 | } |
120 | 122 | ||
121 | static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int box, int master) | 123 | static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int box, int master) |
122 | { | 124 | { |
123 | down(&ice->gpio_mutex); | 125 | mutex_lock(&ice->gpio_mutex); |
124 | 126 | ||
125 | /* select box */ | 127 | /* select box */ |
126 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); | 128 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); |
@@ -141,15 +143,15 @@ static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int | |||
141 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 1); | 143 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 1); |
142 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); | 144 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
143 | 145 | ||
144 | up(&ice->gpio_mutex); | 146 | mutex_unlock(&ice->gpio_mutex); |
145 | } | 147 | } |
146 | 148 | ||
147 | static void __devinit snd_ice1712_stdsp24_midi2(struct snd_ice1712 *ice, int activate) | 149 | static void __devinit snd_ice1712_stdsp24_midi2(struct snd_ice1712 *ice, int activate) |
148 | { | 150 | { |
149 | down(&ice->gpio_mutex); | 151 | mutex_lock(&ice->gpio_mutex); |
150 | ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate); | 152 | ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate); |
151 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); | 153 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
152 | up(&ice->gpio_mutex); | 154 | mutex_unlock(&ice->gpio_mutex); |
153 | } | 155 | } |
154 | 156 | ||
155 | static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice) | 157 | static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice) |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index ef6f18558c95..3156a3132990 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/pci.h> | 55 | #include <linux/pci.h> |
56 | #include <linux/slab.h> | 56 | #include <linux/slab.h> |
57 | #include <linux/moduleparam.h> | 57 | #include <linux/moduleparam.h> |
58 | #include <linux/mutex.h> | ||
58 | #include <sound/core.h> | 59 | #include <sound/core.h> |
59 | #include <sound/cs8427.h> | 60 | #include <sound/cs8427.h> |
60 | #include <sound/info.h> | 61 | #include <sound/info.h> |
@@ -2557,9 +2558,9 @@ static int __devinit snd_ice1712_create(struct snd_card *card, | |||
2557 | cs8427_timeout = 1000; | 2558 | cs8427_timeout = 1000; |
2558 | ice->cs8427_timeout = cs8427_timeout; | 2559 | ice->cs8427_timeout = cs8427_timeout; |
2559 | spin_lock_init(&ice->reg_lock); | 2560 | spin_lock_init(&ice->reg_lock); |
2560 | init_MUTEX(&ice->gpio_mutex); | 2561 | mutex_init(&ice->gpio_mutex); |
2561 | init_MUTEX(&ice->i2c_mutex); | 2562 | mutex_init(&ice->i2c_mutex); |
2562 | init_MUTEX(&ice->open_mutex); | 2563 | mutex_init(&ice->open_mutex); |
2563 | ice->gpio.set_mask = snd_ice1712_set_gpio_mask; | 2564 | ice->gpio.set_mask = snd_ice1712_set_gpio_mask; |
2564 | ice->gpio.set_dir = snd_ice1712_set_gpio_dir; | 2565 | ice->gpio.set_dir = snd_ice1712_set_gpio_dir; |
2565 | ice->gpio.set_data = snd_ice1712_set_gpio_data; | 2566 | ice->gpio.set_data = snd_ice1712_set_gpio_data; |
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h index ce96b3bb6531..d7416a83fcac 100644 --- a/sound/pci/ice1712/ice1712.h +++ b/sound/pci/ice1712/ice1712.h | |||
@@ -334,7 +334,7 @@ struct snd_ice1712 { | |||
334 | unsigned int num_total_adcs; /* total ADCs */ | 334 | unsigned int num_total_adcs; /* total ADCs */ |
335 | unsigned int cur_rate; /* current rate */ | 335 | unsigned int cur_rate; /* current rate */ |
336 | 336 | ||
337 | struct semaphore open_mutex; | 337 | struct mutex open_mutex; |
338 | struct snd_pcm_substream *pcm_reserved[4]; | 338 | struct snd_pcm_substream *pcm_reserved[4]; |
339 | struct snd_pcm_hw_constraint_list *hw_rates; /* card-specific rate constraints */ | 339 | struct snd_pcm_hw_constraint_list *hw_rates; /* card-specific rate constraints */ |
340 | 340 | ||
@@ -342,7 +342,7 @@ struct snd_ice1712 { | |||
342 | struct snd_akm4xxx *akm; | 342 | struct snd_akm4xxx *akm; |
343 | struct snd_ice1712_spdif spdif; | 343 | struct snd_ice1712_spdif spdif; |
344 | 344 | ||
345 | struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */ | 345 | struct mutex i2c_mutex; /* I2C mutex for ICE1724 registers */ |
346 | struct snd_i2c_bus *i2c; /* I2C bus */ | 346 | struct snd_i2c_bus *i2c; /* I2C bus */ |
347 | struct snd_i2c_device *cs8427; /* CS8427 I2C device */ | 347 | struct snd_i2c_device *cs8427; /* CS8427 I2C device */ |
348 | unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ | 348 | unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ |
@@ -360,7 +360,7 @@ struct snd_ice1712 { | |||
360 | void (*set_pro_rate)(struct snd_ice1712 *ice, unsigned int rate); | 360 | void (*set_pro_rate)(struct snd_ice1712 *ice, unsigned int rate); |
361 | void (*i2s_mclk_changed)(struct snd_ice1712 *ice); | 361 | void (*i2s_mclk_changed)(struct snd_ice1712 *ice); |
362 | } gpio; | 362 | } gpio; |
363 | struct semaphore gpio_mutex; | 363 | struct mutex gpio_mutex; |
364 | 364 | ||
365 | /* other board-specific data */ | 365 | /* other board-specific data */ |
366 | union { | 366 | union { |
@@ -423,7 +423,7 @@ static inline unsigned int snd_ice1712_gpio_read(struct snd_ice1712 *ice) | |||
423 | */ | 423 | */ |
424 | static inline void snd_ice1712_save_gpio_status(struct snd_ice1712 *ice) | 424 | static inline void snd_ice1712_save_gpio_status(struct snd_ice1712 *ice) |
425 | { | 425 | { |
426 | down(&ice->gpio_mutex); | 426 | mutex_lock(&ice->gpio_mutex); |
427 | ice->gpio.saved[0] = ice->gpio.direction; | 427 | ice->gpio.saved[0] = ice->gpio.direction; |
428 | ice->gpio.saved[1] = ice->gpio.write_mask; | 428 | ice->gpio.saved[1] = ice->gpio.write_mask; |
429 | } | 429 | } |
@@ -434,7 +434,7 @@ static inline void snd_ice1712_restore_gpio_status(struct snd_ice1712 *ice) | |||
434 | ice->gpio.set_mask(ice, ice->gpio.saved[1]); | 434 | ice->gpio.set_mask(ice, ice->gpio.saved[1]); |
435 | ice->gpio.direction = ice->gpio.saved[0]; | 435 | ice->gpio.direction = ice->gpio.saved[0]; |
436 | ice->gpio.write_mask = ice->gpio.saved[1]; | 436 | ice->gpio.write_mask = ice->gpio.saved[1]; |
437 | up(&ice->gpio_mutex); | 437 | mutex_unlock(&ice->gpio_mutex); |
438 | } | 438 | } |
439 | 439 | ||
440 | /* for bit controls */ | 440 | /* for bit controls */ |
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 71f08c036019..fce616c2761f 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
33 | #include <linux/mutex.h> | ||
33 | #include <sound/core.h> | 34 | #include <sound/core.h> |
34 | #include <sound/info.h> | 35 | #include <sound/info.h> |
35 | #include <sound/mpu401.h> | 36 | #include <sound/mpu401.h> |
@@ -487,7 +488,7 @@ static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, | |||
487 | int i, chs; | 488 | int i, chs; |
488 | 489 | ||
489 | chs = params_channels(hw_params); | 490 | chs = params_channels(hw_params); |
490 | down(&ice->open_mutex); | 491 | mutex_lock(&ice->open_mutex); |
491 | /* mark surround channels */ | 492 | /* mark surround channels */ |
492 | if (substream == ice->playback_pro_substream) { | 493 | if (substream == ice->playback_pro_substream) { |
493 | /* PDMA0 can be multi-channel up to 8 */ | 494 | /* PDMA0 can be multi-channel up to 8 */ |
@@ -495,7 +496,7 @@ static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, | |||
495 | for (i = 0; i < chs; i++) { | 496 | for (i = 0; i < chs; i++) { |
496 | if (ice->pcm_reserved[i] && | 497 | if (ice->pcm_reserved[i] && |
497 | ice->pcm_reserved[i] != substream) { | 498 | ice->pcm_reserved[i] != substream) { |
498 | up(&ice->open_mutex); | 499 | mutex_unlock(&ice->open_mutex); |
499 | return -EBUSY; | 500 | return -EBUSY; |
500 | } | 501 | } |
501 | ice->pcm_reserved[i] = substream; | 502 | ice->pcm_reserved[i] = substream; |
@@ -510,7 +511,7 @@ static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, | |||
510 | if (ice->playback_con_substream_ds[i] == substream) { | 511 | if (ice->playback_con_substream_ds[i] == substream) { |
511 | if (ice->pcm_reserved[i] && | 512 | if (ice->pcm_reserved[i] && |
512 | ice->pcm_reserved[i] != substream) { | 513 | ice->pcm_reserved[i] != substream) { |
513 | up(&ice->open_mutex); | 514 | mutex_unlock(&ice->open_mutex); |
514 | return -EBUSY; | 515 | return -EBUSY; |
515 | } | 516 | } |
516 | ice->pcm_reserved[i] = substream; | 517 | ice->pcm_reserved[i] = substream; |
@@ -518,7 +519,7 @@ static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, | |||
518 | } | 519 | } |
519 | } | 520 | } |
520 | } | 521 | } |
521 | up(&ice->open_mutex); | 522 | mutex_unlock(&ice->open_mutex); |
522 | snd_vt1724_set_pro_rate(ice, params_rate(hw_params), 0); | 523 | snd_vt1724_set_pro_rate(ice, params_rate(hw_params), 0); |
523 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 524 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
524 | } | 525 | } |
@@ -528,12 +529,12 @@ static int snd_vt1724_pcm_hw_free(struct snd_pcm_substream *substream) | |||
528 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 529 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
529 | int i; | 530 | int i; |
530 | 531 | ||
531 | down(&ice->open_mutex); | 532 | mutex_lock(&ice->open_mutex); |
532 | /* unmark surround channels */ | 533 | /* unmark surround channels */ |
533 | for (i = 0; i < 3; i++) | 534 | for (i = 0; i < 3; i++) |
534 | if (ice->pcm_reserved[i] == substream) | 535 | if (ice->pcm_reserved[i] == substream) |
535 | ice->pcm_reserved[i] = NULL; | 536 | ice->pcm_reserved[i] = NULL; |
536 | up(&ice->open_mutex); | 537 | mutex_unlock(&ice->open_mutex); |
537 | return snd_pcm_lib_free_pages(substream); | 538 | return snd_pcm_lib_free_pages(substream); |
538 | } | 539 | } |
539 | 540 | ||
@@ -778,7 +779,7 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream) | |||
778 | snd_pcm_set_sync(substream); | 779 | snd_pcm_set_sync(substream); |
779 | snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); | 780 | snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); |
780 | set_rate_constraints(ice, substream); | 781 | set_rate_constraints(ice, substream); |
781 | down(&ice->open_mutex); | 782 | mutex_lock(&ice->open_mutex); |
782 | /* calculate the currently available channels */ | 783 | /* calculate the currently available channels */ |
783 | for (chs = 0; chs < 3; chs++) { | 784 | for (chs = 0; chs < 3; chs++) { |
784 | if (ice->pcm_reserved[chs]) | 785 | if (ice->pcm_reserved[chs]) |
@@ -788,7 +789,7 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream) | |||
788 | runtime->hw.channels_max = chs; | 789 | runtime->hw.channels_max = chs; |
789 | if (chs > 2) /* channels must be even */ | 790 | if (chs > 2) /* channels must be even */ |
790 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 2); | 791 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 2); |
791 | up(&ice->open_mutex); | 792 | mutex_unlock(&ice->open_mutex); |
792 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | 793 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, |
793 | VT1724_BUFFER_ALIGN); | 794 | VT1724_BUFFER_ALIGN); |
794 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, | 795 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, |
@@ -1128,13 +1129,13 @@ static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream) | |||
1128 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 1129 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
1129 | struct snd_pcm_runtime *runtime = substream->runtime; | 1130 | struct snd_pcm_runtime *runtime = substream->runtime; |
1130 | 1131 | ||
1131 | down(&ice->open_mutex); | 1132 | mutex_lock(&ice->open_mutex); |
1132 | /* already used by PDMA0? */ | 1133 | /* already used by PDMA0? */ |
1133 | if (ice->pcm_reserved[substream->number]) { | 1134 | if (ice->pcm_reserved[substream->number]) { |
1134 | up(&ice->open_mutex); | 1135 | mutex_unlock(&ice->open_mutex); |
1135 | return -EBUSY; /* FIXME: should handle blocking mode properly */ | 1136 | return -EBUSY; /* FIXME: should handle blocking mode properly */ |
1136 | } | 1137 | } |
1137 | up(&ice->open_mutex); | 1138 | mutex_unlock(&ice->open_mutex); |
1138 | runtime->private_data = &vt1724_playback_dma_regs[substream->number]; | 1139 | runtime->private_data = &vt1724_playback_dma_regs[substream->number]; |
1139 | ice->playback_con_substream_ds[substream->number] = substream; | 1140 | ice->playback_con_substream_ds[substream->number] = substream; |
1140 | runtime->hw = snd_vt1724_2ch_stereo; | 1141 | runtime->hw = snd_vt1724_2ch_stereo; |
@@ -1978,12 +1979,12 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, | |||
1978 | { | 1979 | { |
1979 | unsigned char val; | 1980 | unsigned char val; |
1980 | 1981 | ||
1981 | down(&ice->i2c_mutex); | 1982 | mutex_lock(&ice->i2c_mutex); |
1982 | outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); | 1983 | outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); |
1983 | outb(dev & ~VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR)); | 1984 | outb(dev & ~VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR)); |
1984 | wait_i2c_busy(ice); | 1985 | wait_i2c_busy(ice); |
1985 | val = inb(ICEREG1724(ice, I2C_DATA)); | 1986 | val = inb(ICEREG1724(ice, I2C_DATA)); |
1986 | up(&ice->i2c_mutex); | 1987 | mutex_unlock(&ice->i2c_mutex); |
1987 | //printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); | 1988 | //printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); |
1988 | return val; | 1989 | return val; |
1989 | } | 1990 | } |
@@ -1991,14 +1992,14 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, | |||
1991 | void snd_vt1724_write_i2c(struct snd_ice1712 *ice, | 1992 | void snd_vt1724_write_i2c(struct snd_ice1712 *ice, |
1992 | unsigned char dev, unsigned char addr, unsigned char data) | 1993 | unsigned char dev, unsigned char addr, unsigned char data) |
1993 | { | 1994 | { |
1994 | down(&ice->i2c_mutex); | 1995 | mutex_lock(&ice->i2c_mutex); |
1995 | wait_i2c_busy(ice); | 1996 | wait_i2c_busy(ice); |
1996 | //printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); | 1997 | //printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); |
1997 | outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); | 1998 | outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); |
1998 | outb(data, ICEREG1724(ice, I2C_DATA)); | 1999 | outb(data, ICEREG1724(ice, I2C_DATA)); |
1999 | outb(dev | VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR)); | 2000 | outb(dev | VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR)); |
2000 | wait_i2c_busy(ice); | 2001 | wait_i2c_busy(ice); |
2001 | up(&ice->i2c_mutex); | 2002 | mutex_unlock(&ice->i2c_mutex); |
2002 | } | 2003 | } |
2003 | 2004 | ||
2004 | static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice, | 2005 | static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice, |
@@ -2229,9 +2230,9 @@ static int __devinit snd_vt1724_create(struct snd_card *card, | |||
2229 | } | 2230 | } |
2230 | ice->vt1724 = 1; | 2231 | ice->vt1724 = 1; |
2231 | spin_lock_init(&ice->reg_lock); | 2232 | spin_lock_init(&ice->reg_lock); |
2232 | init_MUTEX(&ice->gpio_mutex); | 2233 | mutex_init(&ice->gpio_mutex); |
2233 | init_MUTEX(&ice->open_mutex); | 2234 | mutex_init(&ice->open_mutex); |
2234 | init_MUTEX(&ice->i2c_mutex); | 2235 | mutex_init(&ice->i2c_mutex); |
2235 | ice->gpio.set_mask = snd_vt1724_set_gpio_mask; | 2236 | ice->gpio.set_mask = snd_vt1724_set_gpio_mask; |
2236 | ice->gpio.set_dir = snd_vt1724_set_gpio_dir; | 2237 | ice->gpio.set_dir = snd_vt1724_set_gpio_dir; |
2237 | ice->gpio.set_data = snd_vt1724_set_gpio_data; | 2238 | ice->gpio.set_data = snd_vt1724_set_gpio_data; |
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index ec3757834b93..502da1c8b5f7 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
40 | #include <linux/init.h> | 40 | #include <linux/init.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/mutex.h> | ||
43 | |||
42 | #include <sound/core.h> | 44 | #include <sound/core.h> |
43 | 45 | ||
44 | #include "ice1712.h" | 46 | #include "ice1712.h" |
@@ -273,9 +275,9 @@ static int wm_pcm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
273 | { | 275 | { |
274 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 276 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
275 | 277 | ||
276 | down(&ice->gpio_mutex); | 278 | mutex_lock(&ice->gpio_mutex); |
277 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? 0 : 1; | 279 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? 0 : 1; |
278 | up(&ice->gpio_mutex); | 280 | mutex_unlock(&ice->gpio_mutex); |
279 | return 0; | 281 | return 0; |
280 | } | 282 | } |
281 | 283 | ||
@@ -584,11 +586,11 @@ static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
584 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 586 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
585 | unsigned short val; | 587 | unsigned short val; |
586 | 588 | ||
587 | down(&ice->gpio_mutex); | 589 | mutex_lock(&ice->gpio_mutex); |
588 | val = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; | 590 | val = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; |
589 | val = val > PCM_MIN ? (val - PCM_MIN) : 0; | 591 | val = val > PCM_MIN ? (val - PCM_MIN) : 0; |
590 | ucontrol->value.integer.value[0] = val; | 592 | ucontrol->value.integer.value[0] = val; |
591 | up(&ice->gpio_mutex); | 593 | mutex_unlock(&ice->gpio_mutex); |
592 | return 0; | 594 | return 0; |
593 | } | 595 | } |
594 | 596 | ||
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 0dccd7707a4b..d23fb3fc2133 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.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/info.h> | 33 | #include <sound/info.h> |
32 | 34 | ||
@@ -124,13 +126,13 @@ static int wm_dac_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
124 | unsigned short val; | 126 | unsigned short val; |
125 | int i; | 127 | int i; |
126 | 128 | ||
127 | down(&ice->gpio_mutex); | 129 | mutex_lock(&ice->gpio_mutex); |
128 | for (i = 0; i < 2; i++) { | 130 | for (i = 0; i < 2; i++) { |
129 | val = wm_get(ice, WM_DAC_ATTEN_L + i) & 0xff; | 131 | val = wm_get(ice, WM_DAC_ATTEN_L + i) & 0xff; |
130 | val = val > DAC_MIN ? (val - DAC_MIN) : 0; | 132 | val = val > DAC_MIN ? (val - DAC_MIN) : 0; |
131 | ucontrol->value.integer.value[i] = val; | 133 | ucontrol->value.integer.value[i] = val; |
132 | } | 134 | } |
133 | up(&ice->gpio_mutex); | 135 | mutex_unlock(&ice->gpio_mutex); |
134 | return 0; | 136 | return 0; |
135 | } | 137 | } |
136 | 138 | ||
@@ -140,7 +142,7 @@ static int wm_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
140 | unsigned short oval, nval; | 142 | unsigned short oval, nval; |
141 | int i, idx, change = 0; | 143 | int i, idx, change = 0; |
142 | 144 | ||
143 | down(&ice->gpio_mutex); | 145 | mutex_lock(&ice->gpio_mutex); |
144 | for (i = 0; i < 2; i++) { | 146 | for (i = 0; i < 2; i++) { |
145 | nval = ucontrol->value.integer.value[i]; | 147 | nval = ucontrol->value.integer.value[i]; |
146 | nval = (nval ? (nval + DAC_MIN) : 0) & 0xff; | 148 | nval = (nval ? (nval + DAC_MIN) : 0) & 0xff; |
@@ -152,7 +154,7 @@ static int wm_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
152 | change = 1; | 154 | change = 1; |
153 | } | 155 | } |
154 | } | 156 | } |
155 | up(&ice->gpio_mutex); | 157 | mutex_unlock(&ice->gpio_mutex); |
156 | return change; | 158 | return change; |
157 | } | 159 | } |
158 | 160 | ||
@@ -179,13 +181,13 @@ static int wm_adc_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
179 | unsigned short val; | 181 | unsigned short val; |
180 | int i; | 182 | int i; |
181 | 183 | ||
182 | down(&ice->gpio_mutex); | 184 | mutex_lock(&ice->gpio_mutex); |
183 | for (i = 0; i < 2; i++) { | 185 | for (i = 0; i < 2; i++) { |
184 | val = wm_get(ice, WM_ADC_ATTEN_L + i) & 0xff; | 186 | val = wm_get(ice, WM_ADC_ATTEN_L + i) & 0xff; |
185 | val = val > ADC_MIN ? (val - ADC_MIN) : 0; | 187 | val = val > ADC_MIN ? (val - ADC_MIN) : 0; |
186 | ucontrol->value.integer.value[i] = val; | 188 | ucontrol->value.integer.value[i] = val; |
187 | } | 189 | } |
188 | up(&ice->gpio_mutex); | 190 | mutex_unlock(&ice->gpio_mutex); |
189 | return 0; | 191 | return 0; |
190 | } | 192 | } |
191 | 193 | ||
@@ -195,7 +197,7 @@ static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
195 | unsigned short ovol, nvol; | 197 | unsigned short ovol, nvol; |
196 | int i, idx, change = 0; | 198 | int i, idx, change = 0; |
197 | 199 | ||
198 | down(&ice->gpio_mutex); | 200 | mutex_lock(&ice->gpio_mutex); |
199 | for (i = 0; i < 2; i++) { | 201 | for (i = 0; i < 2; i++) { |
200 | nvol = ucontrol->value.integer.value[i]; | 202 | nvol = ucontrol->value.integer.value[i]; |
201 | nvol = nvol ? (nvol + ADC_MIN) : 0; | 203 | nvol = nvol ? (nvol + ADC_MIN) : 0; |
@@ -206,7 +208,7 @@ static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
206 | change = 1; | 208 | change = 1; |
207 | } | 209 | } |
208 | } | 210 | } |
209 | up(&ice->gpio_mutex); | 211 | mutex_unlock(&ice->gpio_mutex); |
210 | return change; | 212 | return change; |
211 | } | 213 | } |
212 | 214 | ||
@@ -227,9 +229,9 @@ static int wm_adc_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
227 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 229 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
228 | int bit = kcontrol->private_value; | 230 | int bit = kcontrol->private_value; |
229 | 231 | ||
230 | down(&ice->gpio_mutex); | 232 | mutex_lock(&ice->gpio_mutex); |
231 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_ADC_MUX) & (1 << bit)) ? 1 : 0; | 233 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_ADC_MUX) & (1 << bit)) ? 1 : 0; |
232 | up(&ice->gpio_mutex); | 234 | mutex_unlock(&ice->gpio_mutex); |
233 | return 0; | 235 | return 0; |
234 | } | 236 | } |
235 | 237 | ||
@@ -240,7 +242,7 @@ static int wm_adc_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
240 | unsigned short oval, nval; | 242 | unsigned short oval, nval; |
241 | int change; | 243 | int change; |
242 | 244 | ||
243 | down(&ice->gpio_mutex); | 245 | mutex_lock(&ice->gpio_mutex); |
244 | nval = oval = wm_get(ice, WM_ADC_MUX); | 246 | nval = oval = wm_get(ice, WM_ADC_MUX); |
245 | if (ucontrol->value.integer.value[0]) | 247 | if (ucontrol->value.integer.value[0]) |
246 | nval |= (1 << bit); | 248 | nval |= (1 << bit); |
@@ -250,7 +252,7 @@ static int wm_adc_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
250 | if (change) { | 252 | if (change) { |
251 | wm_put(ice, WM_ADC_MUX, nval); | 253 | wm_put(ice, WM_ADC_MUX, nval); |
252 | } | 254 | } |
253 | up(&ice->gpio_mutex); | 255 | mutex_unlock(&ice->gpio_mutex); |
254 | return 0; | 256 | return 0; |
255 | } | 257 | } |
256 | 258 | ||
@@ -270,9 +272,9 @@ static int wm_bypass_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
270 | { | 272 | { |
271 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 273 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
272 | 274 | ||
273 | down(&ice->gpio_mutex); | 275 | mutex_lock(&ice->gpio_mutex); |
274 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_OUT_MUX) & 0x04) ? 1 : 0; | 276 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_OUT_MUX) & 0x04) ? 1 : 0; |
275 | up(&ice->gpio_mutex); | 277 | mutex_unlock(&ice->gpio_mutex); |
276 | return 0; | 278 | return 0; |
277 | } | 279 | } |
278 | 280 | ||
@@ -282,7 +284,7 @@ static int wm_bypass_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
282 | unsigned short val, oval; | 284 | unsigned short val, oval; |
283 | int change = 0; | 285 | int change = 0; |
284 | 286 | ||
285 | down(&ice->gpio_mutex); | 287 | mutex_lock(&ice->gpio_mutex); |
286 | val = oval = wm_get(ice, WM_OUT_MUX); | 288 | val = oval = wm_get(ice, WM_OUT_MUX); |
287 | if (ucontrol->value.integer.value[0]) | 289 | if (ucontrol->value.integer.value[0]) |
288 | val |= 0x04; | 290 | val |= 0x04; |
@@ -292,7 +294,7 @@ static int wm_bypass_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
292 | wm_put(ice, WM_OUT_MUX, val); | 294 | wm_put(ice, WM_OUT_MUX, val); |
293 | change = 1; | 295 | change = 1; |
294 | } | 296 | } |
295 | up(&ice->gpio_mutex); | 297 | mutex_unlock(&ice->gpio_mutex); |
296 | return change; | 298 | return change; |
297 | } | 299 | } |
298 | 300 | ||
@@ -312,9 +314,9 @@ static int wm_chswap_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
312 | { | 314 | { |
313 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 315 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
314 | 316 | ||
315 | down(&ice->gpio_mutex); | 317 | mutex_lock(&ice->gpio_mutex); |
316 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL1) & 0xf0) != 0x90; | 318 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL1) & 0xf0) != 0x90; |
317 | up(&ice->gpio_mutex); | 319 | mutex_unlock(&ice->gpio_mutex); |
318 | return 0; | 320 | return 0; |
319 | } | 321 | } |
320 | 322 | ||
@@ -324,7 +326,7 @@ static int wm_chswap_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
324 | unsigned short val, oval; | 326 | unsigned short val, oval; |
325 | int change = 0; | 327 | int change = 0; |
326 | 328 | ||
327 | down(&ice->gpio_mutex); | 329 | mutex_lock(&ice->gpio_mutex); |
328 | oval = wm_get(ice, WM_DAC_CTRL1); | 330 | oval = wm_get(ice, WM_DAC_CTRL1); |
329 | val = oval & 0x0f; | 331 | val = oval & 0x0f; |
330 | if (ucontrol->value.integer.value[0]) | 332 | if (ucontrol->value.integer.value[0]) |
@@ -336,7 +338,7 @@ static int wm_chswap_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
336 | wm_put_nocache(ice, WM_DAC_CTRL1, val); | 338 | wm_put_nocache(ice, WM_DAC_CTRL1, val); |
337 | change = 1; | 339 | change = 1; |
338 | } | 340 | } |
339 | up(&ice->gpio_mutex); | 341 | mutex_unlock(&ice->gpio_mutex); |
340 | return change; | 342 | return change; |
341 | } | 343 | } |
342 | 344 | ||
@@ -449,9 +451,9 @@ static int cs_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
449 | { | 451 | { |
450 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 452 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
451 | 453 | ||
452 | down(&ice->gpio_mutex); | 454 | mutex_lock(&ice->gpio_mutex); |
453 | ucontrol->value.enumerated.item[0] = ice->gpio.saved[0]; | 455 | ucontrol->value.enumerated.item[0] = ice->gpio.saved[0]; |
454 | up(&ice->gpio_mutex); | 456 | mutex_unlock(&ice->gpio_mutex); |
455 | return 0; | 457 | return 0; |
456 | } | 458 | } |
457 | 459 | ||
@@ -461,14 +463,14 @@ static int cs_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
461 | unsigned char val; | 463 | unsigned char val; |
462 | int change = 0; | 464 | int change = 0; |
463 | 465 | ||
464 | down(&ice->gpio_mutex); | 466 | mutex_lock(&ice->gpio_mutex); |
465 | if (ucontrol->value.enumerated.item[0] != ice->gpio.saved[0]) { | 467 | if (ucontrol->value.enumerated.item[0] != ice->gpio.saved[0]) { |
466 | ice->gpio.saved[0] = ucontrol->value.enumerated.item[0] & 3; | 468 | ice->gpio.saved[0] = ucontrol->value.enumerated.item[0] & 3; |
467 | val = 0x80 | (ice->gpio.saved[0] << 3); | 469 | val = 0x80 | (ice->gpio.saved[0] << 3); |
468 | spi_write(ice, CS_DEV, 0x04, val); | 470 | spi_write(ice, CS_DEV, 0x04, val); |
469 | change = 1; | 471 | change = 1; |
470 | } | 472 | } |
471 | up(&ice->gpio_mutex); | 473 | mutex_unlock(&ice->gpio_mutex); |
472 | return 0; | 474 | return 0; |
473 | } | 475 | } |
474 | 476 | ||
@@ -488,10 +490,10 @@ static int pontis_gpio_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_e | |||
488 | static int pontis_gpio_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 490 | static int pontis_gpio_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
489 | { | 491 | { |
490 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 492 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
491 | down(&ice->gpio_mutex); | 493 | mutex_lock(&ice->gpio_mutex); |
492 | /* 4-7 reserved */ | 494 | /* 4-7 reserved */ |
493 | ucontrol->value.integer.value[0] = (~ice->gpio.write_mask & 0xffff) | 0x00f0; | 495 | ucontrol->value.integer.value[0] = (~ice->gpio.write_mask & 0xffff) | 0x00f0; |
494 | up(&ice->gpio_mutex); | 496 | mutex_unlock(&ice->gpio_mutex); |
495 | return 0; | 497 | return 0; |
496 | } | 498 | } |
497 | 499 | ||
@@ -500,22 +502,22 @@ static int pontis_gpio_mask_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
500 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 502 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
501 | unsigned int val; | 503 | unsigned int val; |
502 | int changed; | 504 | int changed; |
503 | down(&ice->gpio_mutex); | 505 | mutex_lock(&ice->gpio_mutex); |
504 | /* 4-7 reserved */ | 506 | /* 4-7 reserved */ |
505 | val = (~ucontrol->value.integer.value[0] & 0xffff) | 0x00f0; | 507 | val = (~ucontrol->value.integer.value[0] & 0xffff) | 0x00f0; |
506 | changed = val != ice->gpio.write_mask; | 508 | changed = val != ice->gpio.write_mask; |
507 | ice->gpio.write_mask = val; | 509 | ice->gpio.write_mask = val; |
508 | up(&ice->gpio_mutex); | 510 | mutex_unlock(&ice->gpio_mutex); |
509 | return changed; | 511 | return changed; |
510 | } | 512 | } |
511 | 513 | ||
512 | static int pontis_gpio_dir_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 514 | static int pontis_gpio_dir_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
513 | { | 515 | { |
514 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 516 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
515 | down(&ice->gpio_mutex); | 517 | mutex_lock(&ice->gpio_mutex); |
516 | /* 4-7 reserved */ | 518 | /* 4-7 reserved */ |
517 | ucontrol->value.integer.value[0] = ice->gpio.direction & 0xff0f; | 519 | ucontrol->value.integer.value[0] = ice->gpio.direction & 0xff0f; |
518 | up(&ice->gpio_mutex); | 520 | mutex_unlock(&ice->gpio_mutex); |
519 | return 0; | 521 | return 0; |
520 | } | 522 | } |
521 | 523 | ||
@@ -524,23 +526,23 @@ static int pontis_gpio_dir_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
524 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 526 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
525 | unsigned int val; | 527 | unsigned int val; |
526 | int changed; | 528 | int changed; |
527 | down(&ice->gpio_mutex); | 529 | mutex_lock(&ice->gpio_mutex); |
528 | /* 4-7 reserved */ | 530 | /* 4-7 reserved */ |
529 | val = ucontrol->value.integer.value[0] & 0xff0f; | 531 | val = ucontrol->value.integer.value[0] & 0xff0f; |
530 | changed = (val != ice->gpio.direction); | 532 | changed = (val != ice->gpio.direction); |
531 | ice->gpio.direction = val; | 533 | ice->gpio.direction = val; |
532 | up(&ice->gpio_mutex); | 534 | mutex_unlock(&ice->gpio_mutex); |
533 | return changed; | 535 | return changed; |
534 | } | 536 | } |
535 | 537 | ||
536 | static int pontis_gpio_data_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 538 | static int pontis_gpio_data_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
537 | { | 539 | { |
538 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 540 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
539 | down(&ice->gpio_mutex); | 541 | mutex_lock(&ice->gpio_mutex); |
540 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); | 542 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); |
541 | snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask); | 543 | snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask); |
542 | ucontrol->value.integer.value[0] = snd_ice1712_gpio_read(ice) & 0xffff; | 544 | ucontrol->value.integer.value[0] = snd_ice1712_gpio_read(ice) & 0xffff; |
543 | up(&ice->gpio_mutex); | 545 | mutex_unlock(&ice->gpio_mutex); |
544 | return 0; | 546 | return 0; |
545 | } | 547 | } |
546 | 548 | ||
@@ -549,7 +551,7 @@ static int pontis_gpio_data_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
549 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 551 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
550 | unsigned int val, nval; | 552 | unsigned int val, nval; |
551 | int changed = 0; | 553 | int changed = 0; |
552 | down(&ice->gpio_mutex); | 554 | mutex_lock(&ice->gpio_mutex); |
553 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); | 555 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); |
554 | snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask); | 556 | snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask); |
555 | val = snd_ice1712_gpio_read(ice) & 0xffff; | 557 | val = snd_ice1712_gpio_read(ice) & 0xffff; |
@@ -558,7 +560,7 @@ static int pontis_gpio_data_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
558 | snd_ice1712_gpio_write(ice, nval); | 560 | snd_ice1712_gpio_write(ice, nval); |
559 | changed = 1; | 561 | changed = 1; |
560 | } | 562 | } |
561 | up(&ice->gpio_mutex); | 563 | mutex_unlock(&ice->gpio_mutex); |
562 | return changed; | 564 | return changed; |
563 | } | 565 | } |
564 | 566 | ||
@@ -651,14 +653,14 @@ static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buf | |||
651 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; | 653 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; |
652 | char line[64]; | 654 | char line[64]; |
653 | unsigned int reg, val; | 655 | unsigned int reg, val; |
654 | down(&ice->gpio_mutex); | 656 | mutex_lock(&ice->gpio_mutex); |
655 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 657 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
656 | if (sscanf(line, "%x %x", ®, &val) != 2) | 658 | if (sscanf(line, "%x %x", ®, &val) != 2) |
657 | continue; | 659 | continue; |
658 | if (reg <= 0x17 && val <= 0xffff) | 660 | if (reg <= 0x17 && val <= 0xffff) |
659 | wm_put(ice, reg, val); | 661 | wm_put(ice, reg, val); |
660 | } | 662 | } |
661 | up(&ice->gpio_mutex); | 663 | mutex_unlock(&ice->gpio_mutex); |
662 | } | 664 | } |
663 | 665 | ||
664 | static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) | 666 | static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
@@ -666,12 +668,12 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff | |||
666 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; | 668 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; |
667 | int reg, val; | 669 | int reg, val; |
668 | 670 | ||
669 | down(&ice->gpio_mutex); | 671 | mutex_lock(&ice->gpio_mutex); |
670 | for (reg = 0; reg <= 0x17; reg++) { | 672 | for (reg = 0; reg <= 0x17; reg++) { |
671 | val = wm_get(ice, reg); | 673 | val = wm_get(ice, reg); |
672 | snd_iprintf(buffer, "%02x = %04x\n", reg, val); | 674 | snd_iprintf(buffer, "%02x = %04x\n", reg, val); |
673 | } | 675 | } |
674 | up(&ice->gpio_mutex); | 676 | mutex_unlock(&ice->gpio_mutex); |
675 | } | 677 | } |
676 | 678 | ||
677 | static void wm_proc_init(struct snd_ice1712 *ice) | 679 | static void wm_proc_init(struct snd_ice1712 *ice) |
@@ -690,14 +692,14 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff | |||
690 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; | 692 | struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; |
691 | int reg, val; | 693 | int reg, val; |
692 | 694 | ||
693 | down(&ice->gpio_mutex); | 695 | mutex_lock(&ice->gpio_mutex); |
694 | for (reg = 0; reg <= 0x26; reg++) { | 696 | for (reg = 0; reg <= 0x26; reg++) { |
695 | val = spi_read(ice, CS_DEV, reg); | 697 | val = spi_read(ice, CS_DEV, reg); |
696 | snd_iprintf(buffer, "%02x = %02x\n", reg, val); | 698 | snd_iprintf(buffer, "%02x = %02x\n", reg, val); |
697 | } | 699 | } |
698 | val = spi_read(ice, CS_DEV, 0x7f); | 700 | val = spi_read(ice, CS_DEV, 0x7f); |
699 | snd_iprintf(buffer, "%02x = %02x\n", 0x7f, val); | 701 | snd_iprintf(buffer, "%02x = %02x\n", 0x7f, val); |
700 | up(&ice->gpio_mutex); | 702 | mutex_unlock(&ice->gpio_mutex); |
701 | } | 703 | } |
702 | 704 | ||
703 | static void cs_proc_init(struct snd_ice1712 *ice) | 705 | static void cs_proc_init(struct snd_ice1712 *ice) |