If the driver is unloaded, set the trackpad to the lowest
power state.
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Set CONFIG_MOUSE_CYAPA=m in the chromeos config.
Builds clean.
Load the driver on a test system with the trackpad INT line scoped.
Check that the touchpad is functional.
rmmod cyapa to unload the cyapa module.
Click on the trackpad.
Check that the INT line does not assert on the scope, indicating
that the trackpad is indeed in OFF power state.
Change-Id: I11528776c82468a2d35a21fe22f5a6c7781d7ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/42281
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
if (cyapa->input)
input_unregister_device(cyapa->input);
+ cyapa_set_power_mode(cyapa, PWR_MODE_OFF);
kfree(cyapa->read_fw_image);
kfree(cyapa);