summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/rkisp1/rkisp1-dev.c
diff options
context:
space:
mode:
authorJacob Chen <jacob2.chen@rock-chips.com>2020-01-08 19:44:48 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-01-09 16:41:02 +0100
commit9a28dbd65a8882462079d66daf9282234d3fa1a0 (patch)
tree0d7038ceb3341651faddbadadfa1e3575be86869 /drivers/staging/media/rkisp1/rkisp1-dev.c
parent8e2be317dcf5ce42c33d4e04ed7734c155487f31 (diff)
downloadlinux-9a28dbd65a8882462079d66daf9282234d3fa1a0.tar.bz2
media: staging: rkisp1: add capture device for statistics
Add the capture video driver for rockchip isp1 statistics block. Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com> Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com> Signed-off-by: Yichong Zhong <zyc@rock-chips.com> Signed-off-by: Jacob Chen <cc@rock-chips.com> Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Allon Huang <allon.huang@rock-chips.com> Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/rkisp1/rkisp1-dev.c')
-rw-r--r--drivers/staging/media/rkisp1/rkisp1-dev.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
index 3d0a0f65eb19..261ca6051cc9 100644
--- a/drivers/staging/media/rkisp1/rkisp1-dev.c
+++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
@@ -57,6 +57,14 @@
* | DMA |------------------------------------+ Self Picture Path
* +--------+
*
+ * rkisp1-stats.c
+ * |===============|
+ * +---------------+
+ * | |
+ * | ISP |
+ * | |
+ * +---------------+
+ *
*
* Media Topology
* --------------
@@ -74,14 +82,14 @@
* +----------+ |------+------|
* | ISP |
* |------+------|
- * +-------------| 2 | 3 |
- * | +------+------+
- * | |
- * v v
- * +- ---------+ +-----------+
- * | 0 | | 0 |
- * ------------- -------------
- * | Resizer | | Resizer |
+ * +-------------| 2 | 3 |----------+
+ * | +------+------+ |
+ * | | |
+ * v v v
+ * +- ---------+ +-----------+ +-----------+
+ * | 0 | | 0 | | stats |
+ * ------------- ------------- | (capture) |
+ * | Resizer | | Resizer | +-----------+
* ------------| ------------|
* | 1 | | 1 |
* +-----------+ +-----------+
@@ -156,7 +164,11 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1)
return ret;
}
- return 0;
+ /* 3A stats links */
+ source = &rkisp1->isp.sd.entity;
+ sink = &rkisp1->stats.vnode.vdev.entity;
+ return media_create_pad_link(source, RKISP1_ISP_PAD_SOURCE_STATS,
+ sink, 0, flags);
}
static int rkisp1_subdev_notifier_bound(struct v4l2_async_notifier *notifier,
@@ -336,14 +348,20 @@ static int rkisp1_entities_register(struct rkisp1_device *rkisp1)
if (ret)
goto err_unreg_resizer_devs;
+ ret = rkisp1_stats_register(&rkisp1->stats, &rkisp1->v4l2_dev, rkisp1);
+ if (ret)
+ goto err_unreg_capture_devs;
+
ret = rkisp1_subdev_notifier(rkisp1);
if (ret) {
dev_err(rkisp1->dev,
"Failed to register subdev notifier(%d)\n", ret);
- goto err_unreg_capture_devs;
+ goto err_unreg_stats;
}
return 0;
+err_unreg_stats:
+ rkisp1_stats_unregister(&rkisp1->stats);
err_unreg_capture_devs:
rkisp1_capture_devs_unregister(rkisp1);
err_unreg_resizer_devs:
@@ -408,6 +426,8 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
&debug->pic_size_error);
debugfs_create_ulong("mipi_error", 0444, debug->debugfs_dir,
&debug->mipi_error);
+ debugfs_create_ulong("stats_error", 0444, debug->debugfs_dir,
+ &debug->stats_error);
debugfs_create_ulong("mp_stop_timeout", 0444, debug->debugfs_dir,
&debug->stop_timeout[RKISP1_MAINPATH]);
debugfs_create_ulong("sp_stop_timeout", 0444, debug->debugfs_dir,
@@ -509,6 +529,7 @@ static int rkisp1_remove(struct platform_device *pdev)
v4l2_async_notifier_unregister(&rkisp1->notifier);
v4l2_async_notifier_cleanup(&rkisp1->notifier);
+ rkisp1_stats_unregister(&rkisp1->stats);
rkisp1_capture_devs_unregister(rkisp1);
rkisp1_resizer_devs_unregister(rkisp1);
rkisp1_isp_unregister(rkisp1);