Skip to content

Commit

Permalink
media: i2c: imx290: replace msleep(10) with usleep_range(10000, 11000)
Browse files Browse the repository at this point in the history
This fixes checkpatch warnings of "msleep < 20ms can sleep for up to 20ms".

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>
  • Loading branch information
Andrey Konovalov authored and Mauro Carvalho Chehab committed Jul 19, 2020
1 parent 8d4a696 commit 8e5652a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/i2c/imx290.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static int imx290_set_register_array(struct imx290 *imx290,
}

/* Provide 10ms settle time */
msleep(10);
usleep_range(10000, 11000);

return 0;
}
Expand Down Expand Up @@ -484,14 +484,14 @@ static int imx290_set_ctrl(struct v4l2_ctrl *ctrl)
if (ctrl->val) {
imx290_write_reg(imx290, IMX290_BLKLEVEL_LOW, 0x00);
imx290_write_reg(imx290, IMX290_BLKLEVEL_HIGH, 0x00);
msleep(10);
usleep_range(10000, 11000);
imx290_write_reg(imx290, IMX290_PGCTRL,
(u8)(IMX290_PGCTRL_REGEN |
IMX290_PGCTRL_THRU |
IMX290_PGCTRL_MODE(ctrl->val)));
} else {
imx290_write_reg(imx290, IMX290_PGCTRL, 0x00);
msleep(10);
usleep_range(10000, 11000);
if (imx290->bpp == 10)
imx290_write_reg(imx290, IMX290_BLKLEVEL_LOW,
0x3c);
Expand Down

0 comments on commit 8e5652a

Please sign in to comment.