media: rkisp1: csi: Move start delay to rkisp1_csi_start()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 14 Jun 2022 19:10:54 +0000 (20:10 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 17 Jul 2022 11:10:44 +0000 (12:10 +0100)
The delay in rkisp1_isp_start() is related to the CSI-2 receiver and
the camera sensor. Move it where it belongs, to rkisp1_csi_start().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c

index 102deb877aa4d5d20206860b68b04d8807509fb7..749ad473b877bb52703f6c4b4292a2f1b91bc871 100644 (file)
@@ -9,6 +9,7 @@
  * Copyright (C) 2017 Rockchip Electronics Co., Ltd.
  */
 
+#include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-mipi-dphy.h>
@@ -121,6 +122,12 @@ int rkisp1_csi_start(struct rkisp1_csi *csi,
 
        rkisp1_csi_enable(csi);
 
+       /*
+        * CIF spec says to wait for sufficient time after enabling
+        * the MIPI interface and before starting the sensor output.
+        */
+       usleep_range(1000, 1200);
+
        return 0;
 }
 
index d2343f166f42a0e2a04bfb82e119c74404d38936..da895f6aa3fa88a47fa6230d085f2e5efa9f9298 100644 (file)
@@ -365,12 +365,6 @@ static void rkisp1_isp_start(struct rkisp1_device *rkisp1)
               RKISP1_CIF_ISP_CTRL_ISP_ENABLE |
               RKISP1_CIF_ISP_CTRL_ISP_INFORM_ENABLE;
        rkisp1_write(rkisp1, RKISP1_CIF_ISP_CTRL, val);
-
-       /*
-        * CIF spec says to wait for sufficient time after enabling
-        * the MIPI interface and before starting the sensor output.
-        */
-       usleep_range(1000, 1200);
 }
 
 /* ----------------------------------------------------------------------------