CHROMIUM: input: cyapa - fix power mode switch problems
authorTai-Hsu Lin <sheckylin@chromium.org>
Thu, 21 Mar 2013 07:54:02 +0000 (15:54 +0800)
committerChromeBot <chrome-bot@google.com>
Thu, 28 Mar 2013 05:20:13 +0000 (22:20 -0700)
commit23670c3ac1078f102ebcc0ec44e4038907e87d96
tree7b846c7c45e47f78b6f01b771ade9ccba2569f2c
parenta3242794d36925527aa7fe96450103b2c0405ddf
CHROMIUM: input: cyapa - fix power mode switch problems

We have found that some commands may fail if the touchpad is
not running at the full mode. Moreover, setting new power modes
would take the amount of time roughly equal to the old scanrate
to complete. The patch fixes several places where the unsafe
commands might be run before completely returning to the full
mode. Meanwhile, the cyapa_set_power_mode function now returns
early if the mode to set is the same as the current one.

Signed-off-by: Tai-Hsu Lin <sheckylin@chromium.org>
BUG=chromium:196520
TEST=Repeatedly suspend/resume the device with Cypress touchpad for
a few hundred times. One should see errors about reading query data
in the /var/log/messages.

With the fix, one shouldn't see the error.

Change-Id: I95a843a077d5840c57cc24daf85b6549550fa73d
Reviewed-on: https://gerrit.chromium.org/gerrit/46115
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
drivers/input/mouse/cyapa.c