Lines Matching refs:psmouse
79 static int synaptics_mode_cmd(struct psmouse *psmouse, u8 mode) in synaptics_mode_cmd() argument
84 error = ps2_sliced_command(&psmouse->ps2dev, mode); in synaptics_mode_cmd()
89 error = ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_SETRATE); in synaptics_mode_cmd()
96 int synaptics_detect(struct psmouse *psmouse, bool set_properties) in synaptics_detect() argument
98 struct ps2dev *ps2dev = &psmouse->ps2dev; in synaptics_detect()
111 psmouse->vendor = "Synaptics"; in synaptics_detect()
112 psmouse->name = "TouchPad"; in synaptics_detect()
118 void synaptics_reset(struct psmouse *psmouse) in synaptics_reset() argument
121 synaptics_mode_cmd(psmouse, 0); in synaptics_reset()
198 static int synaptics_send_cmd(struct psmouse *psmouse, u8 cmd, u8 *param) in synaptics_send_cmd() argument
202 error = ps2_sliced_command(&psmouse->ps2dev, cmd); in synaptics_send_cmd()
206 error = ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO); in synaptics_send_cmd()
213 static int synaptics_query_int(struct psmouse *psmouse, u8 query_cmd, u32 *val) in synaptics_query_int() argument
221 error = synaptics_send_cmd(psmouse, query_cmd, resp.buf + 1); in synaptics_query_int()
233 static int synaptics_identify(struct psmouse *psmouse, in synaptics_identify() argument
238 error = synaptics_query_int(psmouse, SYN_QUE_IDENTIFY, &info->identity); in synaptics_identify()
249 static int synaptics_model_id(struct psmouse *psmouse, in synaptics_model_id() argument
252 return synaptics_query_int(psmouse, SYN_QUE_MODEL, &info->model_id); in synaptics_model_id()
258 static int synaptics_firmware_id(struct psmouse *psmouse, in synaptics_firmware_id() argument
261 return synaptics_query_int(psmouse, SYN_QUE_FIRMWARE_ID, in synaptics_firmware_id()
269 static int synaptics_query_modes(struct psmouse *psmouse, in synaptics_query_modes() argument
279 error = synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid); in synaptics_query_modes()
286 return synaptics_query_int(psmouse, SYN_QUE_MEXT_CAPAB_10, in synaptics_query_modes()
296 static int synaptics_capability(struct psmouse *psmouse, in synaptics_capability() argument
301 error = synaptics_query_int(psmouse, SYN_QUE_CAPABILITIES, in synaptics_capability()
323 error = synaptics_query_int(psmouse, SYN_QUE_EXT_CAPAB, in synaptics_capability()
326 psmouse_warn(psmouse, in synaptics_capability()
339 error = synaptics_query_int(psmouse, SYN_QUE_EXT_CAPAB_0C, in synaptics_capability()
342 psmouse_warn(psmouse, in synaptics_capability()
353 static int synaptics_resolution(struct psmouse *psmouse, in synaptics_resolution() argument
362 error = synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, resp); in synaptics_resolution()
372 error = synaptics_send_cmd(psmouse, in synaptics_resolution()
375 psmouse_warn(psmouse, in synaptics_resolution()
380 psmouse_info(psmouse, in synaptics_resolution()
394 error = synaptics_send_cmd(psmouse, in synaptics_resolution()
397 psmouse_warn(psmouse, in synaptics_resolution()
402 psmouse_info(psmouse, in synaptics_resolution()
411 static int synaptics_query_hardware(struct psmouse *psmouse, in synaptics_query_hardware() argument
418 error = synaptics_identify(psmouse, info); in synaptics_query_hardware()
422 error = synaptics_model_id(psmouse, info); in synaptics_query_hardware()
426 error = synaptics_firmware_id(psmouse, info); in synaptics_query_hardware()
430 error = synaptics_query_modes(psmouse, info); in synaptics_query_hardware()
434 error = synaptics_capability(psmouse, info); in synaptics_query_hardware()
438 error = synaptics_resolution(psmouse, info); in synaptics_query_hardware()
518 static void synaptics_apply_quirks(struct psmouse *psmouse, in synaptics_apply_quirks() argument
524 if (!psmouse_matches_pnp_id(psmouse, in synaptics_apply_quirks()
540 psmouse_info(psmouse, in synaptics_apply_quirks()
554 static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse) in synaptics_set_advanced_gesture_mode() argument
559 error = ps2_sliced_command(&psmouse->ps2dev, SYN_QUE_MODEL); in synaptics_set_advanced_gesture_mode()
563 error = ps2_command(&psmouse->ps2dev, ¶m, PSMOUSE_CMD_SETRATE); in synaptics_set_advanced_gesture_mode()
570 static int synaptics_set_mode(struct psmouse *psmouse) in synaptics_set_mode() argument
572 struct synaptics_data *priv = psmouse->private; in synaptics_set_mode()
580 if (psmouse->rate >= 80) in synaptics_set_mode()
585 error = synaptics_mode_cmd(psmouse, priv->mode); in synaptics_set_mode()
590 error = synaptics_set_advanced_gesture_mode(psmouse); in synaptics_set_mode()
592 psmouse_err(psmouse, in synaptics_set_mode()
602 static void synaptics_set_rate(struct psmouse *psmouse, unsigned int rate) in synaptics_set_rate() argument
604 struct synaptics_data *priv = psmouse->private; in synaptics_set_rate()
608 psmouse->rate = 80; in synaptics_set_rate()
611 psmouse->rate = 40; in synaptics_set_rate()
614 synaptics_mode_cmd(psmouse, priv->mode); in synaptics_set_rate()
622 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_write()
639 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_start()
651 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_stop()
666 struct psmouse *child = serio_get_drvdata(ptport); in synaptics_pass_pt_packet()
679 static void synaptics_pt_activate(struct psmouse *psmouse) in synaptics_pt_activate() argument
681 struct synaptics_data *priv = psmouse->private; in synaptics_pt_activate()
682 struct psmouse *child = serio_get_drvdata(priv->pt_port); in synaptics_pt_activate()
691 if (synaptics_mode_cmd(psmouse, priv->mode)) in synaptics_pt_activate()
692 psmouse_warn(psmouse, in synaptics_pt_activate()
697 static void synaptics_pt_create(struct psmouse *psmouse) in synaptics_pt_create() argument
703 psmouse_err(psmouse, in synaptics_pt_create()
714 serio->parent = psmouse->ps2dev.serio; in synaptics_pt_create()
716 psmouse->pt_activate = synaptics_pt_activate; in synaptics_pt_create()
718 psmouse_info(psmouse, "serio: %s port at %s\n", in synaptics_pt_create()
719 serio->name, psmouse->phys); in synaptics_pt_create()
912 static void synaptics_report_ext_buttons(struct psmouse *psmouse, in synaptics_report_ext_buttons() argument
915 struct input_dev *dev = psmouse->dev; in synaptics_report_ext_buttons()
916 struct synaptics_data *priv = psmouse->private; in synaptics_report_ext_buttons()
926 !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02)) in synaptics_report_ext_buttons()
958 static void synaptics_report_buttons(struct psmouse *psmouse, in synaptics_report_buttons() argument
961 struct input_dev *dev = psmouse->dev; in synaptics_report_buttons()
962 struct synaptics_data *priv = psmouse->private; in synaptics_report_buttons()
975 synaptics_report_ext_buttons(psmouse, hw); in synaptics_report_buttons()
978 static void synaptics_report_mt_data(struct psmouse *psmouse, in synaptics_report_mt_data() argument
982 struct input_dev *dev = psmouse->dev; in synaptics_report_mt_data()
983 struct synaptics_data *priv = psmouse->private; in synaptics_report_mt_data()
1013 synaptics_report_buttons(psmouse, sgm); in synaptics_report_mt_data()
1018 static void synaptics_image_sensor_process(struct psmouse *psmouse, in synaptics_image_sensor_process() argument
1021 struct synaptics_data *priv = psmouse->private; in synaptics_image_sensor_process()
1039 synaptics_report_mt_data(psmouse, sgm, num_fingers); in synaptics_image_sensor_process()
1054 static void synaptics_process_packet(struct psmouse *psmouse) in synaptics_process_packet() argument
1056 struct input_dev *dev = psmouse->dev; in synaptics_process_packet()
1057 struct synaptics_data *priv = psmouse->private; in synaptics_process_packet()
1063 if (synaptics_parse_hw_state(psmouse->packet, priv, &hw)) in synaptics_process_packet()
1067 synaptics_image_sensor_process(psmouse, &hw); in synaptics_process_packet()
1116 synaptics_report_mt_data(psmouse, &hw, num_fingers); in synaptics_process_packet()
1146 synaptics_report_buttons(psmouse, &hw); in synaptics_process_packet()
1151 static bool synaptics_validate_byte(struct psmouse *psmouse, in synaptics_validate_byte() argument
1159 const u8 *packet = psmouse->packet; in synaptics_validate_byte()
1177 psmouse_err(psmouse, "unknown packet type %d\n", pkt_type); in synaptics_validate_byte()
1183 synaptics_detect_pkt_type(struct psmouse *psmouse) in synaptics_detect_pkt_type() argument
1188 if (!synaptics_validate_byte(psmouse, i, SYN_NEWABS_STRICT)) { in synaptics_detect_pkt_type()
1189 psmouse_info(psmouse, "using relaxed packet validation\n"); in synaptics_detect_pkt_type()
1197 static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse) in synaptics_process_byte() argument
1199 struct synaptics_data *priv = psmouse->private; in synaptics_process_byte()
1201 if (psmouse->pktcnt >= 6) { /* Full packet received */ in synaptics_process_byte()
1203 priv->pkt_type = synaptics_detect_pkt_type(psmouse); in synaptics_process_byte()
1206 synaptics_is_pt_packet(psmouse->packet)) { in synaptics_process_byte()
1209 psmouse->packet); in synaptics_process_byte()
1211 synaptics_process_packet(psmouse); in synaptics_process_byte()
1216 return synaptics_validate_byte(psmouse, psmouse->pktcnt - 1, priv->pkt_type) ? in synaptics_process_byte()
1240 static int set_input_params(struct psmouse *psmouse, in set_input_params() argument
1243 struct input_dev *dev = psmouse->dev; in set_input_params()
1342 if (psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in set_input_params()
1350 static ssize_t synaptics_show_disable_gesture(struct psmouse *psmouse, in synaptics_show_disable_gesture() argument
1353 struct synaptics_data *priv = psmouse->private; in synaptics_show_disable_gesture()
1358 static ssize_t synaptics_set_disable_gesture(struct psmouse *psmouse, in synaptics_set_disable_gesture() argument
1362 struct synaptics_data *priv = psmouse->private; in synaptics_set_disable_gesture()
1382 if (synaptics_mode_cmd(psmouse, priv->mode)) in synaptics_set_disable_gesture()
1392 static void synaptics_disconnect(struct psmouse *psmouse) in synaptics_disconnect() argument
1394 struct synaptics_data *priv = psmouse->private; in synaptics_disconnect()
1400 psmouse_smbus_cleanup(psmouse); in synaptics_disconnect()
1404 device_remove_file(&psmouse->ps2dev.serio->dev, in synaptics_disconnect()
1407 synaptics_reset(psmouse); in synaptics_disconnect()
1409 psmouse->private = NULL; in synaptics_disconnect()
1412 static int synaptics_reconnect(struct psmouse *psmouse) in synaptics_reconnect() argument
1414 struct synaptics_data *priv = psmouse->private; in synaptics_reconnect()
1421 psmouse_reset(psmouse); in synaptics_reconnect()
1432 ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID); in synaptics_reconnect()
1433 error = synaptics_detect(psmouse, 0); in synaptics_reconnect()
1440 psmouse_dbg(psmouse, "reconnected after %d tries\n", retry); in synaptics_reconnect()
1442 error = synaptics_query_hardware(psmouse, &info); in synaptics_reconnect()
1444 psmouse_err(psmouse, "Unable to query device.\n"); in synaptics_reconnect()
1448 error = synaptics_set_mode(psmouse); in synaptics_reconnect()
1450 psmouse_err(psmouse, "Unable to initialize device.\n"); in synaptics_reconnect()
1458 psmouse_err(psmouse, in synaptics_reconnect()
1544 static int synaptics_init_ps2(struct psmouse *psmouse, in synaptics_init_ps2() argument
1551 synaptics_apply_quirks(psmouse, info); in synaptics_init_ps2()
1553 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); in synaptics_init_ps2()
1566 priv->is_forcepad = psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids); in synaptics_init_ps2()
1568 err = synaptics_set_mode(psmouse); in synaptics_init_ps2()
1570 psmouse_err(psmouse, "Unable to initialize device.\n"); in synaptics_init_ps2()
1577 psmouse_info(psmouse, in synaptics_init_ps2()
1585 err = set_input_params(psmouse, priv); in synaptics_init_ps2()
1587 psmouse_err(psmouse, in synaptics_init_ps2()
1599 psmouse->model = ((info->model_id & 0x00ff0000) >> 8) | in synaptics_init_ps2()
1603 psmouse->protocol_handler = synaptics_process_byte; in synaptics_init_ps2()
1604 psmouse->pktsize = 6; in synaptics_init_ps2()
1607 psmouse->protocol_handler = psmouse_process_byte; in synaptics_init_ps2()
1608 psmouse->pktsize = 3; in synaptics_init_ps2()
1611 psmouse->set_rate = synaptics_set_rate; in synaptics_init_ps2()
1612 psmouse->disconnect = synaptics_disconnect; in synaptics_init_ps2()
1613 psmouse->reconnect = synaptics_reconnect; in synaptics_init_ps2()
1614 psmouse->cleanup = synaptics_reset; in synaptics_init_ps2()
1616 psmouse->resync_time = 0; in synaptics_init_ps2()
1619 synaptics_pt_create(psmouse); in synaptics_init_ps2()
1626 if (psmouse->rate >= 80 && impaired_toshiba_kbc) { in synaptics_init_ps2()
1627 psmouse_info(psmouse, in synaptics_init_ps2()
1630 psmouse->rate = 40; in synaptics_init_ps2()
1634 err = device_create_file(&psmouse->ps2dev.serio->dev, in synaptics_init_ps2()
1637 psmouse_err(psmouse, in synaptics_init_ps2()
1651 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) in __synaptics_init() argument
1656 psmouse_reset(psmouse); in __synaptics_init()
1658 error = synaptics_query_hardware(psmouse, &info); in __synaptics_init()
1660 psmouse_err(psmouse, "Unable to query device: %d\n", error); in __synaptics_init()
1664 return synaptics_init_ps2(psmouse, &info, absolute_mode); in __synaptics_init()
1667 int synaptics_init_absolute(struct psmouse *psmouse) in synaptics_init_absolute() argument
1669 return __synaptics_init(psmouse, true); in synaptics_init_absolute()
1672 int synaptics_init_relative(struct psmouse *psmouse) in synaptics_init_relative() argument
1674 return __synaptics_init(psmouse, false); in synaptics_init_relative()
1677 static int synaptics_setup_ps2(struct psmouse *psmouse, in synaptics_setup_ps2() argument
1690 psmouse_info(psmouse, in synaptics_setup_ps2()
1695 error = synaptics_init_ps2(psmouse, info, absolute_mode); in synaptics_setup_ps2()
1709 synaptics_setup_ps2(struct psmouse *psmouse, in synaptics_setup_ps2() argument
1735 static int synaptics_create_intertouch(struct psmouse *psmouse, in synaptics_create_intertouch() argument
1740 psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in synaptics_create_intertouch()
1760 return psmouse_smbus_init(psmouse, &intertouch_board, in synaptics_create_intertouch()
1769 static int synaptics_setup_intertouch(struct psmouse *psmouse, in synaptics_setup_intertouch() argument
1779 if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in synaptics_setup_intertouch()
1780 !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) { in synaptics_setup_intertouch()
1782 if (!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) in synaptics_setup_intertouch()
1783 psmouse_info(psmouse, in synaptics_setup_intertouch()
1786 psmouse->ps2dev.serio->firmware_id); in synaptics_setup_intertouch()
1792 psmouse_info(psmouse, "Trying to set up SMBus access\n"); in synaptics_setup_intertouch()
1794 error = synaptics_create_intertouch(psmouse, info, leave_breadcrumbs); in synaptics_setup_intertouch()
1797 psmouse_info(psmouse, "SMbus companion is not ready yet\n"); in synaptics_setup_intertouch()
1799 psmouse_err(psmouse, "unable to create intertouch device\n"); in synaptics_setup_intertouch()
1807 int synaptics_init_smbus(struct psmouse *psmouse) in synaptics_init_smbus() argument
1812 psmouse_reset(psmouse); in synaptics_init_smbus()
1814 error = synaptics_query_hardware(psmouse, &info); in synaptics_init_smbus()
1816 psmouse_err(psmouse, "Unable to query device: %d\n", error); in synaptics_init_smbus()
1823 return synaptics_create_intertouch(psmouse, &info, false); in synaptics_init_smbus()
1829 synaptics_setup_intertouch(struct psmouse *psmouse, in synaptics_setup_intertouch() argument
1836 int synaptics_init_smbus(struct psmouse *psmouse) in synaptics_init_smbus() argument
1846 int synaptics_init(struct psmouse *psmouse) in synaptics_init() argument
1852 psmouse_reset(psmouse); in synaptics_init()
1854 error = synaptics_query_hardware(psmouse, &info); in synaptics_init()
1856 psmouse_err(psmouse, "Unable to query device: %d\n", error); in synaptics_init()
1864 !psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) { in synaptics_init()
1865 psmouse_warn(psmouse, in synaptics_init()
1870 error = synaptics_setup_intertouch(psmouse, &info, true); in synaptics_init()
1875 retval = synaptics_setup_ps2(psmouse, &info); in synaptics_init()
1881 psmouse_smbus_cleanup(psmouse); in synaptics_init()
1889 int synaptics_init(struct psmouse *psmouse) in synaptics_init() argument