]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/bt819.c
V4L/DVB: zr364xx: remove unused #include <version.h>
[linux-2.6-omap-h63xx.git] / drivers / media / video / bt819.c
index e0d8e2b186d185ea2f3da1b754f6ff12d3830693..f9330e3529c3e1d03b903ac0fad8a7f49a96c733 100644 (file)
 #include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/delay.h>
-#include <asm/uaccess.h>
 #include <linux/i2c.h>
 #include <linux/i2c-id.h>
 #include <linux/videodev2.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-i2c-drv.h>
+#include <media/bt819.h>
 
 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
 MODULE_AUTHOR("Mike Bernson & Dave Perks");
@@ -250,7 +250,11 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
 
        v4l2_dbg(1, debug, sd, "set norm %llx\n", (unsigned long long)std);
 
+       if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL)
+               v4l2_err(sd, "no notify found!\n");
+
        if (std & V4L2_STD_NTSC) {
+               v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0);
                bt819_setbit(decoder, 0x01, 0, 1);
                bt819_setbit(decoder, 0x01, 1, 0);
                bt819_setbit(decoder, 0x01, 5, 0);
@@ -259,6 +263,7 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
                /* bt819_setbit(decoder, 0x1a,  5, 1); */
                timing = &timing_data[1];
        } else if (std & V4L2_STD_PAL) {
+               v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0);
                bt819_setbit(decoder, 0x01, 0, 1);
                bt819_setbit(decoder, 0x01, 1, 1);
                bt819_setbit(decoder, 0x01, 5, 1);
@@ -283,20 +288,26 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
        bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff);
        bt819_write(decoder, 0x09, timing->hscale & 0xff);
        decoder->norm = std;
+       v4l2_subdev_notify(sd, BT819_FIFO_RESET_HIGH, 0);
        return 0;
 }
 
-static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
+static int bt819_s_routing(struct v4l2_subdev *sd,
+                          u32 input, u32 output, u32 config)
 {
        struct bt819 *decoder = to_bt819(sd);
 
-       v4l2_dbg(1, debug, sd, "set input %x\n", route->input);
+       v4l2_dbg(1, debug, sd, "set input %x\n", input);
 
-       if (route->input < 0 || route->input > 7)
+       if (input < 0 || input > 7)
                return -EINVAL;
 
-       if (decoder->input != route->input) {
-               decoder->input = route->input;
+       if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL)
+               v4l2_err(sd, "no notify found!\n");
+
+       if (decoder->input != input) {
+               v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0);
+               decoder->input = input;
                /* select mode */
                if (decoder->input == 0) {
                        bt819_setbit(decoder, 0x0b, 6, 0);
@@ -305,6 +316,7 @@ static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro
                        bt819_setbit(decoder, 0x0b, 6, 1);
                        bt819_setbit(decoder, 0x1a, 1, 0);
                }
+               v4l2_subdev_notify(sd, BT819_FIFO_RESET_HIGH, 0);
        }
        return 0;
 }
@@ -433,9 +445,6 @@ static const struct v4l2_subdev_core_ops bt819_core_ops = {
        .g_ctrl = bt819_g_ctrl,
        .s_ctrl = bt819_s_ctrl,
        .queryctrl = bt819_queryctrl,
-};
-
-static const struct v4l2_subdev_tuner_ops bt819_tuner_ops = {
        .s_std = bt819_s_std,
 };
 
@@ -448,7 +457,6 @@ static const struct v4l2_subdev_video_ops bt819_video_ops = {
 
 static const struct v4l2_subdev_ops bt819_ops = {
        .core = &bt819_core_ops,
-       .tuner = &bt819_tuner_ops,
        .video = &bt819_video_ops,
 };