diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-06-14 20:10:37 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-17 11:25:45 +0100 |
commit | 196179c545725ba7ce399dc7cdd4a5a25ef6a616 (patch) | |
tree | 9a8dc2db2b84d423460c93bd12ed861428b5d00e | |
parent | 13c9810281f8b24af9b7712cd84a1fce61843e93 (diff) | |
download | linux-stable-196179c545725ba7ce399dc7cdd4a5a25ef6a616.tar.gz linux-stable-196179c545725ba7ce399dc7cdd4a5a25ef6a616.tar.bz2 linux-stable-196179c545725ba7ce399dc7cdd4a5a25ef6a616.zip |
media: rkisp1: Read the ID register at probe time instead of streamon
There's no need to read the ID register every time streaming is started.
Do it once, at probe time.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r-- | drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 10 | ||||
-rw-r--r-- | drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c index 248f0172ca62..ba773c0784fb 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c @@ -467,6 +467,7 @@ static int rkisp1_probe(struct platform_device *pdev) struct v4l2_device *v4l2_dev; unsigned int i; int ret, irq; + u32 cif_id; match_data = of_device_get_match_data(&pdev->dev); if (!match_data) @@ -509,6 +510,15 @@ static int rkisp1_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + goto err_pm_runtime_disable; + + cif_id = rkisp1_read(rkisp1, RKISP1_CIF_VI_ID); + dev_dbg(rkisp1->dev, "CIF_ID 0x%08x\n", cif_id); + + pm_runtime_put(&pdev->dev); + rkisp1->media_dev.hw_revision = match_data->isp_ver; strscpy(rkisp1->media_dev.model, RKISP1_DRIVER_NAME, sizeof(rkisp1->media_dev.model)); diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c index a97c145bad98..bc94a51124b0 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c @@ -473,12 +473,8 @@ static int rkisp1_config_path(struct rkisp1_device *rkisp1) /* Hardware configure Entry */ static int rkisp1_config_cif(struct rkisp1_device *rkisp1) { - u32 cif_id; int ret; - cif_id = rkisp1_read(rkisp1, RKISP1_CIF_VI_ID); - dev_dbg(rkisp1->dev, "CIF_ID 0x%08x\n", cif_id); - ret = rkisp1_config_isp(rkisp1); if (ret) return ret; |