summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/au0828/au0828-core.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:01:04 -0400
committerDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:01:04 -0400
commit1c6b90fa7084d63133a8418affbf10267f674abb (patch)
tree5b2480e0afeefa31614ecbc9130fd44fd24467ba /linux/drivers/media/video/au0828/au0828-core.c
parent10fd27b598ce42b251b665f6922961ddac7ff90e (diff)
downloadmediapointer-dvb-s2-1c6b90fa7084d63133a8418affbf10267f674abb.tar.gz
mediapointer-dvb-s2-1c6b90fa7084d63133a8418affbf10267f674abb.tar.bz2
au0828: Convert to use v4l2_device/subdev framework
From: Devin Heitmueller <dheitmueller@linuxtv.org> Convert over to using the new subdev framework for the au0828 bridge. This includes using the new i2c probing mechanism. Priority: normal Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video/au0828/au0828-core.c')
-rw-r--r--linux/drivers/media/video/au0828/au0828-core.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/linux/drivers/media/video/au0828/au0828-core.c b/linux/drivers/media/video/au0828/au0828-core.c
index a477c8587..327c6edde 100644
--- a/linux/drivers/media/video/au0828/au0828-core.c
+++ b/linux/drivers/media/video/au0828/au0828-core.c
@@ -153,6 +153,8 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
/* I2C */
au0828_i2c_unregister(dev);
+ v4l2_device_unregister(&dev->v4l2_dev);
+
usb_set_intfdata(interface, NULL);
mutex_lock(&dev->mutex);
@@ -166,7 +168,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
static int au0828_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
- int ifnum;
+ int ifnum, retval;
struct au0828_dev *dev;
struct usb_device *usbdev = interface_to_usbdev(interface);
@@ -193,6 +195,17 @@ static int au0828_usb_probe(struct usb_interface *interface,
usb_set_intfdata(interface, dev);
+ /* Create the v4l2_device */
+ snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name), "%s-%03d",
+ "au0828", 0);
+ retval = v4l2_device_register(&dev->usbdev->dev, &dev->v4l2_dev);
+ if (retval) {
+ printk(KERN_ERR "%s() v4l2_device_register failed\n",
+ __func__);
+ kfree(dev);
+ return -EIO;
+ }
+
/* Power Up the bridge */
au0828_write(dev, REG_600, 1 << 4);