aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux/v4l2-framework.txt
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-08 16:02:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:20 -0400
commit98ec633972a70cf71d71bc8762804f0af4792d08 (patch)
tree8f924a6d5804b56a24a58a1e60ea69d53996ece7 /Documentation/video4linux/v4l2-framework.txt
parent005759613b95264fba9138010f112bc138c857c2 (diff)
V4L/DVB (11021): v4l2-device: add a notify callback.
Add a notify callback to v4l2_device to let sub-devices notify their parent of special events. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux/v4l2-framework.txt')
-rw-r--r--Documentation/video4linux/v4l2-framework.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index df0247ed13d8..4207590b2ac8 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -94,6 +94,11 @@ usb_device or platform_device. It is rare for dev to be NULL, but it happens
94with ISA devices or when one device creates multiple PCI devices, thus making 94with ISA devices or when one device creates multiple PCI devices, thus making
95it impossible to associate v4l2_dev with a particular parent. 95it impossible to associate v4l2_dev with a particular parent.
96 96
97You can also supply a notify() callback that can be called by sub-devices to
98notify you of events. Whether you need to set this depends on the sub-device.
99Any notifications a sub-device supports must be defined in a header in
100include/media/<subdevice>.h.
101
97You unregister with: 102You unregister with:
98 103
99 v4l2_device_unregister(struct v4l2_device *v4l2_dev); 104 v4l2_device_unregister(struct v4l2_device *v4l2_dev);
@@ -281,6 +286,11 @@ e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling
281v4l2_device_call_all(). That ensures that it will only go to the subdev 286v4l2_device_call_all(). That ensures that it will only go to the subdev
282that needs it. 287that needs it.
283 288
289If the sub-device needs to notify its v4l2_device parent of an event, then
290it can call v4l2_subdev_notify(sd, notification, arg). This macro checks
291whether there is a notify() callback defined and returns -ENODEV if not.
292Otherwise the result of the notify() call is returned.
293
284The advantage of using v4l2_subdev is that it is a generic struct and does 294The advantage of using v4l2_subdev is that it is a generic struct and does
285not contain any knowledge about the underlying hardware. So a driver might 295not contain any knowledge about the underlying hardware. So a driver might
286contain several subdevs that use an I2C bus, but also a subdev that is 296contain several subdevs that use an I2C bus, but also a subdev that is