media: rockchip: isp1: add pipeline power management

Change-Id: Iefc3224102d3b6f5b7a8f414a51072a8d30b916b
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
This commit is contained in:
Hu Kejun
2019-06-14 12:35:17 +08:00
committed by Tao Huang
parent 97896c849a
commit 52776875ff
3 changed files with 10 additions and 0 deletions

View File

@@ -1711,6 +1711,9 @@ int rkisp1_fh_open(struct file *filp)
ret = v4l2_fh_open(filp);
if (!ret) {
atomic_inc(&dev->open_cnt);
ret = v4l2_pipeline_pm_use(&stream->vnode.vdev.entity, 1);
if (ret < 0)
vb2_fop_release(filp);
}
return ret;
@@ -1722,6 +1725,7 @@ int rkisp1_fop_release(struct file *file)
struct rkisp1_device *dev = stream->ispdev;
int ret;
ret = v4l2_pipeline_pm_use(&stream->vnode.vdev.entity, 0);
ret = vb2_fop_release(file);
atomic_dec(&dev->open_cnt);

View File

@@ -42,6 +42,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/videobuf2-v4l2.h>
#include <media/v4l2-mc.h>
#define RKISP1_DEFAULT_WIDTH 800
#define RKISP1_DEFAULT_HEIGHT 600

View File

@@ -957,6 +957,10 @@ static int rkisp1_vs_irq_parse(struct platform_device *pdev)
return 0;
}
static const struct media_device_ops rkisp1_media_ops = {
.link_notify = v4l2_pipeline_link_notify,
};
static int rkisp1_plat_probe(struct platform_device *pdev)
{
const struct of_device_id *match;
@@ -1064,6 +1068,7 @@ static int rkisp1_plat_probe(struct platform_device *pdev)
strlcpy(isp_dev->media_dev.model, "rkisp1",
sizeof(isp_dev->media_dev.model));
isp_dev->media_dev.dev = &pdev->dev;
isp_dev->media_dev.ops = &rkisp1_media_ops;
v4l2_dev = &isp_dev->v4l2_dev;
v4l2_dev->mdev = &isp_dev->media_dev;
strlcpy(v4l2_dev->name, "rkisp1", sizeof(v4l2_dev->name));