aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-subdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r--include/media/v4l2-subdev.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 349e1c18cf48..a7fa5b80915a 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -755,7 +755,17 @@ struct v4l2_subdev_ops {
755 * 755 *
756 * @open: called when the subdev device node is opened by an application. 756 * @open: called when the subdev device node is opened by an application.
757 * 757 *
758 * @close: called when the subdev device node is closed. 758 * @close: called when the subdev device node is closed. Please note that
759 * it is possible for @close to be called after @unregistered!
760 *
761 * @release: called when the last user of the subdev device is gone. This
762 * happens after the @unregistered callback and when the last open
763 * filehandle to the v4l-subdevX device node was closed. If no device
764 * node was created for this sub-device, then the @release callback
765 * is called right after the @unregistered callback.
766 * The @release callback is typically used to free the memory containing
767 * the v4l2_subdev structure. It is almost certainly required for any
768 * sub-device that sets the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
759 * 769 *
760 * .. note:: 770 * .. note::
761 * Never call this from drivers, only the v4l2 framework can call 771 * Never call this from drivers, only the v4l2 framework can call
@@ -766,6 +776,7 @@ struct v4l2_subdev_internal_ops {
766 void (*unregistered)(struct v4l2_subdev *sd); 776 void (*unregistered)(struct v4l2_subdev *sd);
767 int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh); 777 int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
768 int (*close)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh); 778 int (*close)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
779 void (*release)(struct v4l2_subdev *sd);
769}; 780};
770 781
771#define V4L2_SUBDEV_NAME_SIZE 32 782#define V4L2_SUBDEV_NAME_SIZE 32
@@ -899,9 +910,11 @@ struct v4l2_subdev {
899 * 910 *
900 * @vfh: pointer to &struct v4l2_fh 911 * @vfh: pointer to &struct v4l2_fh
901 * @pad: pointer to &struct v4l2_subdev_pad_config 912 * @pad: pointer to &struct v4l2_subdev_pad_config
913 * @owner: module pointer to the owner of this file handle
902 */ 914 */
903struct v4l2_subdev_fh { 915struct v4l2_subdev_fh {
904 struct v4l2_fh vfh; 916 struct v4l2_fh vfh;
917 struct module *owner;
905#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) 918#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
906 struct v4l2_subdev_pad_config *pad; 919 struct v4l2_subdev_pad_config *pad;
907#endif 920#endif