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>
This commit is contained in:
Dudley Du 2015-01-17 18:49:37 -08:00 committed by Dmitry Torokhov
parent 9f1cd85751
commit 6972a85960
4 changed files with 1693 additions and 1 deletions

View File

@ -24,7 +24,7 @@ obj-$(CONFIG_MOUSE_SYNAPTICS_I2C) += synaptics_i2c.o
obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o
obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
cyapatp-objs := cyapa.o cyapa_gen3.o
cyapatp-objs := cyapa.o cyapa_gen3.o cyapa_gen5.o
psmouse-objs := psmouse-base.o synaptics.o focaltech.o
psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o

View File

@ -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;

View File

@ -292,5 +292,6 @@ u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode);
extern const char product_id[];
extern const struct cyapa_dev_ops cyapa_gen3_ops;
extern const struct cyapa_dev_ops cyapa_gen5_ops;
#endif

File diff suppressed because it is too large Load Diff