V4L/DVB (12231): gspca - main: Version change.
[safe/jmp/linux-2.6] / drivers / media / video / bt866.c
index 18d3838..af7e3a5 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/videodev2.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-chip-ident.h>
-#include <media/v4l2-i2c-drv-legacy.h>
+#include <media/v4l2-i2c-drv.h>
 
 MODULE_DESCRIPTION("Brooktree-866 video encoder driver");
 MODULE_AUTHOR("Mike Bernson & Dave Perks");
@@ -47,9 +47,6 @@ static int debug;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
-static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
-
-I2C_CLIENT_INSMOD;
 
 /* ----------------------------------------------------------------------- */
 
@@ -94,7 +91,7 @@ static int bt866_write(struct bt866 *encoder, u8 subaddr, u8 data)
 
 static int bt866_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
 {
-       v4l2_dbg(1, debug, sd, "set norm %llx\n", std);
+       v4l2_dbg(1, debug, sd, "set norm %llx\n", (unsigned long long)std);
 
        /* Only PAL supported by this driver at the moment! */
        if (!(std & V4L2_STD_NTSC))
@@ -102,7 +99,8 @@ static int bt866_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
        return 0;
 }
 
-static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route)
+static int bt866_s_routing(struct v4l2_subdev *sd,
+                          u32 input, u32 output, u32 config)
 {
        static const __u8 init[] = {
                0xc8, 0xcc, /* CRSCALE */
@@ -140,7 +138,7 @@ static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro
 
        val = encoder->reg[0xdc];
 
-       if (route->input == 0)
+       if (input == 0)
                val |= 0x40; /* CBSWAP */
        else
                val &= ~0x40; /* !CBSWAP */
@@ -148,15 +146,15 @@ static int bt866_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro
        bt866_write(encoder, 0xdc, val);
 
        val = encoder->reg[0xcc];
-       if (route->input == 2)
+       if (input == 2)
                val |= 0x01; /* OSDBAR */
        else
                val &= ~0x01; /* !OSDBAR */
        bt866_write(encoder, 0xcc, val);
 
-       v4l2_dbg(1, debug, sd, "set input %d\n", route->input);
+       v4l2_dbg(1, debug, sd, "set input %d\n", input);
 
-       switch (route->input) {
+       switch (input) {
        case 0:
        case 1:
        case 2:
@@ -185,11 +183,6 @@ static int bt866_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident
        return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_BT866, 0);
 }
 
-static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
-{
-       return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
-}
-
 /* ----------------------------------------------------------------------- */
 
 static const struct v4l2_subdev_core_ops bt866_core_ops = {
@@ -232,11 +225,6 @@ static int bt866_remove(struct i2c_client *client)
        return 0;
 }
 
-static int bt866_legacy_probe(struct i2c_adapter *adapter)
-{
-       return adapter->id == I2C_HW_B_ZR36067;
-}
-
 static const struct i2c_device_id bt866_id[] = {
        { "bt866", 0 },
        { }
@@ -245,10 +233,7 @@ MODULE_DEVICE_TABLE(i2c, bt866_id);
 
 static struct v4l2_i2c_driver_data v4l2_i2c_data = {
        .name = "bt866",
-       .driverid = I2C_DRIVERID_BT866,
-       .command = bt866_command,
        .probe = bt866_probe,
        .remove = bt866_remove,
-       .legacy_probe = bt866_legacy_probe,
        .id_table = bt866_id,
 };