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>
This commit is contained in:
Laurent Pinchart 2022-06-14 20:10:37 +01:00 committed by Mauro Carvalho Chehab
parent 13c9810281
commit 196179c545
2 changed files with 10 additions and 4 deletions

View File

@ -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));

View File

@ -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;