summaryrefslogtreecommitdiff
path: root/drivers/media/platform/rcar-vin/rcar-vin.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2018-04-14 07:57:21 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-20 10:23:39 -0400
commitc7e80b67b63046ffa299a471e42be3eddc2e1d31 (patch)
tree00b3295985bf218865d61e12f302fa80fb880c07 /drivers/media/platform/rcar-vin/rcar-vin.h
parent23fd542e6305f9f3d9b651a46a07c1d3b4c8871a (diff)
media: rcar-vin: parse Gen3 OF and setup media graph
The parsing and registering CSI-2 subdevices with the v4l2 async framework is a collaborative effort shared between the VIN instances which are part of the group. When the last VIN in the group is probed it asks all other VINs to parse its share of OF and record the async subdevices it finds in the notifier belonging to the last probed VIN. Once all CSI-2 subdevices in this notifier are bound proceed to register all VIN video devices of the group and crate media device links between all CSI-2 and VIN entities according to the SoC specific routing configuration. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/rcar-vin/rcar-vin.h')
-rw-r--r--drivers/media/platform/rcar-vin/rcar-vin.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h
index 93eb40856b86..c2aef789b491 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -223,9 +223,13 @@ struct rvin_dev {
*
* @mdev: media device which represents the group
*
- * @lock: protects the count and vin members
+ * @lock: protects the count, notifier, vin and csi members
* @count: number of enabled VIN instances found in DT
+ * @notifier: pointer to the notifier of a VIN which handles the
+ * groups async sub-devices.
* @vin: VIN instances which are part of the group
+ * @csi: array of pairs of fwnode and subdev pointers
+ * to all CSI-2 subdevices.
*/
struct rvin_group {
struct kref refcount;
@@ -234,7 +238,13 @@ struct rvin_group {
struct mutex lock;
unsigned int count;
+ struct v4l2_async_notifier *notifier;
struct rvin_dev *vin[RCAR_VIN_NUM];
+
+ struct {
+ struct fwnode_handle *fwnode;
+ struct v4l2_subdev *subdev;
+ } csi[RVIN_CSI_MAX];
};
int rvin_dma_register(struct rvin_dev *vin, int irq);