aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 10:34:20 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:25:29 -0500
commit62932df8fb20ba2fb53a95fa52445eba22e821fe (patch)
tree335178d7438395a68a453a9c23624b3e9fc5ec40 /sound/pci/hda/patch_analog.c
parent8b7547f95cbe8a5940df62ed730646fdfcba5fda (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/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 1ada1b075c9a..5a3821ae93a8 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -23,6 +23,8 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/mutex.h>
27
26#include <sound/core.h> 28#include <sound/core.h>
27#include "hda_codec.h" 29#include "hda_codec.h"
28#include "hda_local.h" 30#include "hda_local.h"
@@ -60,7 +62,7 @@ struct ad198x_spec {
60 /* PCM information */ 62 /* PCM information */
61 struct hda_pcm pcm_rec[2]; /* used in alc_build_pcms() */ 63 struct hda_pcm pcm_rec[2]; /* used in alc_build_pcms() */
62 64
63 struct semaphore amp_mutex; /* PCM volume/mute control mutex */ 65 struct mutex amp_mutex; /* PCM volume/mute control mutex */
64 unsigned int spdif_route; 66 unsigned int spdif_route;
65 67
66 /* dynamic controls, init_verbs and input_mux */ 68 /* dynamic controls, init_verbs and input_mux */
@@ -371,9 +373,9 @@ static int ad1986a_pcm_amp_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl
371 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 373 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
372 struct ad198x_spec *ad = codec->spec; 374 struct ad198x_spec *ad = codec->spec;
373 375
374 down(&ad->amp_mutex); 376 mutex_lock(&ad->amp_mutex);
375 snd_hda_mixer_amp_volume_get(kcontrol, ucontrol); 377 snd_hda_mixer_amp_volume_get(kcontrol, ucontrol);
376 up(&ad->amp_mutex); 378 mutex_unlock(&ad->amp_mutex);
377 return 0; 379 return 0;
378} 380}
379 381
@@ -383,13 +385,13 @@ static int ad1986a_pcm_amp_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl
383 struct ad198x_spec *ad = codec->spec; 385 struct ad198x_spec *ad = codec->spec;
384 int i, change = 0; 386 int i, change = 0;
385 387
386 down(&ad->amp_mutex); 388 mutex_lock(&ad->amp_mutex);
387 for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) { 389 for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) {
388 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT); 390 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT);
389 change |= snd_hda_mixer_amp_volume_put(kcontrol, ucontrol); 391 change |= snd_hda_mixer_amp_volume_put(kcontrol, ucontrol);
390 } 392 }
391 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT); 393 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT);
392 up(&ad->amp_mutex); 394 mutex_unlock(&ad->amp_mutex);
393 return change; 395 return change;
394} 396}
395 397
@@ -400,9 +402,9 @@ static int ad1986a_pcm_amp_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_
400 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 402 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
401 struct ad198x_spec *ad = codec->spec; 403 struct ad198x_spec *ad = codec->spec;
402 404
403 down(&ad->amp_mutex); 405 mutex_lock(&ad->amp_mutex);
404 snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); 406 snd_hda_mixer_amp_switch_get(kcontrol, ucontrol);
405 up(&ad->amp_mutex); 407 mutex_unlock(&ad->amp_mutex);
406 return 0; 408 return 0;
407} 409}
408 410
@@ -412,13 +414,13 @@ static int ad1986a_pcm_amp_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
412 struct ad198x_spec *ad = codec->spec; 414 struct ad198x_spec *ad = codec->spec;
413 int i, change = 0; 415 int i, change = 0;
414 416
415 down(&ad->amp_mutex); 417 mutex_lock(&ad->amp_mutex);
416 for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) { 418 for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) {
417 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT); 419 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT);
418 change |= snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 420 change |= snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
419 } 421 }
420 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT); 422 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT);
421 up(&ad->amp_mutex); 423 mutex_unlock(&ad->amp_mutex);
422 return change; 424 return change;
423} 425}
424 426
@@ -544,7 +546,7 @@ static int patch_ad1986a(struct hda_codec *codec)
544 if (spec == NULL) 546 if (spec == NULL)
545 return -ENOMEM; 547 return -ENOMEM;
546 548
547 init_MUTEX(&spec->amp_mutex); 549 mutex_init(&spec->amp_mutex);
548 codec->spec = spec; 550 codec->spec = spec;
549 551
550 spec->multiout.max_channels = 6; 552 spec->multiout.max_channels = 6;
@@ -708,7 +710,7 @@ static int patch_ad1983(struct hda_codec *codec)
708 if (spec == NULL) 710 if (spec == NULL)
709 return -ENOMEM; 711 return -ENOMEM;
710 712
711 init_MUTEX(&spec->amp_mutex); 713 mutex_init(&spec->amp_mutex);
712 codec->spec = spec; 714 codec->spec = spec;
713 715
714 spec->multiout.max_channels = 2; 716 spec->multiout.max_channels = 2;
@@ -854,7 +856,7 @@ static int patch_ad1981(struct hda_codec *codec)
854 if (spec == NULL) 856 if (spec == NULL)
855 return -ENOMEM; 857 return -ENOMEM;
856 858
857 init_MUTEX(&spec->amp_mutex); 859 mutex_init(&spec->amp_mutex);
858 codec->spec = spec; 860 codec->spec = spec;
859 861
860 spec->multiout.max_channels = 2; 862 spec->multiout.max_channels = 2;
@@ -2032,7 +2034,7 @@ static int patch_ad1988(struct hda_codec *codec)
2032 if (spec == NULL) 2034 if (spec == NULL)
2033 return -ENOMEM; 2035 return -ENOMEM;
2034 2036
2035 init_MUTEX(&spec->amp_mutex); 2037 mutex_init(&spec->amp_mutex);
2036 codec->spec = spec; 2038 codec->spec = spec;
2037 2039
2038 if (codec->revision_id == AD1988A_REV2) 2040 if (codec->revision_id == AD1988A_REV2)