• Home
  • Raw
  • Download

Lines Matching refs:device

12 hardware: most devices have multiple ICs, export multiple device nodes in
23 creating V4L device nodes and video_buf for handling the video buffers
26 This meant that all drivers had to do the setup of device instances and
43 1) A struct for each device instance containing the device state.
47 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and
48 /dev/vtxX) and keeping track of device-node specific data.
54 device instances
56 +-sub-device instances
58 \-V4L2 device nodes
67 struct for the device instance data, a v4l2_subdev struct to refer to
68 sub-device instances, the video_device struct stores V4L2 device node data
76 Each device instance is represented by a struct v4l2_device (v4l2-device.h).
80 You must register the device instance:
82 v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
89 The first 'dev' argument is normally the struct device pointer of a pci_dev,
96 Unregistering will also automatically unregister all subdevs from the device.
99 driver. This is usually the case if multiple device drivers use the same
105 static int callback(struct device *dev, void *p)
109 /* test if this device was inited */
124 /* iterate over all ivtv device instances */
130 Sometimes you need to keep a running counter of the device instance. This is
131 commonly used to map a device instance to an index of a module option array.
157 Each sub-device driver must have a v4l2_subdev struct. This struct can be
160 device struct (e.g. i2c_client) that contains the device data as setup
163 from a v4l2_subdev to the actual low-level bus-specific device data.
169 From the bridge driver perspective you load the sub-device module and somehow
175 Each v4l2_subdev contains function pointers that sub-device drivers can
213 depending on the sub-device. E.g. a video device is unlikely to support the
219 A sub-device driver initializes the v4l2_subdev struct using:
226 A device (bridge) driver needs to register the v4l2_subdev with the
229 int err = v4l2_device_register_subdev(device, subdev);
235 You can unregister a sub-device using:
269 bridge driver and the sub-device driver will never modify or use it.
283 up the device, but once the subdev is registered it is completely transparent.
286 I2C sub-device drivers
294 I2C device instance. Very simple devices have no state struct and in that case
340 is called. This will unregister the sub-device from the bridge driver. It is
341 safe to call this even if the sub-device was never registered.
365 The actual device nodes in the /dev directory are created using the
386 of the video device exits.
393 - v4l2_dev: set to the v4l2_device parent device.
410 Next you register the video device: this will create the character device
419 Which device is registered depends on the type argument. The following
427 The last argument gives you a certain amount of control over the device
439 Whenever a device node is created some attributes are also created for you.
443 a device node index that can be assigned by the driver, or that is calculated
447 1 for each device node you register. The first video device node you register
455 device names (e.g. 'mpegX' for MPEG video capture device nodes).
457 After the device was successfully registered, then you can use these fields:
459 - vfl_type: the device type passed to video_register_device.
460 - minor: the assigned device minor number.
461 - num: the device kernel number (i.e. the X in videoX).
462 - index: the device index number (calculated or set explicitly using
469 unregister the device if the registration failed.
475 When the video device nodes have to be removed, either during the unload
476 of the driver or because the USB device was disconnected, then you should
481 This will remove the device nodes from sysfs (causing udev to remove them
487 of these device nodes open. You should block all new accesses to read,
491 When the last user of the video device node exits, then the vdev->release()