diff options
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r-- | include/media/v4l2-subdev.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index bfda0fe9aeb0..d67210a37ef3 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 | ||
562 | struct regulator_bulk_data; | ||
563 | |||
564 | struct 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) \ |
@@ -622,13 +635,13 @@ struct v4l2_subdev_fh { | |||
622 | v4l2_subdev_get_try_##fun_name(struct v4l2_subdev_fh *fh, \ | 635 | v4l2_subdev_get_try_##fun_name(struct v4l2_subdev_fh *fh, \ |
623 | unsigned int pad) \ | 636 | unsigned int pad) \ |
624 | { \ | 637 | { \ |
625 | BUG_ON(unlikely(pad >= vdev_to_v4l2_subdev( \ | 638 | BUG_ON(pad >= vdev_to_v4l2_subdev( \ |
626 | fh->vfh.vdev)->entity.num_pads)); \ | 639 | fh->vfh.vdev)->entity.num_pads); \ |
627 | return &fh->pad[pad].field_name; \ | 640 | return &fh->pad[pad].field_name; \ |
628 | } | 641 | } |
629 | 642 | ||
630 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, format, try_fmt) | 643 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, format, try_fmt) |
631 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, crop, try_compose) | 644 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, crop, try_crop) |
632 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, compose, try_compose) | 645 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, compose, try_compose) |
633 | #endif | 646 | #endif |
634 | 647 | ||