include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / video / ks0127.c
index 678c4e2..9473482 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/kernel.h>
 #include <linux/i2c.h>
 #include <linux/videodev2.h>
+#include <linux/slab.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-i2c-drv.h>
@@ -409,11 +410,12 @@ static void ks0127_init(struct v4l2_subdev *sd)
        }
 }
 
-static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
+static int ks0127_s_routing(struct v4l2_subdev *sd,
+                           u32 input, u32 output, u32 config)
 {
        struct ks0127 *ks = to_ks0127(sd);
 
-       switch (route->input) {
+       switch (input) {
        case KS_INPUT_COMPOSITE_1:
        case KS_INPUT_COMPOSITE_2:
        case KS_INPUT_COMPOSITE_3:
@@ -421,13 +423,13 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
        case KS_INPUT_COMPOSITE_5:
        case KS_INPUT_COMPOSITE_6:
                v4l2_dbg(1, debug, sd,
-                       "VIDIOC_S_INPUT %d: Composite\n", route->input);
+                       "s_routing %d: Composite\n", input);
                /* autodetect 50/60 Hz */
                ks0127_and_or(sd, KS_CMDA,   0xfc, 0x00);
                /* VSE=0 */
                ks0127_and_or(sd, KS_CMDA,   ~0x40, 0x00);
                /* set input line */
-               ks0127_and_or(sd, KS_CMDB,   0xb0, route->input);
+               ks0127_and_or(sd, KS_CMDB,   0xb0, input);
                /* non-freerunning mode */
                ks0127_and_or(sd, KS_CMDC,   0x70, 0x0a);
                /* analog input */
@@ -455,13 +457,13 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
        case KS_INPUT_SVIDEO_2:
        case KS_INPUT_SVIDEO_3:
                v4l2_dbg(1, debug, sd,
-                       "VIDIOC_S_INPUT %d: S-Video\n", route->input);
+                       "s_routing %d: S-Video\n", input);
                /* autodetect 50/60 Hz */
                ks0127_and_or(sd, KS_CMDA,   0xfc, 0x00);
                /* VSE=0 */
                ks0127_and_or(sd, KS_CMDA,   ~0x40, 0x00);
                /* set input line */
-               ks0127_and_or(sd, KS_CMDB,   0xb0, route->input);
+               ks0127_and_or(sd, KS_CMDB,   0xb0, input);
                /* non-freerunning mode */
                ks0127_and_or(sd, KS_CMDC,   0x70, 0x0a);
                /* analog input */
@@ -486,7 +488,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
                break;
 
        case KS_INPUT_YUV656:
-               v4l2_dbg(1, debug, sd, "VIDIOC_S_INPUT 15: YUV656\n");
+               v4l2_dbg(1, debug, sd, "s_routing 15: YUV656\n");
                if (ks->norm & V4L2_STD_525_60)
                        /* force 60 Hz */
                        ks0127_and_or(sd, KS_CMDA,   0xfc, 0x03);
@@ -496,7 +498,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
 
                ks0127_and_or(sd, KS_CMDA,   0xff, 0x40); /* VSE=1 */
                /* set input line and VALIGN */
-               ks0127_and_or(sd, KS_CMDB,   0xb0, (route->input | 0x40));
+               ks0127_and_or(sd, KS_CMDB,   0xb0, (input | 0x40));
                /* freerunning mode, */
                /* TSTGEN = 1 TSTGFR=11 TSTGPH=0 TSTGPK=0  VMEM=1*/
                ks0127_and_or(sd, KS_CMDC,   0x70, 0x87);
@@ -531,7 +533,7 @@ static int ks0127_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *r
 
        default:
                v4l2_dbg(1, debug, sd,
-                       "VIDIOC_INT_S_VIDEO_ROUTING: Unknown input %d\n", route->input);
+                       "s_routing: Unknown input %d\n", input);
                break;
        }
 
@@ -551,23 +553,23 @@ static int ks0127_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
        ks->norm = std;
        if (std & V4L2_STD_NTSC) {
                v4l2_dbg(1, debug, sd,
-                       "VIDIOC_S_STD: NTSC_M\n");
+                       "s_std: NTSC_M\n");
                ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20);
        } else if (std & V4L2_STD_PAL_N) {
                v4l2_dbg(1, debug, sd,
-                       "KS0127_SET_NORM: NTSC_N (fixme)\n");
+                       "s_std: NTSC_N (fixme)\n");
                ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40);
        } else if (std & V4L2_STD_PAL) {
                v4l2_dbg(1, debug, sd,
-                       "VIDIOC_S_STD: PAL_N\n");
+                       "s_std: PAL_N\n");
                ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x20);
        } else if (std & V4L2_STD_PAL_M) {
                v4l2_dbg(1, debug, sd,
-                       "KS0127_SET_NORM: PAL_M (fixme)\n");
+                       "s_std: PAL_M (fixme)\n");
                ks0127_and_or(sd, KS_CHROMA, 0x9f, 0x40);
        } else if (std & V4L2_STD_SECAM) {
                v4l2_dbg(1, debug, sd,
-                       "KS0127_SET_NORM: SECAM\n");
+                       "s_std: SECAM\n");
 
                /* set to secam autodetection */
                ks0127_and_or(sd, KS_CHROMA, 0xdf, 0x20);
@@ -579,8 +581,8 @@ static int ks0127_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
                        /* force to secam mode */
                        ks0127_and_or(sd, KS_DEMOD, 0xf0, 0x0f);
        } else {
-               v4l2_dbg(1, debug, sd,
-                       "VIDIOC_S_STD: Unknown norm %llx\n", std);
+               v4l2_dbg(1, debug, sd, "s_std: Unknown norm %llx\n",
+                              (unsigned long long)std);
        }
        return 0;
 }
@@ -608,7 +610,6 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd
        u8 status;
        v4l2_std_id std = V4L2_STD_ALL;
 
-       v4l2_dbg(1, debug, sd, "VIDIOC_QUERYSTD/VIDIOC_INT_G_INPUT_STATUS\n");
        status = ks0127_read(sd, KS_STAT);
        if (!(status & 0x20))            /* NOVID not set */
                stat = 0;
@@ -627,11 +628,13 @@ static int ks0127_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd
 
 static int ks0127_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
 {
+       v4l2_dbg(1, debug, sd, "querystd\n");
        return ks0127_status(sd, NULL, std);
 }
 
 static int ks0127_g_input_status(struct v4l2_subdev *sd, u32 *status)
 {
+       v4l2_dbg(1, debug, sd, "g_input_status\n");
        return ks0127_status(sd, status, NULL);
 }
 
@@ -647,9 +650,6 @@ static int ks0127_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_iden
 
 static const struct v4l2_subdev_core_ops ks0127_core_ops = {
        .g_chip_ident = ks0127_g_chip_ident,
-};
-
-static const struct v4l2_subdev_tuner_ops ks0127_tuner_ops = {
        .s_std = ks0127_s_std,
 };
 
@@ -662,7 +662,6 @@ static const struct v4l2_subdev_video_ops ks0127_video_ops = {
 
 static const struct v4l2_subdev_ops ks0127_ops = {
        .core = &ks0127_core_ops,
-       .tuner = &ks0127_tuner_ops,
        .video = &ks0127_video_ops,
 };