Thread (5 messages) flat view 5 messages, 3 authors, 2018-08-24

Re: [PATCH] Input: elants_i2c - Fix sw reset delays

From: Andi Shyti <hidden>
Date: 2018-08-24 10:07:18
Also in: lkml

Hi Derek,
quoted
quoted
On Thu, Aug 23, 2018 at 04:10:13PM -0700, Derek Basehore wrote:
quoted
We only need to wait 10ms instead of 30ms before starting fastboot or
sending IAP on the touchscreen. Also, instead of delaying everytime
sw_reset is called, this delays 10ms in the function that starts
fastboot. There's also an explicit 20ms delay before sending IAP when
updating the firmware, so no additional delay is needed there. This
change also has the benefit of not delaying when wakeup is enabled
during suspend. This is because sw_reset is called, yet fastboot
isn't.
...
quoted
quoted
quoted
-	/*
-	 * We should wait at least 10 msec (but no more than 40) before
-	 * sending fastboot or IAP command to the device.
-	 */
-	msleep(30);
-
moving from 30 to 0 is a bit alarming... what does the datasheet
say?

Sometimes delays are implicit in the system where you are testing
the driver, so that without any msleep it might work in your
system but it might not on others.
+             /*
+              * We should wait at least 10 msec (but no more than 40) before
+              * sending IAP command to the device.
+              */
              msleep(20);
I agree though that it's not nice to wait twice here (even though
as Dmitry says it doesn't hurt so much). Wouldn't it make more
sense to remove this msleep instead?
This way...
+     /*
+      * We should wait at least 10 msec (but no more than 40) before sending
+      * fastboot command to the device.
+      */
+     usleep_range(10 * 1000, 11 * 1000);
+
      error = elants_i2c_send(client, boot_cmd, sizeof(boot_cmd));
... you do not need to add an extra sleep here.

Andi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help