From 6972a859601ab295f0873762d333ee1449152245 Mon Sep 17 00:00:00 2001 From: Dudley Du Date: Sat, 17 Jan 2015 18:49:37 -0800 Subject: 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 Tested-by: Jeremiah Mahler Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/cyapa.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/input/mouse/cyapa.c') 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; -- cgit v1.2.3