Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
[sfrench/cifs-2.6.git] / drivers / media / video / cx25840 / cx25840-core.c
index 88f2fd32bfe357617f82f011df18a9c31ddf7997..25eb3bec9e5d9dde1ef7051482dbc7d7e2e7c94a 100644 (file)
@@ -1382,6 +1382,14 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
 
 static int cx25840_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
+       /* ignore this command */
+       if (cmd == TUNER_SET_TYPE_ADDR || cmd == TUNER_SET_CONFIG)
+               return 0;
+
+       /* Old-style drivers rely on initialization on first use, so
+          call the init whenever a command is issued to this driver.
+          New-style drivers using v4l2_subdev should call init explicitly. */
+       cx25840_init(i2c_get_clientdata(client), 0);
        return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
 }