aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-04-18 17:35:27 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-10-31 02:30:12 -0400
commitb1cbab05d9adbd8d6d7afc822b809c5d47c46f94 (patch)
tree9e8bb902c061e66cc47a659a51ddca4cd2cce727 /include/media
parent507fcd3da2a28b5342cd0e3eea69b886741adb60 (diff)
[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 <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-subdev.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 46768eed7464..27b28506f749 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -559,6 +559,17 @@ struct v4l2_subdev_internal_ops {
559/* Set this flag if this subdev generates events. */ 559/* Set this flag if this subdev generates events. */
560#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3) 560#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3)
561 561
562struct regulator_bulk_data;
563
564struct v4l2_subdev_platform_data {
565 /* Optional regulators uset to power on/off the subdevice */
566 struct regulator_bulk_data *regulators;
567 int num_regulators;
568
569 /* Per-subdevice data, specific for a certain video host device */
570 void *host_priv;
571};
572
562/* Each instance of a subdev driver should create this struct, either 573/* Each instance of a subdev driver should create this struct, either
563 stand-alone or embedded in a larger struct. 574 stand-alone or embedded in a larger struct.
564 */ 575 */
@@ -592,6 +603,8 @@ struct v4l2_subdev {
592 struct v4l2_async_subdev *asd; 603 struct v4l2_async_subdev *asd;
593 /* Pointer to the managing notifier. */ 604 /* Pointer to the managing notifier. */
594 struct v4l2_async_notifier *notifier; 605 struct v4l2_async_notifier *notifier;
606 /* common part of subdevice platform data */
607 struct v4l2_subdev_platform_data *pdata;
595}; 608};
596 609
597#define media_entity_to_v4l2_subdev(ent) \ 610#define media_entity_to_v4l2_subdev(ent) \