OSDN Git Service

media: i2c: imx290: Move the settle time delay out of loop
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 12 Jun 2020 13:53:54 +0000 (15:53 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 23 Jun 2020 13:18:33 +0000 (15:18 +0200)
The 10ms settle time is needed only at the end of all consecutive
register writes. So move the delay to outside of the for loop of
imx290_set_register_array().

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/imx290.c

index fd147fa..02001c1 100644 (file)
@@ -404,11 +404,11 @@ static int imx290_set_register_array(struct imx290 *imx290,
                ret = imx290_write_reg(imx290, settings->reg, settings->val);
                if (ret < 0)
                        return ret;
-
-               /* Settle time is 10ms for all registers */
-               msleep(10);
        }
 
+       /* Provide 10ms settle time */
+       msleep(10);
+
        return 0;
 }