diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-02-01 03:37:30 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-02-01 03:37:30 -0500 |
commit | d67ad78e09cbb9935c74a40b85c5abe5b9cd48f8 (patch) | |
tree | 56e92b487de80090a998ff3c0469375982156802 /drivers/input/mouse | |
parent | 060403f34008af90e310d7e0e7531ebb3acf9557 (diff) | |
parent | fafef982c7353e8982b951e40573e990ccf0ed00 (diff) |
Merge branch 'next' into for-linus
Prepare input updates for 4.16 merge window.
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/cyapa.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/cyapa_gen3.c | 43 | ||||
-rw-r--r-- | drivers/input/mouse/elan_i2c_core.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 34 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 10 |
5 files changed, 32 insertions, 59 deletions
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index fd8865c65caf..dfd3873513e4 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c | |||
@@ -740,7 +740,7 @@ static ssize_t cyapa_show_suspend_scanrate(struct device *dev, | |||
740 | char *buf) | 740 | char *buf) |
741 | { | 741 | { |
742 | struct cyapa *cyapa = dev_get_drvdata(dev); | 742 | struct cyapa *cyapa = dev_get_drvdata(dev); |
743 | u8 pwr_cmd = cyapa->suspend_power_mode; | 743 | u8 pwr_cmd; |
744 | u16 sleep_time; | 744 | u16 sleep_time; |
745 | int len; | 745 | int len; |
746 | int error; | 746 | int error; |
diff --git a/drivers/input/mouse/cyapa_gen3.c b/drivers/input/mouse/cyapa_gen3.c index 1cbfa4a6e830..076dda4a66da 100644 --- a/drivers/input/mouse/cyapa_gen3.c +++ b/drivers/input/mouse/cyapa_gen3.c | |||
@@ -137,49 +137,6 @@ static const u8 bl_exit[] = { 0x00, 0xff, 0xa5, 0x00, 0x01, 0x02, 0x03, 0x04, | |||
137 | 137 | ||
138 | 138 | ||
139 | /* for byte read/write command */ | 139 | /* for byte read/write command */ |
140 | #define CMD_RESET 0 | ||
141 | #define CMD_POWER_MODE 1 | ||
142 | #define CMD_DEV_STATUS 2 | ||
143 | #define CMD_REPORT_MAX_BASELINE 3 | ||
144 | #define CMD_REPORT_MIN_BASELINE 4 | ||
145 | #define SMBUS_BYTE_CMD(cmd) (((cmd) & 0x3f) << 1) | ||
146 | #define CYAPA_SMBUS_RESET SMBUS_BYTE_CMD(CMD_RESET) | ||
147 | #define CYAPA_SMBUS_POWER_MODE SMBUS_BYTE_CMD(CMD_POWER_MODE) | ||
148 | #define CYAPA_SMBUS_DEV_STATUS SMBUS_BYTE_CMD(CMD_DEV_STATUS) | ||
149 | #define CYAPA_SMBUS_MAX_BASELINE SMBUS_BYTE_CMD(CMD_REPORT_MAX_BASELINE) | ||
150 | #define CYAPA_SMBUS_MIN_BASELINE SMBUS_BYTE_CMD(CMD_REPORT_MIN_BASELINE) | ||
151 | |||
152 | /* for group registers read/write command */ | ||
153 | #define REG_GROUP_DATA 0 | ||
154 | #define REG_GROUP_CMD 2 | ||
155 | #define REG_GROUP_QUERY 3 | ||
156 | #define SMBUS_GROUP_CMD(grp) (0x80 | (((grp) & 0x07) << 3)) | ||
157 | #define CYAPA_SMBUS_GROUP_DATA SMBUS_GROUP_CMD(REG_GROUP_DATA) | ||
158 | #define CYAPA_SMBUS_GROUP_CMD SMBUS_GROUP_CMD(REG_GROUP_CMD) | ||
159 | #define CYAPA_SMBUS_GROUP_QUERY SMBUS_GROUP_CMD(REG_GROUP_QUERY) | ||
160 | |||
161 | /* for register block read/write command */ | ||
162 | #define CMD_BL_STATUS 0 | ||
163 | #define CMD_BL_HEAD 1 | ||
164 | #define CMD_BL_CMD 2 | ||
165 | #define CMD_BL_DATA 3 | ||
166 | #define CMD_BL_ALL 4 | ||
167 | #define CMD_BLK_PRODUCT_ID 5 | ||
168 | #define CMD_BLK_HEAD 6 | ||
169 | #define SMBUS_BLOCK_CMD(cmd) (0xc0 | (((cmd) & 0x1f) << 1)) | ||
170 | |||
171 | /* register block read/write command in bootloader mode */ | ||
172 | #define CYAPA_SMBUS_BL_STATUS SMBUS_BLOCK_CMD(CMD_BL_STATUS) | ||
173 | #define CYAPA_SMBUS_BL_HEAD SMBUS_BLOCK_CMD(CMD_BL_HEAD) | ||
174 | #define CYAPA_SMBUS_BL_CMD SMBUS_BLOCK_CMD(CMD_BL_CMD) | ||
175 | #define CYAPA_SMBUS_BL_DATA SMBUS_BLOCK_CMD(CMD_BL_DATA) | ||
176 | #define CYAPA_SMBUS_BL_ALL SMBUS_BLOCK_CMD(CMD_BL_ALL) | ||
177 | |||
178 | /* register block read/write command in operational mode */ | ||
179 | #define CYAPA_SMBUS_BLK_PRODUCT_ID SMBUS_BLOCK_CMD(CMD_BLK_PRODUCT_ID) | ||
180 | #define CYAPA_SMBUS_BLK_HEAD SMBUS_BLOCK_CMD(CMD_BLK_HEAD) | ||
181 | |||
182 | /* for byte read/write command */ | ||
183 | #define CMD_RESET 0 | 140 | #define CMD_RESET 0 |
184 | #define CMD_POWER_MODE 1 | 141 | #define CMD_POWER_MODE 1 |
185 | #define CMD_DEV_STATUS 2 | 142 | #define CMD_DEV_STATUS 2 |
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 2111a85d0b17..75e757520ef0 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include "elan_i2c.h" | 42 | #include "elan_i2c.h" |
43 | 43 | ||
44 | #define DRIVER_NAME "elan_i2c" | 44 | #define DRIVER_NAME "elan_i2c" |
45 | #define ELAN_DRIVER_VERSION "1.6.3" | ||
46 | #define ELAN_VENDOR_ID 0x04f3 | 45 | #define ELAN_VENDOR_ID 0x04f3 |
47 | #define ETP_MAX_PRESSURE 255 | 46 | #define ETP_MAX_PRESSURE 255 |
48 | #define ETP_FWIDTH_REDUCE 90 | 47 | #define ETP_FWIDTH_REDUCE 90 |
@@ -1294,4 +1293,3 @@ module_i2c_driver(elan_driver); | |||
1294 | MODULE_AUTHOR("Duson Lin <dusonlin@emc.com.tw>"); | 1293 | MODULE_AUTHOR("Duson Lin <dusonlin@emc.com.tw>"); |
1295 | MODULE_DESCRIPTION("Elan I2C/SMBus Touchpad driver"); | 1294 | MODULE_DESCRIPTION("Elan I2C/SMBus Touchpad driver"); |
1296 | MODULE_LICENSE("GPL"); | 1295 | MODULE_LICENSE("GPL"); |
1297 | MODULE_VERSION(ELAN_DRIVER_VERSION); | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 6a5649e52eed..8ac9e03c05b4 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -975,6 +975,21 @@ static void psmouse_apply_defaults(struct psmouse *psmouse) | |||
975 | psmouse->pt_deactivate = NULL; | 975 | psmouse->pt_deactivate = NULL; |
976 | } | 976 | } |
977 | 977 | ||
978 | static bool psmouse_do_detect(int (*detect)(struct psmouse *, bool), | ||
979 | struct psmouse *psmouse, bool allow_passthrough, | ||
980 | bool set_properties) | ||
981 | { | ||
982 | if (psmouse->ps2dev.serio->id.type == SERIO_PS_PSTHRU && | ||
983 | !allow_passthrough) { | ||
984 | return false; | ||
985 | } | ||
986 | |||
987 | if (set_properties) | ||
988 | psmouse_apply_defaults(psmouse); | ||
989 | |||
990 | return detect(psmouse, set_properties) == 0; | ||
991 | } | ||
992 | |||
978 | static bool psmouse_try_protocol(struct psmouse *psmouse, | 993 | static bool psmouse_try_protocol(struct psmouse *psmouse, |
979 | enum psmouse_type type, | 994 | enum psmouse_type type, |
980 | unsigned int *max_proto, | 995 | unsigned int *max_proto, |
@@ -986,15 +1001,8 @@ static bool psmouse_try_protocol(struct psmouse *psmouse, | |||
986 | if (!proto) | 1001 | if (!proto) |
987 | return false; | 1002 | return false; |
988 | 1003 | ||
989 | if (psmouse->ps2dev.serio->id.type == SERIO_PS_PSTHRU && | 1004 | if (!psmouse_do_detect(proto->detect, psmouse, proto->try_passthru, |
990 | !proto->try_passthru) { | 1005 | set_properties)) |
991 | return false; | ||
992 | } | ||
993 | |||
994 | if (set_properties) | ||
995 | psmouse_apply_defaults(psmouse); | ||
996 | |||
997 | if (proto->detect(psmouse, set_properties) != 0) | ||
998 | return false; | 1006 | return false; |
999 | 1007 | ||
1000 | if (set_properties && proto->init && init_allowed) { | 1008 | if (set_properties && proto->init && init_allowed) { |
@@ -1027,8 +1035,8 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
1027 | * Always check for focaltech, this is safe as it uses pnp-id | 1035 | * Always check for focaltech, this is safe as it uses pnp-id |
1028 | * matching. | 1036 | * matching. |
1029 | */ | 1037 | */ |
1030 | if (psmouse_try_protocol(psmouse, PSMOUSE_FOCALTECH, | 1038 | if (psmouse_do_detect(focaltech_detect, |
1031 | &max_proto, set_properties, false)) { | 1039 | psmouse, false, set_properties)) { |
1032 | if (max_proto > PSMOUSE_IMEX && | 1040 | if (max_proto > PSMOUSE_IMEX && |
1033 | IS_ENABLED(CONFIG_MOUSE_PS2_FOCALTECH) && | 1041 | IS_ENABLED(CONFIG_MOUSE_PS2_FOCALTECH) && |
1034 | (!set_properties || focaltech_init(psmouse) == 0)) { | 1042 | (!set_properties || focaltech_init(psmouse) == 0)) { |
@@ -1074,8 +1082,8 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
1074 | * probing for IntelliMouse. | 1082 | * probing for IntelliMouse. |
1075 | */ | 1083 | */ |
1076 | if (max_proto > PSMOUSE_PS2 && | 1084 | if (max_proto > PSMOUSE_PS2 && |
1077 | psmouse_try_protocol(psmouse, PSMOUSE_SYNAPTICS, &max_proto, | 1085 | psmouse_do_detect(synaptics_detect, |
1078 | set_properties, false)) { | 1086 | psmouse, false, set_properties)) { |
1079 | synaptics_hardware = true; | 1087 | synaptics_hardware = true; |
1080 | 1088 | ||
1081 | if (max_proto > PSMOUSE_IMEX) { | 1089 | if (max_proto > PSMOUSE_IMEX) { |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index cd9f61cb3fc6..3d2e23a0ae39 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -1281,6 +1281,16 @@ static void set_input_params(struct psmouse *psmouse, | |||
1281 | INPUT_MT_POINTER | | 1281 | INPUT_MT_POINTER | |
1282 | (cr48_profile_sensor ? | 1282 | (cr48_profile_sensor ? |
1283 | INPUT_MT_TRACK : INPUT_MT_SEMI_MT)); | 1283 | INPUT_MT_TRACK : INPUT_MT_SEMI_MT)); |
1284 | |||
1285 | /* | ||
1286 | * For semi-mt devices we send ABS_X/Y ourselves instead of | ||
1287 | * input_mt_report_pointer_emulation. But | ||
1288 | * input_mt_init_slots() resets the fuzz to 0, leading to a | ||
1289 | * filtered ABS_MT_POSITION_X but an unfiltered ABS_X | ||
1290 | * position. Let's re-initialize ABS_X/Y here. | ||
1291 | */ | ||
1292 | if (!cr48_profile_sensor) | ||
1293 | set_abs_position_params(dev, &priv->info, ABS_X, ABS_Y); | ||
1284 | } | 1294 | } |
1285 | 1295 | ||
1286 | if (SYN_CAP_PALMDETECT(info->capabilities)) | 1296 | if (SYN_CAP_PALMDETECT(info->capabilities)) |