mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
input: touchscreen: gt1x: Change msleep to usleep_range for small msecs
The msleep < 20ms can sleep for up to 20ms, see: Documentation/timers/timers-howto.txt. Change msleep to usleep_range for this case. Change-Id: Ibb680b766b6c7317fc1f13dfda7457ef771b4272 Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
parent
917c728cb2
commit
dde2185b03
|
|
@ -145,7 +145,7 @@ int gesture_enter_doze(void)
|
|||
GTP_DEBUG("Working in doze mode!");
|
||||
return 0;
|
||||
}
|
||||
msleep(10);
|
||||
usleep_range(10000, 11000);
|
||||
}
|
||||
GTP_ERROR("Send doze cmd failed.");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ static s32 gt1x_i2c_test(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
msleep(10);
|
||||
usleep_range(10000, 11000);
|
||||
GTP_ERROR("Hardware Info:%08X", hw_info);
|
||||
GTP_ERROR("I2c failed%d.", retry);
|
||||
}
|
||||
|
|
@ -489,7 +489,7 @@ s32 gt1x_i2c_read_dbl_check(u16 addr, u8 *buffer, s32 len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
memset(confirm_buf, 0, sizeof(confirm_buf));
|
||||
ret = gt1x_i2c_read(addr, confirm_buf, len);
|
||||
if (ret < 0) {
|
||||
|
|
@ -660,9 +660,9 @@ void gt1x_select_addr(void)
|
|||
{
|
||||
GTP_GPIO_OUTPUT(GTP_RST_PORT, 0);
|
||||
GTP_GPIO_OUTPUT(GTP_INT_PORT, gt1x_i2c_client->addr == 0x14);
|
||||
msleep(2);
|
||||
usleep_range(2000, 3000);
|
||||
GTP_GPIO_OUTPUT(GTP_RST_PORT, 1);
|
||||
msleep(2);
|
||||
usleep_range(2000, 3000);
|
||||
}
|
||||
|
||||
static s32 gt1x_set_reset_status(void)
|
||||
|
|
@ -786,7 +786,7 @@ s32 gt1x_reset_guitar(void)
|
|||
return ret;
|
||||
#else
|
||||
gt1x_select_addr();
|
||||
msleep(8); /* must >= 6ms */
|
||||
usleep_range(8000, 9000); /* must >= 6ms */
|
||||
#endif
|
||||
|
||||
/* int synchronization */
|
||||
|
|
@ -920,14 +920,14 @@ static s32 gt1x_enter_sleep(void)
|
|||
if (gt1x_wakeup_level == 1) { /* high level wakeup */
|
||||
GTP_GPIO_OUTPUT(GTP_INT_PORT, 0);
|
||||
}
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
|
||||
while (retry++ < 3) {
|
||||
if (!gt1x_send_cmd(GTP_CMD_SLEEP, 0)) {
|
||||
GTP_INFO("Enter sleep mode!");
|
||||
return 0;
|
||||
}
|
||||
msleep(10);
|
||||
usleep_range(10000, 11000);
|
||||
}
|
||||
|
||||
GTP_ERROR("Enter sleep mode failed.");
|
||||
|
|
@ -970,7 +970,7 @@ static s32 gt1x_wakeup_sleep(void)
|
|||
{
|
||||
/* wake up through int port */
|
||||
GTP_GPIO_OUTPUT(GTP_INT_PORT, gt1x_wakeup_level);
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
|
||||
/* Synchronize int IO */
|
||||
GTP_GPIO_OUTPUT(GTP_INT_PORT, 0);
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ int gt1x_burn_subsystem(struct fw_subsystem_info *subsystem)
|
|||
}
|
||||
burn_state = ERROR;
|
||||
wait_time = 200;
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
|
||||
while (wait_time-- > 0) {
|
||||
u8 confirm = 0x55;
|
||||
|
|
@ -1035,7 +1035,7 @@ int gt1x_burn_subsystem(struct fw_subsystem_info *subsystem)
|
|||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
ret = gt1x_i2c_read(0x8022, &confirm, 1);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
|
|
@ -1148,7 +1148,7 @@ int gt1x_read_flash(u32 addr, int length)
|
|||
wait_time = 200;
|
||||
while (wait_time > 0) {
|
||||
wait_time--;
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
ret = gt1x_i2c_read_dbl_check(0x8022, buffer, 1);
|
||||
if (ret) {
|
||||
continue;
|
||||
|
|
@ -1257,7 +1257,7 @@ int gt1x_error_erase(void)
|
|||
wait_time = 200;
|
||||
while (wait_time > 0) {
|
||||
wait_time--;
|
||||
msleep(5);
|
||||
usleep_range(5000, 6000);
|
||||
ret = gt1x_i2c_read_dbl_check(0x8022, buffer, 1);
|
||||
if (ret)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user