V4L/DVB (5452): Cx88: merge identical boards
[safe/jmp/linux-2.6] / drivers / media / video / cx88 / cx88-video.c
index d388a42..bdfe2af 100644 (file)
@@ -86,8 +86,6 @@ static LIST_HEAD(cx8800_devlist);
 /* ------------------------------------------------------------------- */
 /* static data                                                         */
 
-v4l2_std_id radionorms[] = { 0 };
-
 static struct cx8800_fmt formats[] = {
        {
                .name     = "8 bpp, gray",
@@ -1385,6 +1383,30 @@ static int vidioc_s_frequency (struct file *file, void *priv,
                cx88_set_freq (core,f);
 }
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int vidioc_g_register (struct file *file, void *fh,
+                               struct v4l2_register *reg)
+{
+       struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
+
+       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+               return -EINVAL;
+       /* cx2388x has a 24-bit register space */
+       reg->val = cx_read(reg->reg&0xffffff);
+       return 0;
+}
+
+static int vidioc_s_register (struct file *file, void *fh,
+                               struct v4l2_register *reg)
+{
+       struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
+
+       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+               return -EINVAL;
+       cx_write(reg->reg&0xffffff, reg->val);
+       return 0;
+}
+#endif
 
 /* ----------------------------------------------------------- */
 /* RADIO ESPECIFIC IOCTLS                                      */
@@ -1656,8 +1678,12 @@ static struct video_device cx8800_video_template =
        .vidioc_s_tuner       = vidioc_s_tuner,
        .vidioc_g_frequency   = vidioc_g_frequency,
        .vidioc_s_frequency   = vidioc_s_frequency,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+       .vidioc_g_register    = vidioc_g_register,
+       .vidioc_s_register    = vidioc_s_register,
+#endif
        .tvnorms              = CX88_NORMS,
-       .current_norm         = V4L2_STD_PAL_BG,
+       .current_norm         = V4L2_STD_NTSC_M,
 };
 
 static const struct file_operations radio_fops =