aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2010-01-30 12:27:29 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:50 -0500
commit83695009a439b86c520f9001c80cc5a042c2d940 (patch)
tree8519852135e4f1980114c5527092f070d0223bd6 /drivers/media/video/cx18
parent10e43d90da572f088f15cadfb5cc83cd762041c3 (diff)
V4L/DVB: cx18: Rename snd_cx18_mixer_lock to snd_cx18_lock and increase visibility
Rename snd_cx18_mixer_lock() to snd_cx18_lock() in anticpation of using it in the cx18-alsa-pcm.c file routines. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-alsa-mixer.c24
-rw-r--r--drivers/media/video/cx18/cx18-alsa.h16
2 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-mixer.c b/drivers/media/video/cx18/cx18-alsa-mixer.c
index 4251a72f11a..ef21114309f 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 */
42static 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
48static 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}
diff --git a/drivers/media/video/cx18/cx18-alsa.h b/drivers/media/video/cx18/cx18-alsa.h
index 2546779b731..88a1cde7540 100644
--- a/drivers/media/video/cx18/cx18-alsa.h
+++ b/drivers/media/video/cx18/cx18-alsa.h
@@ -32,6 +32,22 @@ struct snd_cx18_card {
32 32
33extern int cx18_alsa_debug; 33extern int cx18_alsa_debug;
34 34
35/*
36 * File operations that manipulate the encoder or video or audio subdevices
37 * need to be serialized. Use the same lock we use for v4l2 file ops.
38 */
39static inline void snd_cx18_lock(struct snd_cx18_card *cxsc)
40{
41 struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
42 mutex_lock(&cx->serialize_lock);
43}
44
45static inline void snd_cx18_unlock(struct snd_cx18_card *cxsc)
46{
47 struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
48 mutex_unlock(&cx->serialize_lock);
49}
50
35#define CX18_ALSA_DBGFLG_WARN (1 << 0) 51#define CX18_ALSA_DBGFLG_WARN (1 << 0)
36#define CX18_ALSA_DBGFLG_WARN (1 << 0) 52#define CX18_ALSA_DBGFLG_WARN (1 << 0)
37#define CX18_ALSA_DBGFLG_INFO (1 << 1) 53#define CX18_ALSA_DBGFLG_INFO (1 << 1)