OSDN Git Service

iio: bmi160: Fix time needed to sleep after command execution
authorMarcin Niestroj <m.niestroj@grinn-global.com>
Thu, 8 Dec 2016 14:22:58 +0000 (15:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:05 +0000 (11:39 +0100)
commitea991c8354c3dab7f7fe6c3a747bc473b9c935e2
tree720889950d7abd71590453f2898b71073f28e399
parent7090b8da3836ea69c79da8d71141a318269c26a8
iio: bmi160: Fix time needed to sleep after command execution

commit 01d1f7a99e457952aa51849ed7c1cc4ced7bca4b upstream.

Datasheet specifies typical and maximum execution times for which CMD
register is occupied after previous command execution. We took these
values as minimum and maximum time for usleep_range() call before making
a new command execution.

To be sure, that the CMD register is no longer occupied we need to wait
*at least* the maximum time specified by datasheet.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/bmi160/bmi160_core.c