Re: [PATCH v2 07/55] media: rkisp1: Read the ID register at probe time instead of streamon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

On Fri, Jul 01, 2022 at 02:06:25AM +0300, Laurent Pinchart wrote:
> 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@xxxxxxxxxxxxxxxx>
> Reviewed-by: Dafna Hirschfeld <dafna@xxxxxxxxxxxx>

Reviewed-by: Paul Elder <paul.elder@xxxxxxxxxxxxxxxx>

> ---
>  drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 10 ++++++++++
>  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;



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux