Commit 6972a859 authored by Dudley Du's avatar Dudley Du Committed by Dmitry Torokhov

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: default avatarDudley Du <dudl@cypress.com>
Tested-by: default avatarJeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9f1cd857
......@@ -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
......
......@@ -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;
......
......@@ -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
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment