From: Guennadi Liakhovetski Date: Thu, 18 Apr 2013 21:35:27 +0000 (-0300) Subject: [media] V4L2: add a common V4L2 subdevice platform data type X-Git-Tag: upstream/snapshot3+hdmi~3461^2~467 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1cbab05d9adbd8d6d7afc822b809c5d47c46f94;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [media] V4L2: add a common V4L2 subdevice platform data type This struct shall be used by subdevice drivers to pass per-subdevice data, e.g. power supplies, to generic V4L2 methods, at the same time allowing optional host-specific extensions via the host_priv pointer. To avoid having to pass two pointers to those methods, add a pointer to this new struct to struct v4l2_subdev. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 46768ee..27b2850 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -559,6 +559,17 @@ struct v4l2_subdev_internal_ops { /* Set this flag if this subdev generates events. */ #define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3) +struct regulator_bulk_data; + +struct v4l2_subdev_platform_data { + /* Optional regulators uset to power on/off the subdevice */ + struct regulator_bulk_data *regulators; + int num_regulators; + + /* Per-subdevice data, specific for a certain video host device */ + void *host_priv; +}; + /* Each instance of a subdev driver should create this struct, either stand-alone or embedded in a larger struct. */ @@ -592,6 +603,8 @@ struct v4l2_subdev { struct v4l2_async_subdev *asd; /* Pointer to the managing notifier. */ struct v4l2_async_notifier *notifier; + /* common part of subdevice platform data */ + struct v4l2_subdev_platform_data *pdata; }; #define media_entity_to_v4l2_subdev(ent) \