diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-alsa-mixer.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-alsa-mixer.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-mixer.c b/drivers/media/video/cx18/cx18-alsa-mixer.c index 4251a72f11a8..ef21114309fe 100644 --- a/drivers/media/video/cx18/cx18-alsa-mixer.c +++ b/drivers/media/video/cx18/cx18-alsa-mixer.c | |||
@@ -36,22 +36,6 @@ | |||
36 | #include "cx18-driver.h" | 36 | #include "cx18-driver.h" |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Mixer manipulations are like v4l2 ioctl() calls to manipulate controls, | ||
40 | * just use the same lock we use for ioctl()s for now | ||
41 | */ | ||
42 | static inline void snd_cx18_mixer_lock(struct snd_cx18_card *cxsc) | ||
43 | { | ||
44 | struct cx18 *cx = to_cx18(cxsc->v4l2_dev); | ||
45 | mutex_lock(&cx->serialize_lock); | ||
46 | } | ||
47 | |||
48 | static inline void snd_cx18_mixer_unlock(struct snd_cx18_card *cxsc) | ||
49 | { | ||
50 | struct cx18 *cx = to_cx18(cxsc->v4l2_dev); | ||
51 | mutex_unlock(&cx->serialize_lock); | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * Note the cx18-av-core volume scale is funny, due to the alignment of the | 39 | * Note the cx18-av-core volume scale is funny, due to the alignment of the |
56 | * scale with another chip's range: | 40 | * scale with another chip's range: |
57 | * | 41 | * |
@@ -108,9 +92,9 @@ static int snd_cx18_mixer_tv_vol_get(struct snd_kcontrol *kctl, | |||
108 | vctrl.id = V4L2_CID_AUDIO_VOLUME; | 92 | vctrl.id = V4L2_CID_AUDIO_VOLUME; |
109 | vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); | 93 | vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); |
110 | 94 | ||
111 | snd_cx18_mixer_lock(cxsc); | 95 | snd_cx18_lock(cxsc); |
112 | ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); | 96 | ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); |
113 | snd_cx18_mixer_unlock(cxsc); | 97 | snd_cx18_unlock(cxsc); |
114 | 98 | ||
115 | if (!ret) | 99 | if (!ret) |
116 | uctl->value.integer.value[0] = cx18_av_vol_to_dB(vctrl.value); | 100 | uctl->value.integer.value[0] = cx18_av_vol_to_dB(vctrl.value); |
@@ -128,7 +112,7 @@ static int snd_cx18_mixer_tv_vol_put(struct snd_kcontrol *kctl, | |||
128 | vctrl.id = V4L2_CID_AUDIO_VOLUME; | 112 | vctrl.id = V4L2_CID_AUDIO_VOLUME; |
129 | vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); | 113 | vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); |
130 | 114 | ||
131 | snd_cx18_mixer_lock(cxsc); | 115 | snd_cx18_lock(cxsc); |
132 | 116 | ||
133 | /* Fetch current state */ | 117 | /* Fetch current state */ |
134 | ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); | 118 | ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); |
@@ -142,7 +126,7 @@ static int snd_cx18_mixer_tv_vol_put(struct snd_kcontrol *kctl, | |||
142 | if (!ret) | 126 | if (!ret) |
143 | ret = 1; /* Indicate control was changed w/o error */ | 127 | ret = 1; /* Indicate control was changed w/o error */ |
144 | } | 128 | } |
145 | snd_cx18_mixer_unlock(cxsc); | 129 | snd_cx18_unlock(cxsc); |
146 | 130 | ||
147 | return ret; | 131 | return ret; |
148 | } | 132 | } |