[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>
This commit is contained in:
Ingo Molnar
2006-01-16 16:34:20 +01:00
committed by Jaroslav Kysela
parent 8b7547f95c
commit 62932df8fb
43 changed files with 549 additions and 489 deletions

View File

@ -23,6 +23,8 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include "hda_codec.h"
#include "hda_local.h"
@ -60,7 +62,7 @@ struct ad198x_spec {
/* PCM information */
struct hda_pcm pcm_rec[2]; /* used in alc_build_pcms() */
struct semaphore amp_mutex; /* PCM volume/mute control mutex */
struct mutex amp_mutex; /* PCM volume/mute control mutex */
unsigned int spdif_route;
/* 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
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *ad = codec->spec;
down(&ad->amp_mutex);
mutex_lock(&ad->amp_mutex);
snd_hda_mixer_amp_volume_get(kcontrol, ucontrol);
up(&ad->amp_mutex);
mutex_unlock(&ad->amp_mutex);
return 0;
}
@ -383,13 +385,13 @@ static int ad1986a_pcm_amp_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl
struct ad198x_spec *ad = codec->spec;
int i, change = 0;
down(&ad->amp_mutex);
mutex_lock(&ad->amp_mutex);
for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) {
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT);
change |= snd_hda_mixer_amp_volume_put(kcontrol, ucontrol);
}
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT);
up(&ad->amp_mutex);
mutex_unlock(&ad->amp_mutex);
return change;
}
@ -400,9 +402,9 @@ static int ad1986a_pcm_amp_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *ad = codec->spec;
down(&ad->amp_mutex);
mutex_lock(&ad->amp_mutex);
snd_hda_mixer_amp_switch_get(kcontrol, ucontrol);
up(&ad->amp_mutex);
mutex_unlock(&ad->amp_mutex);
return 0;
}
@ -412,13 +414,13 @@ static int ad1986a_pcm_amp_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct ad198x_spec *ad = codec->spec;
int i, change = 0;
down(&ad->amp_mutex);
mutex_lock(&ad->amp_mutex);
for (i = 0; i < ARRAY_SIZE(ad1986a_dac_nids); i++) {
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(ad1986a_dac_nids[i], 3, 0, HDA_OUTPUT);
change |= snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
}
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(AD1986A_FRONT_DAC, 3, 0, HDA_OUTPUT);
up(&ad->amp_mutex);
mutex_unlock(&ad->amp_mutex);
return change;
}
@ -544,7 +546,7 @@ static int patch_ad1986a(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
init_MUTEX(&spec->amp_mutex);
mutex_init(&spec->amp_mutex);
codec->spec = spec;
spec->multiout.max_channels = 6;
@ -708,7 +710,7 @@ static int patch_ad1983(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
init_MUTEX(&spec->amp_mutex);
mutex_init(&spec->amp_mutex);
codec->spec = spec;
spec->multiout.max_channels = 2;
@ -854,7 +856,7 @@ static int patch_ad1981(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
init_MUTEX(&spec->amp_mutex);
mutex_init(&spec->amp_mutex);
codec->spec = spec;
spec->multiout.max_channels = 2;
@ -2032,7 +2034,7 @@ static int patch_ad1988(struct hda_codec *codec)
if (spec == NULL)
return -ENOMEM;
init_MUTEX(&spec->amp_mutex);
mutex_init(&spec->amp_mutex);
codec->spec = spec;
if (codec->revision_id == AD1988A_REV2)