]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
V4L/DVB: cx18: Rename snd_cx18_mixer_lock to snd_cx18_lock and increase visibility
authorAndy Walls <awalls@radix.net>
Sat, 30 Jan 2010 17:27:29 +0000 (14:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:50 +0000 (15:10 -0300)
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>
drivers/media/video/cx18/cx18-alsa-mixer.c
drivers/media/video/cx18/cx18-alsa.h

index 4251a72f11a8bb2e16725bf3c6b3a29db89fd3a7..ef21114309fe61cf4836e96c7c28f0c9fd335f5f 100644 (file)
 #include "cx18-alsa.h"
 #include "cx18-driver.h"
 
-/*
- * Mixer manipulations are like v4l2 ioctl() calls to manipulate controls,
- * just use the same lock we use for ioctl()s for now
- */
-static inline void snd_cx18_mixer_lock(struct snd_cx18_card *cxsc)
-{
-       struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
-       mutex_lock(&cx->serialize_lock);
-}
-
-static inline void snd_cx18_mixer_unlock(struct snd_cx18_card *cxsc)
-{
-       struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
-       mutex_unlock(&cx->serialize_lock);
-}
-
 /*
  * Note the cx18-av-core volume scale is funny, due to the alignment of the
  * scale with another chip's range:
@@ -108,9 +92,9 @@ static int snd_cx18_mixer_tv_vol_get(struct snd_kcontrol *kctl,
        vctrl.id = V4L2_CID_AUDIO_VOLUME;
        vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]);
 
-       snd_cx18_mixer_lock(cxsc);
+       snd_cx18_lock(cxsc);
        ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl);
-       snd_cx18_mixer_unlock(cxsc);
+       snd_cx18_unlock(cxsc);
 
        if (!ret)
                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,
        vctrl.id = V4L2_CID_AUDIO_VOLUME;
        vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]);
 
-       snd_cx18_mixer_lock(cxsc);
+       snd_cx18_lock(cxsc);
 
        /* Fetch current state */
        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,
                if (!ret)
                        ret = 1; /* Indicate control was changed w/o error */
        }
-       snd_cx18_mixer_unlock(cxsc);
+       snd_cx18_unlock(cxsc);
 
        return ret;
 }
index 2546779b7313a3d61cc101af2f5022ad05638e4c..88a1cde7540b21957dddf42d97fae1c99ce69642 100644 (file)
@@ -32,6 +32,22 @@ struct snd_cx18_card {
 
 extern int cx18_alsa_debug;
 
+/*
+ * File operations that manipulate the encoder or video or audio subdevices
+ * need to be serialized.  Use the same lock we use for v4l2 file ops.
+ */
+static inline void snd_cx18_lock(struct snd_cx18_card *cxsc)
+{
+       struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
+       mutex_lock(&cx->serialize_lock);
+}
+
+static inline void snd_cx18_unlock(struct snd_cx18_card *cxsc)
+{
+       struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
+       mutex_unlock(&cx->serialize_lock);
+}
+
 #define CX18_ALSA_DBGFLG_WARN  (1 << 0)
 #define CX18_ALSA_DBGFLG_WARN  (1 << 0)
 #define CX18_ALSA_DBGFLG_INFO  (1 << 1)