aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2009-03-27 19:01:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:43 -0400
commit06630aec92d6a71658ac1538e2a65af5cfc5f2af (patch)
treea765950e5ad32466fee4585c2e9bf3766951a118 /drivers/media/video/hdpvr
parent0b61dca28909bc548581bec75e3b90faaa7f11fd (diff)
V4L/DVB (11245): hdpvr: add struct v4l2_device
Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c9
-rw-r--r--drivers/media/video/hdpvr/hdpvr.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 547833eb6ce..3b19a259dc4 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -278,6 +278,13 @@ static int hdpvr_probe(struct usb_interface *interface,
278 err("Out of memory"); 278 err("Out of memory");
279 goto error; 279 goto error;
280 } 280 }
281
282 /* register v4l2_device early so it can be used for printks */
283 if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
284 err("v4l2_device_register failed");
285 goto error;
286 }
287
281 mutex_init(&dev->io_mutex); 288 mutex_init(&dev->io_mutex);
282 mutex_init(&dev->i2c_mutex); 289 mutex_init(&dev->i2c_mutex);
283 mutex_init(&dev->usbc_mutex); 290 mutex_init(&dev->usbc_mutex);
@@ -387,6 +394,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
387 /* prevent more I/O from starting and stop any ongoing */ 394 /* prevent more I/O from starting and stop any ongoing */
388 mutex_lock(&dev->io_mutex); 395 mutex_lock(&dev->io_mutex);
389 dev->status = STATUS_DISCONNECTED; 396 dev->status = STATUS_DISCONNECTED;
397 v4l2_device_disconnect(&dev->v4l2_dev);
390 video_unregister_device(dev->video_dev); 398 video_unregister_device(dev->video_dev);
391 wake_up_interruptible(&dev->wait_data); 399 wake_up_interruptible(&dev->wait_data);
392 wake_up_interruptible(&dev->wait_buffer); 400 wake_up_interruptible(&dev->wait_buffer);
@@ -413,6 +421,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
413 printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n", 421 printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n",
414 minor); 422 minor);
415 423
424 v4l2_device_unregister(&dev->v4l2_dev);
416 kfree(dev->usbc_buf); 425 kfree(dev->usbc_buf);
417 kfree(dev); 426 kfree(dev);
418} 427}
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h
index 3af415d81df..1edd8759121 100644
--- a/drivers/media/video/hdpvr/hdpvr.h
+++ b/drivers/media/video/hdpvr/hdpvr.h
@@ -15,6 +15,8 @@
15#include <linux/workqueue.h> 15#include <linux/workqueue.h>
16#include <linux/videodev2.h> 16#include <linux/videodev2.h>
17 17
18#include <media/v4l2-device.h>
19
18#define HDPVR_MAJOR_VERSION 0 20#define HDPVR_MAJOR_VERSION 0
19#define HDPVR_MINOR_VERSION 2 21#define HDPVR_MINOR_VERSION 2
20#define HDPVR_RELEASE 0 22#define HDPVR_RELEASE 0
@@ -65,6 +67,8 @@ struct hdpvr_device {
65 struct video_device *video_dev; 67 struct video_device *video_dev;
66 /* the usb device for this device */ 68 /* the usb device for this device */
67 struct usb_device *udev; 69 struct usb_device *udev;
70 /* v4l2-device unused */
71 struct v4l2_device v4l2_dev;
68 72
69 /* the max packet size of the bulk endpoint */ 73 /* the max packet size of the bulk endpoint */
70 size_t bulk_in_size; 74 size_t bulk_in_size;