summaryrefslogtreecommitdiff
path: root/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2022-06-14 22:11:12 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-17 14:31:13 +0300
commitb298f059b92cfcc46f559471f8de691ef723ee4f (patch)
tree8af285aaf0317fa6fde36e183c6597238c768102 /drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
parent8b52ec2d1896223d620c27688024168194d7482b (diff)
downloadlinux-b298f059b92cfcc46f559471f8de691ef723ee4f.tar.xz
media: rkisp1: csi: Implement a V4L2 subdev for the CSI receiver
The CSI receiver is a component separate from the ISP or the resizers. It is actually optional, not all device model include a CSI receiver. On some SoCs CSI-2 support can be provided through an external CSI-2 receiver, connected to the ISP's parallel input. To support those use cases, create a V4L2 subdev to model the CSI receiver. It will allow the driver to handle both internal and external CSI receivers the same way. The next commit will plumb the CSI subdev to the rest of the driver, replacing direct function calls. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/rockchip/rkisp1/rkisp1-common.h')
-rw-r--r--drivers/media/platform/rockchip/rkisp1/rkisp1-common.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
index 5301461d3ea3..3465d35cf102 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
@@ -68,6 +68,13 @@ enum rkisp1_rsz_pad {
RKISP1_RSZ_PAD_MAX
};
+/* enum for the csi receiver pads */
+enum rkisp1_csi_pad {
+ RKISP1_CSI_PAD_SINK,
+ RKISP1_CSI_PAD_SRC,
+ RKISP1_CSI_PAD_NUM
+};
+
/* enum for the capture id */
enum rkisp1_stream_id {
RKISP1_MAINPATH,
@@ -141,11 +148,23 @@ struct rkisp1_sensor_async {
* @rkisp1: pointer to the rkisp1 device
* @dphy: a pointer to the phy
* @is_dphy_errctrl_disabled: if dphy errctrl is disabled (avoid endless interrupt)
+ * @sd: v4l2_subdev variable
+ * @pads: media pads
+ * @pad_cfg: configurations for the pads
+ * @sink_fmt: input format
+ * @lock: protects pad_cfg and sink_fmt
+ * @source: source in-use, set when starting streaming
*/
struct rkisp1_csi {
struct rkisp1_device *rkisp1;
struct phy *dphy;
bool is_dphy_errctrl_disabled;
+ struct v4l2_subdev sd;
+ struct media_pad pads[RKISP1_CSI_PAD_NUM];
+ struct v4l2_subdev_pad_config pad_cfg[RKISP1_CSI_PAD_NUM];
+ const struct rkisp1_mbus_info *sink_fmt;
+ struct mutex lock;
+ struct v4l2_subdev *source;
};
/*