From: Mauro Carvalho Chehab Date: Tue, 24 Jun 2014 21:42:59 +0000 (-0300) Subject: parse_dib0700.pl: Make the delays multiple of 10ms X-Git-Tag: v4l-utils-1.2.0~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9b3e670a100ffb7d0218e6cc961c85a23a3e52e;p=platform%2Fupstream%2Fv4l-utils.git parse_dib0700.pl: Make the delays multiple of 10ms That makes it more real to what the Kernel would provide. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/contrib/dib0700/parse_dib0700.pl b/contrib/dib0700/parse_dib0700.pl index 15acd31..590cdd0 100755 --- a/contrib/dib0700/parse_dib0700.pl +++ b/contrib/dib0700/parse_dib0700.pl @@ -14,6 +14,8 @@ use strict; +my $min_delay = 10; + my %req_map = ( 0x0 => "REQUEST_SET_USB_XFER_LEN", 0x2 => "REQUEST_I2C_READ", @@ -110,7 +112,7 @@ while (<>) { $delay = 0; if (m/(IN|OUT): (\d+) ms \d+ ms/) { - $delay = $2 if ($2 > 1); + $delay = $min_delay * int(($2 + $min_delay / 2) / $min_delay); } if ($req eq "REQUEST_I2C_READ") {