aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/cyapa.c
diff options
context:
space:
mode:
authorDudley Du <dudl@cypress.com>2015-07-20 16:57:53 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-23 17:34:05 -0700
commit945525ee607471630d07c309e036ae4a53abe37f (patch)
tree94d975a13c53bd6173d0f5dfdf4f5b555a9216df /drivers/input/mouse/cyapa.c
parentInput: cyapa - add gen6 device module support (diff)
downloadlinux-dev-945525ee607471630d07c309e036ae4a53abe37f.tar.xz
linux-dev-945525ee607471630d07c309e036ae4a53abe37f.zip
Input: cyapa - add proximity support for gen5 and gen6 modules
Gen5 and Gen6 trackpad devices are able to detect and report object proximity data/events, add this function support in the cyapa driver through the ABS_DISTANCE event. Signed-off-by: Dudley Du <dudl@cypress.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/cyapa.c')
-rw-r--r--drivers/input/mouse/cyapa.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index 6952ed1c92c7..2541fbb43533 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -477,6 +477,7 @@ static int cyapa_create_input_dev(struct cyapa *cyapa)
if (cyapa->gen >= CYAPA_GEN5) {
input_set_abs_params(input, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(input, ABS_MT_WIDTH_MINOR, 0, 255, 0, 0);
+ input_set_abs_params(input, ABS_DISTANCE, 0, 1, 0, 0);
}
input_abs_set_res(input, ABS_MT_POSITION_X,
@@ -1340,6 +1341,13 @@ static int __maybe_unused cyapa_suspend(struct device *dev)
error);
}
+ /*
+ * Disable proximity interrupt when system idle, want true touch to
+ * wake the system.
+ */
+ if (cyapa->dev_pwr_mode != PWR_MODE_OFF)
+ cyapa->ops->set_proximity(cyapa, false);
+
if (device_may_wakeup(dev))
cyapa->irq_wake = (enable_irq_wake(client->irq) == 0);
@@ -1360,7 +1368,10 @@ static int __maybe_unused cyapa_resume(struct device *dev)
cyapa->irq_wake = false;
}
- /* Update device states and runtime PM states. */
+ /*
+ * Update device states and runtime PM states.
+ * Re-Enable proximity interrupt after enter operational mode.
+ */
error = cyapa_reinitialize(cyapa);
if (error)
dev_warn(dev, "failed to reinitialize TP device: %d\n", error);