diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 8ef578c..7c9820c 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -466,15 +466,15 @@
 	/* checking for i2c-devices can be omitted here, because we
 	   already did this in "mxb_vl42_probe" */
 
-	saa7146_vv_init(dev,&vv_data);
-	if( 0 != saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_GRABBER)) {
+	saa7146_vv_init(dev, &vv_data);
+	if (saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_GRABBER)) {
 		ERR(("cannot register capture v4l2 device. skipping.\n"));
 		return -1;
 	}
 
 	/* initialization stuff (vbi) (only for revision > 0 and for extensions which want it)*/
-	if( 0 != MXB_BOARD_CAN_DO_VBI(dev)) {
-		if( 0 != saa7146_register_device(&mxb->vbi_dev, dev, "mxb", VFL_TYPE_VBI)) {
+	if (MXB_BOARD_CAN_DO_VBI(dev)) {
+		if (saa7146_register_device(&mxb->vbi_dev, dev, "mxb", VFL_TYPE_VBI)) {
 			ERR(("cannot register vbi v4l2 device. skipping.\n"));
 		}
 	}
@@ -486,7 +486,7 @@
 	i2c_use_client(mxb->saa7111a);
 	i2c_use_client(mxb->tuner);
 
-	printk("mxb: found 'Multimedia eXtension Board'-%d.\n",mxb_num);
+	printk("mxb: found Multimedia eXtension Board #%d.\n", mxb_num);
 
 	mxb_num++;
 	mxb_init_done(dev);
@@ -737,8 +737,8 @@
 		DEB_EE(("VIDIOC_G_TUNER: %d\n", t->index));
 
 		memset(t,0,sizeof(*t));
-		strcpy(t->name, "Television");
 
+		strlcpy(t->name, "Television", sizeof(t->name));
 		t->type = V4L2_TUNER_ANALOG_TV;
 		t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
 		t->rangelow = 772;	/* 48.25 MHZ / 62.5 kHz = 772, see fi1216mk2-specs, page 2 */
@@ -746,7 +746,6 @@
 		/* FIXME: add the real signal strength here */
 		t->signal = 0xffff;
 		t->afc = 0;
-
 		mxb->tda9840->driver->command(mxb->tda9840,TDA9840_DETECT, &byte);
 		t->audmode = mxb->cur_mode;
 
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
index 2437c1a..57deeb8 100644
--- a/drivers/media/video/tda9840.c
+++ b/drivers/media/video/tda9840.c
@@ -2,6 +2,7 @@
     tda9840 - i2c-driver for the tda9840 by SGS Thomson
 
     Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de>
+    Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
 
     The tda9840 is a stereo/dual sound processor with digital
     identification. It can be found at address 0x84 on the i2c-bus.
@@ -28,15 +29,18 @@
 #include <linux/module.h>
 #include <linux/ioctl.h>
 #include <linux/i2c.h>
-
+#include <media/v4l2-common.h>
+#include <media/v4l2-i2c-drv-legacy.h>
 #include "tda9840.h"
 
-static int debug;		/* insmod parameter */
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
+MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
+MODULE_DESCRIPTION("tda9840 driver");
+MODULE_LICENSE("GPL");
 
-#define dprintk(args...) \
-	    do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __func__, __LINE__); printk(args); } } while (0)
+static int debug;
+module_param(debug, int, 0644);
+
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
 #define	SWITCH		0x00
 #define	LEVEL_ADJUST	0x02
@@ -49,18 +53,21 @@
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
 
-static struct i2c_driver driver;
-static struct i2c_client client_template;
+static void tda9840_write(struct i2c_client *client, u8 reg, u8 val)
+{
+	if (i2c_smbus_write_byte_data(client, reg, val))
+		v4l_dbg(1, debug, client, "error writing %02x to %02x\n",
+				val, reg);
+}
 
-static int command(struct i2c_client *client, unsigned int cmd, void *arg)
+static int tda9840_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
 	int result;
 	int byte = *(int *)arg;
 
 	switch (cmd) {
 	case TDA9840_SWITCH:
-
-		dprintk("TDA9840_SWITCH: 0x%02x\n", byte);
+		v4l_dbg(1, debug, client, "TDA9840_SWITCH: 0x%02x\n", byte);
 
 		if (byte != TDA9840_SET_MONO
 		    && byte != TDA9840_SET_MUTE
@@ -73,14 +80,11 @@
 			return -EINVAL;
 		}
 
-		result = i2c_smbus_write_byte_data(client, SWITCH, byte);
-		if (result)
-			dprintk("i2c_smbus_write_byte() failed, ret:%d\n", result);
+		tda9840_write(client, SWITCH, byte);
 		break;
 
 	case TDA9840_LEVEL_ADJUST:
-
-		dprintk("TDA9840_LEVEL_ADJUST: %d\n", byte);
+		v4l_dbg(1, debug, client, "TDA9840_LEVEL_ADJUST: %d\n", byte);
 
 		/* check for correct range */
 		if (byte > 25 || byte < -20)
@@ -92,15 +96,11 @@
 			byte += 0x8;
 		else
 			byte = -byte;
-
-		result = i2c_smbus_write_byte_data(client, LEVEL_ADJUST, byte);
-		if (result)
-			dprintk("i2c_smbus_write_byte() failed, ret:%d\n", result);
+		tda9840_write(client, LEVEL_ADJUST, byte);
 		break;
 
 	case TDA9840_STEREO_ADJUST:
-
-		dprintk("TDA9840_STEREO_ADJUST: %d\n", byte);
+		v4l_dbg(1, debug, client, "TDA9840_STEREO_ADJUST: %d\n", byte);
 
 		/* check for correct range */
 		if (byte > 25 || byte < -24)
@@ -113,9 +113,7 @@
 		else
 			byte = -byte;
 
-		result = i2c_smbus_write_byte_data(client, STEREO_ADJUST, byte);
-		if (result)
-			dprintk("i2c_smbus_write_byte() failed, ret:%d\n", result);
+		tda9840_write(client, STEREO_ADJUST, byte);
 		break;
 
 	case TDA9840_DETECT: {
@@ -123,29 +121,29 @@
 
 		byte = i2c_smbus_read_byte_data(client, STEREO_ADJUST);
 		if (byte == -1) {
-			dprintk("i2c_smbus_read_byte_data() failed\n");
+			v4l_dbg(1, debug, client,
+				"i2c_smbus_read_byte_data() failed\n");
 			return -EIO;
 		}
 
-		if (0 != (byte & 0x80)) {
-			dprintk("TDA9840_DETECT: register contents invalid\n");
+		if (byte & 0x80) {
+			v4l_dbg(1, debug, client,
+				"TDA9840_DETECT: register contents invalid\n");
 			return -EINVAL;
 		}
 
-		dprintk("TDA9840_DETECT: byte: 0x%02x\n", byte);
-		*ret = ((byte & 0x60) >> 5);
+		v4l_dbg(1, debug, client, "TDA9840_DETECT: byte: 0x%02x\n", byte);
+		*ret = (byte & 0x60) >> 5;
 		result = 0;
 		break;
 	}
 	case TDA9840_TEST:
-		dprintk("TDA9840_TEST: 0x%02x\n", byte);
+		v4l_dbg(1, debug, client, "TDA9840_TEST: 0x%02x\n", byte);
 
 		/* mask out irrelevant bits */
 		byte &= 0x3;
 
-		result = i2c_smbus_write_byte_data(client, TEST, byte);
-		if (result)
-			dprintk("i2c_smbus_write_byte() failed, ret:%d\n", result);
+		tda9840_write(client, TEST, byte);
 		break;
 	default:
 		return -ENOIOCTLCMD;
@@ -157,99 +155,51 @@
 	return 0;
 }
 
-static int detect(struct i2c_adapter *adapter, int address, int kind)
+static int tda9840_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
 {
-	struct i2c_client *client;
-	int result = 0;
-
-	int byte = 0x0;
+	int result;
+	int byte;
 
 	/* let's see whether this adapter can support what we need */
-	if (0 == i2c_check_functionality(adapter,
-				    I2C_FUNC_SMBUS_READ_BYTE_DATA |
-				    I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {
+	if (!i2c_check_functionality(client->adapter,
+			I2C_FUNC_SMBUS_READ_BYTE_DATA |
+			I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
 		return 0;
-	}
 
-	/* allocate memory for client structure */
-	client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
-	if (!client) {
-		printk("not enough kernel memory\n");
-		return -ENOMEM;
-	}
-
-	/* fill client structure */
-	memcpy(client, &client_template, sizeof(struct i2c_client));
-	client->addr = address;
-	client->adapter = adapter;
-
-	/* tell the i2c layer a new client has arrived */
-	if (0 != (result = i2c_attach_client(client))) {
-		kfree(client);
-		return result;
-	}
+	v4l_info(client, "chip found @ 0x%x (%s)\n",
+			client->addr << 1, client->adapter->name);
 
 	/* set initial values for level & stereo - adjustment, mode */
 	byte = 0;
-	result  = command(client, TDA9840_LEVEL_ADJUST, &byte);
-	result += command(client, TDA9840_STEREO_ADJUST, &byte);
+	result = tda9840_command(client, TDA9840_LEVEL_ADJUST, &byte);
+	result += tda9840_command(client, TDA9840_STEREO_ADJUST, &byte);
 	byte = TDA9840_SET_MONO;
-	result = command(client, TDA9840_SWITCH, &byte);
+	result = tda9840_command(client, TDA9840_SWITCH, &byte);
 	if (result) {
-		dprintk("could not initialize tda9840\n");
+		v4l_dbg(1, debug, client, "could not initialize tda9840\n");
 		return -ENODEV;
 	}
-
-	printk("tda9840: detected @ 0x%02x on adapter %s\n", address, &client->adapter->name[0]);
 	return 0;
 }
 
-static int attach(struct i2c_adapter *adapter)
+static int tda9840_legacy_probe(struct i2c_adapter *adapter)
 {
-	/* let's see whether this is a know adapter we can attach to */
-	if (adapter->id != I2C_HW_SAA7146) {
-		dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
-		return -ENODEV;
-	}
-
-	return i2c_probe(adapter, &addr_data, &detect);
+	/* Let's see whether this is a known adapter we can attach to.
+	   Prevents conflicts with tvaudio.c. */
+	return adapter->id == I2C_HW_SAA7146;
 }
-
-static int detach(struct i2c_client *client)
-{
-	int ret = i2c_detach_client(client);
-	kfree(client);
-	return ret;
-}
-
-static struct i2c_driver driver = {
-	.driver = {
-		.name = "tda9840",
-	},
-	.id	= I2C_DRIVERID_TDA9840,
-	.attach_adapter	= attach,
-	.detach_client	= detach,
-	.command	= command,
+static const struct i2c_device_id tda9840_id[] = {
+	{ "tda9840", 0 },
+	{ }
 };
+MODULE_DEVICE_TABLE(i2c, tda9840_id);
 
-static struct i2c_client client_template = {
+static struct v4l2_i2c_driver_data v4l2_i2c_data = {
 	.name = "tda9840",
-	.driver = &driver,
+	.driverid = I2C_DRIVERID_TDA9840,
+	.command = tda9840_command,
+	.probe = tda9840_probe,
+	.legacy_probe = tda9840_legacy_probe,
+	.id_table = tda9840_id,
 };
-
-static int __init this_module_init(void)
-{
-	return i2c_add_driver(&driver);
-}
-
-static void __exit this_module_exit(void)
-{
-	i2c_del_driver(&driver);
-}
-
-module_init(this_module_init);
-module_exit(this_module_exit);
-
-MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
-MODULE_DESCRIPTION("tda9840 driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 421c144..cde092a 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -2,6 +2,7 @@
     tea6415c - i2c-driver for the tea6415c by SGS Thomson
 
     Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de>
+    Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
 
     The tea6415c is a bus controlled video-matrix-switch
     with 8 inputs and 6 outputs.
@@ -30,18 +31,18 @@
 #include <linux/module.h>
 #include <linux/ioctl.h>
 #include <linux/i2c.h>
-
+#include <media/v4l2-common.h>
+#include <media/v4l2-i2c-drv-legacy.h>
 #include "tea6415c.h"
 
-static int debug;		/* insmod parameter */
+MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
+MODULE_DESCRIPTION("tea6415c driver");
+MODULE_LICENSE("GPL");
+
+static int debug;
 module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
 
-#define dprintk(args...) \
-	    do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __func__, __LINE__); printk(args); } } while (0)
-
-#define TEA6415C_NUM_INPUTS	8
-#define TEA6415C_NUM_OUTPUTS	6
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
 /* addresses to scan, found only at 0x03 and/or 0x43 (7-bit) */
 static unsigned short normal_i2c[] = { I2C_TEA6415C_1, I2C_TEA6415C_2, I2C_CLIENT_END };
@@ -49,60 +50,6 @@
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
 
-static struct i2c_driver driver;
-static struct i2c_client client_template;
-
-/* this function is called by i2c_probe */
-static int detect(struct i2c_adapter *adapter, int address, int kind)
-{
-	struct i2c_client *client = NULL;
-	int err = 0;
-
-	/* let's see whether this adapter can support what we need */
-	if (0 == i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE)) {
-		return 0;
-	}
-
-	/* allocate memory for client structure */
-	client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
-	if (!client) {
-		return -ENOMEM;
-	}
-
-	/* fill client structure */
-	memcpy(client, &client_template, sizeof(struct i2c_client));
-	client->addr = address;
-	client->adapter = adapter;
-
-	/* tell the i2c layer a new client has arrived */
-	if (0 != (err = i2c_attach_client(client))) {
-		kfree(client);
-		return err;
-	}
-
-	printk("tea6415c: detected @ 0x%02x on adapter %s\n", address, &client->adapter->name[0]);
-
-	return 0;
-}
-
-static int attach(struct i2c_adapter *adapter)
-{
-	/* let's see whether this is a know adapter we can attach to */
-	if (adapter->id != I2C_HW_SAA7146) {
-		dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
-		return -ENODEV;
-	}
-
-	return i2c_probe(adapter, &addr_data, &detect);
-}
-
-static int detach(struct i2c_client *client)
-{
-	int ret = i2c_detach_client(client);
-	kfree(client);
-	return ret;
-}
-
 /* makes a connection between the input-pin 'i' and the output-pin 'o'
    for the tea6415c-client 'client' */
 static int switch_matrix(struct i2c_client *client, int i, int o)
@@ -110,7 +57,7 @@
 	u8 byte = 0;
 	int ret;
 
-	dprintk("adr:0x%02x, i:%d, o:%d\n", client->addr, i, o);
+	v4l_dbg(1, debug, client, "i=%d, o=%d\n", i, o);
 
 	/* check if the pins are valid */
 	if (0 == ((1 == i ||  3 == i ||  5 == i ||  6 == i ||  8 == i || 10 == i || 20 == i || 11 == i)
@@ -168,14 +115,14 @@
 
 	ret = i2c_smbus_write_byte(client, byte);
 	if (ret) {
-		dprintk("i2c_smbus_write_byte() failed, ret:%d\n", ret);
+		v4l_dbg(1, debug, client,
+			"i2c_smbus_write_byte() failed, ret:%d\n", ret);
 		return -EIO;
 	}
-
 	return ret;
 }
 
-static int command(struct i2c_client *client, unsigned int cmd, void *arg)
+static int tea6415c_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
 	struct tea6415c_multiplex *v = (struct tea6415c_multiplex *)arg;
 	int result = 0;
@@ -187,38 +134,40 @@
 	default:
 		return -ENOIOCTLCMD;
 	}
-
 	return result;
 }
 
-static struct i2c_driver driver = {
-	.driver = {
-		.name = "tea6415c",
-	},
-	.id 	= I2C_DRIVERID_TEA6415C,
-	.attach_adapter	= attach,
-	.detach_client	= detach,
-	.command	= command,
-};
+/* this function is called by i2c_probe */
+static int tea6415c_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
+{
+	/* let's see whether this adapter can support what we need */
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE))
+		return 0;
 
-static struct i2c_client client_template = {
+	v4l_info(client, "chip found @ 0x%x (%s)\n",
+			client->addr << 1, client->adapter->name);
+	return 0;
+}
+
+static int tea6415c_legacy_probe(struct i2c_adapter *adapter)
+{
+	/* Let's see whether this is a known adapter we can attach to.
+	   Prevents conflicts with tvaudio.c. */
+	return adapter->id == I2C_HW_SAA7146;
+}
+
+static const struct i2c_device_id tea6415c_id[] = {
+	{ "tea6415c", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, tea6415c_id);
+
+static struct v4l2_i2c_driver_data v4l2_i2c_data = {
 	.name = "tea6415c",
-	.driver = &driver,
+	.driverid = I2C_DRIVERID_TEA6415C,
+	.command = tea6415c_command,
+	.probe = tea6415c_probe,
+	.legacy_probe = tea6415c_legacy_probe,
+	.id_table = tea6415c_id,
 };
-
-static int __init this_module_init(void)
-{
-	return i2c_add_driver(&driver);
-}
-
-static void __exit this_module_exit(void)
-{
-	i2c_del_driver(&driver);
-}
-
-module_init(this_module_init);
-module_exit(this_module_exit);
-
-MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
-MODULE_DESCRIPTION("tea6415c driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index b5c8957..e508209 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -2,6 +2,7 @@
     tea6420 - i2c-driver for the tea6420 by SGS Thomson
 
     Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de>
+    Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
 
     The tea6420 is a bus controlled audio-matrix with 5 stereo inputs,
     4 stereo outputs and gain control for each output.
@@ -30,15 +31,18 @@
 #include <linux/module.h>
 #include <linux/ioctl.h>
 #include <linux/i2c.h>
-
+#include <media/v4l2-common.h>
+#include <media/v4l2-i2c-drv-legacy.h>
 #include "tea6420.h"
 
-static int debug;		/* insmod parameter */
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off).");
+MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
+MODULE_DESCRIPTION("tea6420 driver");
+MODULE_LICENSE("GPL");
 
-#define dprintk(args...) \
-	    do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __func__, __LINE__); printk(args); } } while (0)
+static int debug;
+module_param(debug, int, 0644);
+
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
 /* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */
 static unsigned short normal_i2c[] = { I2C_ADDR_TEA6420_1, I2C_ADDR_TEA6420_2, I2C_CLIENT_END };
@@ -46,23 +50,20 @@
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
 
-static struct i2c_driver driver;
-static struct i2c_client client_template;
-
 /* make a connection between the input 'i' and the output 'o'
    with gain 'g' for the tea6420-client 'client' (note: i = 6 means 'mute') */
 static int tea6420_switch(struct i2c_client *client, int i, int o, int g)
 {
-	u8 byte = 0;
+	u8 byte;
 	int ret;
 
-	dprintk("adr:0x%02x, i:%d, o:%d, g:%d\n", client->addr, i, o, g);
+	v4l_dbg(1, debug, client, "i=%d, o=%d, g=%d\n", i, o, g);
 
 	/* check if the parameters are valid */
 	if (i < 1 || i > 6 || o < 1 || o > 4 || g < 0 || g > 6 || g % 2 != 0)
 		return -1;
 
-	byte  = ((o - 1) << 5);
+	byte = ((o - 1) << 5);
 	byte |= (i - 1);
 
 	/* to understand this, have a look at the tea6420-specs (p.5) */
@@ -82,76 +83,14 @@
 
 	ret = i2c_smbus_write_byte(client, byte);
 	if (ret) {
-		dprintk("i2c_smbus_write_byte() failed, ret:%d\n", ret);
+		v4l_dbg(1, debug, client,
+			"i2c_smbus_write_byte() failed, ret:%d\n", ret);
 		return -EIO;
 	}
-
 	return 0;
 }
 
-/* this function is called by i2c_probe */
-static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
-{
-	struct i2c_client *client;
-	int err = 0, i = 0;
-
-	/* let's see whether this adapter can support what we need */
-	if (0 == i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE)) {
-		return 0;
-	}
-
-	/* allocate memory for client structure */
-	client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-	if (!client) {
-		return -ENOMEM;
-	}
-
-	/* fill client structure */
-	memcpy(client, &client_template, sizeof(struct i2c_client));
-	client->addr = address;
-	client->adapter = adapter;
-
-	/* tell the i2c layer a new client has arrived */
-	if (0 != (err = i2c_attach_client(client))) {
-		kfree(client);
-		return err;
-	}
-
-	/* set initial values: set "mute"-input to all outputs at gain 0 */
-	err = 0;
-	for (i = 1; i < 5; i++) {
-		err += tea6420_switch(client, 6, i, 0);
-	}
-	if (err) {
-		dprintk("could not initialize tea6420\n");
-		kfree(client);
-		return -ENODEV;
-	}
-
-	printk("tea6420: detected @ 0x%02x on adapter %s\n", address, &client->adapter->name[0]);
-
-	return 0;
-}
-
-static int attach(struct i2c_adapter *adapter)
-{
-	/* let's see whether this is a know adapter we can attach to */
-	if (adapter->id != I2C_HW_SAA7146) {
-		dprintk("refusing to probe on unknown adapter [name='%s',id=0x%x]\n", adapter->name, adapter->id);
-		return -ENODEV;
-	}
-
-	return i2c_probe(adapter, &addr_data, &tea6420_detect);
-}
-
-static int detach(struct i2c_client *client)
-{
-	int ret = i2c_detach_client(client);
-	kfree(client);
-	return ret;
-}
-
-static int command(struct i2c_client *client, unsigned int cmd, void *arg)
+static int tea6420_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
 	struct tea6420_multiplex *a = (struct tea6420_multiplex *)arg;
 	int result = 0;
@@ -167,34 +106,50 @@
 	return result;
 }
 
-static struct i2c_driver driver = {
-	.driver = {
-		.name = "tea6420",
-	},
-	.id	= I2C_DRIVERID_TEA6420,
-	.attach_adapter	= attach,
-	.detach_client	= detach,
-	.command	= command,
-};
+/* this function is called by i2c_probe */
+static int tea6420_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
+{
+	int err, i;
 
-static struct i2c_client client_template = {
+	/* let's see whether this adapter can support what we need */
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE))
+		return -EIO;
+
+	v4l_info(client, "chip found @ 0x%x (%s)\n",
+			client->addr << 1, client->adapter->name);
+
+	/* set initial values: set "mute"-input to all outputs at gain 0 */
+	err = 0;
+	for (i = 1; i < 5; i++) {
+		err += tea6420_switch(client, 6, i, 0);
+	}
+	if (err) {
+		v4l_dbg(1, debug, client, "could not initialize tea6420\n");
+		kfree(client);
+		return -ENODEV;
+	}
+	return 0;
+}
+
+static int tea6420_legacy_probe(struct i2c_adapter *adapter)
+{
+	/* Let's see whether this is a known adapter we can attach to.
+	   Prevents conflicts with tvaudio.c. */
+	return adapter->id == I2C_HW_SAA7146;
+}
+
+static const struct i2c_device_id tea6420_id[] = {
+	{ "tea6420", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, tea6420_id);
+
+static struct v4l2_i2c_driver_data v4l2_i2c_data = {
 	.name = "tea6420",
-	.driver = &driver,
+	.driverid = I2C_DRIVERID_TEA6420,
+	.command = tea6420_command,
+	.probe = tea6420_probe,
+	.legacy_probe = tea6420_legacy_probe,
+	.id_table = tea6420_id,
 };
-
-static int __init this_module_init(void)
-{
-	return i2c_add_driver(&driver);
-}
-
-static void __exit this_module_exit(void)
-{
-	i2c_del_driver(&driver);
-}
-
-module_init(this_module_init);
-module_exit(this_module_exit);
-
-MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
-MODULE_DESCRIPTION("tea6420 driver");
-MODULE_LICENSE("GPL");
