]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
media: tc358840: use usleep_range()
authorAhung Cheng <ahcheng@nvidia.com>
Wed, 11 May 2016 05:31:45 +0000 (13:31 +0800)
committerWenjia Zhou <wenjiaz@nvidia.com>
Wed, 27 Jul 2016 22:25:12 +0000 (15:25 -0700)
Instead of using msleep(), use sleep_range(), as it provides
a closer sleep time.

Bug 200092604
Bug 173647

Change-Id: I159b83570ce712dc83e131fce83e68af4a6a0086
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1153957
(cherry picked from commit efbc8d6caa76bcc94c740e241b8980560e55ce81)
Reviewed-on: http://git-master/r/1161374
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
drivers/media/i2c/tc358840.c

index 8dabf6f01a91f31180d095608e375cbb7b3a1f19..6e7e3ea4b559fb4d3baf9034d15da832688cbfed 100644 (file)
@@ -876,7 +876,7 @@ static void tc358840_set_csi(struct v4l2_subdev *sd)
                /* (0x02A0) */
                i2c_wr32_and_or(sd, base_addr+MIPICLKEN,
                        ~(MASK_MP_CKEN), MASK_MP_ENABLE);
-               msleep(10);
+               usleep_range(10000, 11000);
                /* (0x02A0) */
                i2c_wr32(sd, base_addr+MIPICLKEN,
                        MASK_MP_CKEN | MASK_MP_ENABLE);
@@ -1310,7 +1310,7 @@ static int tc358840_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
         * Need to figure out why these msleeps are needed, and which of these
         * are needed. Without msleeps the interrupts just stop.
         */
-       msleep(1);
+       usleep_range(500, 1000);
        state->format_changed = false;
        if (intstatus & MASK_HDMI_INT) {
                u8 hdmi_int0;
@@ -1318,9 +1318,9 @@ static int tc358840_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
 retry:
                retry--;
                hdmi_int0 = i2c_rd8(sd, HDMI_INT0);
-               msleep(1);
+               usleep_range(500, 1000);
                hdmi_int1 = i2c_rd8(sd, HDMI_INT1);
-               msleep(1);
+               usleep_range(500, 1000);
 
                if (hdmi_int0 & MASK_MISC)
                        tc358840_hdmi_misc_int_handler(sd, handled);
@@ -1333,10 +1333,10 @@ retry:
                if (hdmi_int1 & MASK_AUD)
                        tc358840_hdmi_audio_int_handler(sd, handled);
 
-               msleep(1);
+               usleep_range(500, 1000);
                i2c_wr16(sd, INTSTATUS, MASK_HDMI_INT);
                intstatus &= ~MASK_HDMI_INT;
-               msleep(1);
+               usleep_range(500, 1000);
 
                /* Display unhandled HDMI interrupts */
                hdmi_int0 = i2c_rd8(sd, HDMI_INT0);
@@ -1347,7 +1347,7 @@ retry:
                        if (retry)
                                goto retry;
                }
-               msleep(1);
+               usleep_range(500, 1000);
                hdmi_int1 = i2c_rd8(sd, HDMI_INT1);
                if (hdmi_int1) {
                        v4l2_dbg(1, debug, sd,