summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/cyapa.c
diff options
context:
space:
mode:
authorDudley Du <dudl@cypress.com>2015-01-18 03:49:37 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-01-18 09:10:28 +0100
commit6972a859601ab295f0873762d333ee1449152245 (patch)
treee93975e5f1abcafaef9da0a0c157b89e4acf7e72 /drivers/input/mouse/cyapa.c
parentInput: cyapa - re-design driver to support multi-trackpad in one driver (diff)
downloadlinux-6972a859601ab295f0873762d333ee1449152245.tar.xz
linux-6972a859601ab295f0873762d333ee1449152245.zip
Input: cyapa - add gen5 trackpad device basic functions support
This change adds support for Gen5 Cypress trackpads. The driver detects generation of the device at probe time and automatically selects appropriate protocol. Signed-off-by: Dudley Du <dudl@cypress.com> Tested-by: Jeremiah Mahler <jmmahler@gmail.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, 13 insertions, 0 deletions
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index 36c64335662c..fa4d5010534d 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -184,6 +184,14 @@ static int cyapa_get_state(struct cyapa *cyapa)
if (!error)
goto out_detected;
}
+ if ((cyapa->gen == CYAPA_GEN_UNKNOWN ||
+ cyapa->gen == CYAPA_GEN5) &&
+ !smbus && even_addr) {
+ error = cyapa_gen5_ops.state_parse(cyapa,
+ status, BL_STATUS_SIZE);
+ if (!error)
+ goto out_detected;
+ }
/*
* Write 0x00 0x00 to trackpad device to force update its
@@ -272,6 +280,9 @@ static int cyapa_check_is_operational(struct cyapa *cyapa)
return error;
switch (cyapa->gen) {
+ case CYAPA_GEN5:
+ cyapa->ops = &cyapa_gen5_ops;
+ break;
case CYAPA_GEN3:
cyapa->ops = &cyapa_gen3_ops;
break;
@@ -506,6 +517,8 @@ static int cyapa_initialize(struct cyapa *cyapa)
/* ops.initialize() is aimed to prepare for module communications. */
error = cyapa_gen3_ops.initialize(cyapa);
+ if (!error)
+ error = cyapa_gen5_ops.initialize(cyapa);
if (error)
return error;