summaryrefslogtreecommitdiff
path: root/linux/include/media/v4l2-device.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-05-05 08:42:18 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-05-05 08:42:18 -0300
commitb6d0c4b9b47910a71f4fcec532cd503f319da0d8 (patch)
tree5fdbc6612d7ba83dbcb34585472832ae1bd05e8f /linux/include/media/v4l2-device.h
parent3d2b4c935e8804f2ed232614079f41ab6360aad2 (diff)
parenta98b15d8435d3661c93a5e73eca17f300508a11c (diff)
downloadmediapointer-dvb-s2-b6d0c4b9b47910a71f4fcec532cd503f319da0d8.tar.gz
mediapointer-dvb-s2-b6d0c4b9b47910a71f4fcec532cd503f319da0d8.tar.bz2
merge: http://jusst.de/hg/v4l-dvb/rev/da67609aae86
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/include/media/v4l2-device.h')
-rw-r--r--linux/include/media/v4l2-device.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/linux/include/media/v4l2-device.h b/linux/include/media/v4l2-device.h
index 9afd39fb2..5d5d550e6 100644
--- a/linux/include/media/v4l2-device.h
+++ b/linux/include/media/v4l2-device.h
@@ -53,10 +53,31 @@ struct v4l2_device {
dev may be NULL in rare cases (ISA devices). In that case you
must fill in the v4l2_dev->name field before calling this function. */
int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
+
+/* Optional function to initialize the name field of struct v4l2_device using
+ the driver name and a driver-global atomic_t instance.
+ This function will increment the instance counter and returns the instance
+ value used in the name.
+
+ Example:
+
+ static atomic_t drv_instance = ATOMIC_INIT(0);
+
+ ...
+
+ instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance);
+
+ The first time this is called the name field will be set to foo0 and
+ this function returns 0. If the name ends with a digit (e.g. cx18),
+ then the name will be set to cx18-0 since cx180 looks really odd. */
+int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
+ atomic_t *instance);
+
/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
Since the parent disappears this ensures that v4l2_dev doesn't have an
invalid parent pointer. */
void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
+
/* Unregister all sub-devices and any other resources related to v4l2_dev. */
void v4l2_device_unregister(struct v4l2_device *v4l2_dev);