@@ -373,6 +373,11 @@ static int rvin_group_vin_to_csi(struct rvin_dev *vin)
return csi;
}
+bool vin_have_bridge(struct rvin_dev *vin)
+{
+ return vin->digital.subdev == NULL;
+}
+
struct rvin_graph_entity *vin_to_entity(struct rvin_dev *vin)
{
int csi;
@@ -403,6 +408,20 @@ struct v4l2_subdev *vin_to_source(struct rvin_dev *vin)
return vin->group->source[csi].subdev;
}
+struct v4l2_subdev *vin_to_bridge(struct rvin_dev *vin)
+{
+ int csi;
+
+ if (vin->digital.subdev)
+ return NULL;
+
+ csi = rvin_group_vin_to_csi(vin);
+ if (csi < 0)
+ return NULL;
+
+ return vin->group->bridge[csi].subdev;
+}
+
/* -----------------------------------------------------------------------------
* Async notifier helpers
*/
@@ -206,8 +206,10 @@ struct rvin_dev {
struct v4l2_rect compose;
};
+bool vin_have_bridge(struct rvin_dev *vin);
struct rvin_graph_entity *vin_to_entity(struct rvin_dev *vin);
struct v4l2_subdev *vin_to_source(struct rvin_dev *vin);
+struct v4l2_subdev *vin_to_bridge(struct rvin_dev *vin);
/* Debug */
#define vin_dbg(d, fmt, arg...) dev_dbg(d->dev, fmt, ##arg)
On Gen3 there might be a CSI2 bridge between the video source and the VIN. Add helpers to check for this and to fetch the bridge subdevice. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> --- drivers/media/platform/rcar-vin/rcar-core.c | 19 +++++++++++++++++++ drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 21 insertions(+)