• Home
  • Raw
  • Download

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()
208 static int synaptics_send_cmd(struct psmouse *psmouse, u8 cmd, u8 *param) in synaptics_send_cmd() argument
212 error = ps2_sliced_command(&psmouse->ps2dev, cmd); in synaptics_send_cmd()
216 error = ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO); in synaptics_send_cmd()
223 static int synaptics_query_int(struct psmouse *psmouse, u8 query_cmd, u32 *val) in synaptics_query_int() argument
231 error = synaptics_send_cmd(psmouse, query_cmd, resp.buf + 1); in synaptics_query_int()
243 static int synaptics_identify(struct psmouse *psmouse, in synaptics_identify() argument
248 error = synaptics_query_int(psmouse, SYN_QUE_IDENTIFY, &info->identity); in synaptics_identify()
259 static int synaptics_model_id(struct psmouse *psmouse, in synaptics_model_id() argument
262 return synaptics_query_int(psmouse, SYN_QUE_MODEL, &info->model_id); in synaptics_model_id()
268 static int synaptics_firmware_id(struct psmouse *psmouse, in synaptics_firmware_id() argument
271 return synaptics_query_int(psmouse, SYN_QUE_FIRMWARE_ID, in synaptics_firmware_id()
279 static int synaptics_query_modes(struct psmouse *psmouse, in synaptics_query_modes() argument
289 error = synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid); in synaptics_query_modes()
296 return synaptics_query_int(psmouse, SYN_QUE_MEXT_CAPAB_10, in synaptics_query_modes()
306 static int synaptics_capability(struct psmouse *psmouse, in synaptics_capability() argument
311 error = synaptics_query_int(psmouse, SYN_QUE_CAPABILITIES, in synaptics_capability()
333 error = synaptics_query_int(psmouse, SYN_QUE_EXT_CAPAB, in synaptics_capability()
336 psmouse_warn(psmouse, in synaptics_capability()
349 error = synaptics_query_int(psmouse, SYN_QUE_EXT_CAPAB_0C, in synaptics_capability()
352 psmouse_warn(psmouse, in synaptics_capability()
363 static int synaptics_resolution(struct psmouse *psmouse, in synaptics_resolution() argument
372 error = synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, resp); in synaptics_resolution()
382 error = synaptics_send_cmd(psmouse, in synaptics_resolution()
385 psmouse_warn(psmouse, in synaptics_resolution()
390 psmouse_info(psmouse, in synaptics_resolution()
404 error = synaptics_send_cmd(psmouse, in synaptics_resolution()
407 psmouse_warn(psmouse, in synaptics_resolution()
412 psmouse_info(psmouse, in synaptics_resolution()
421 static int synaptics_query_hardware(struct psmouse *psmouse, in synaptics_query_hardware() argument
428 error = synaptics_identify(psmouse, info); in synaptics_query_hardware()
432 error = synaptics_model_id(psmouse, info); in synaptics_query_hardware()
436 error = synaptics_firmware_id(psmouse, info); in synaptics_query_hardware()
440 error = synaptics_query_modes(psmouse, info); in synaptics_query_hardware()
444 error = synaptics_capability(psmouse, info); in synaptics_query_hardware()
448 error = synaptics_resolution(psmouse, info); in synaptics_query_hardware()
528 static void synaptics_apply_quirks(struct psmouse *psmouse, in synaptics_apply_quirks() argument
534 if (!psmouse_matches_pnp_id(psmouse, in synaptics_apply_quirks()
550 psmouse_info(psmouse, in synaptics_apply_quirks()
564 static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse) in synaptics_set_advanced_gesture_mode() argument
569 error = ps2_sliced_command(&psmouse->ps2dev, SYN_QUE_MODEL); in synaptics_set_advanced_gesture_mode()
573 error = ps2_command(&psmouse->ps2dev, &param, PSMOUSE_CMD_SETRATE); in synaptics_set_advanced_gesture_mode()
580 static int synaptics_set_mode(struct psmouse *psmouse) in synaptics_set_mode() argument
582 struct synaptics_data *priv = psmouse->private; in synaptics_set_mode()
590 if (psmouse->rate >= 80) in synaptics_set_mode()
595 error = synaptics_mode_cmd(psmouse, priv->mode); in synaptics_set_mode()
600 error = synaptics_set_advanced_gesture_mode(psmouse); in synaptics_set_mode()
602 psmouse_err(psmouse, in synaptics_set_mode()
612 static void synaptics_set_rate(struct psmouse *psmouse, unsigned int rate) in synaptics_set_rate() argument
614 struct synaptics_data *priv = psmouse->private; in synaptics_set_rate()
618 psmouse->rate = 80; in synaptics_set_rate()
621 psmouse->rate = 40; in synaptics_set_rate()
624 synaptics_mode_cmd(psmouse, priv->mode); in synaptics_set_rate()
632 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_write()
649 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_start()
661 struct psmouse *parent = serio_get_drvdata(serio->parent); in synaptics_pt_stop()
676 struct psmouse *child = serio_get_drvdata(ptport); in synaptics_pass_pt_packet()
689 static void synaptics_pt_activate(struct psmouse *psmouse) in synaptics_pt_activate() argument
691 struct synaptics_data *priv = psmouse->private; in synaptics_pt_activate()
692 struct psmouse *child = serio_get_drvdata(priv->pt_port); in synaptics_pt_activate()
701 if (synaptics_mode_cmd(psmouse, priv->mode)) in synaptics_pt_activate()
702 psmouse_warn(psmouse, in synaptics_pt_activate()
707 static void synaptics_pt_create(struct psmouse *psmouse) in synaptics_pt_create() argument
713 psmouse_err(psmouse, in synaptics_pt_create()
724 serio->parent = psmouse->ps2dev.serio; in synaptics_pt_create()
726 psmouse->pt_activate = synaptics_pt_activate; in synaptics_pt_create()
728 psmouse_info(psmouse, "serio: %s port at %s\n", in synaptics_pt_create()
729 serio->name, psmouse->phys); in synaptics_pt_create()
922 static void synaptics_report_ext_buttons(struct psmouse *psmouse, in synaptics_report_ext_buttons() argument
925 struct input_dev *dev = psmouse->dev; in synaptics_report_ext_buttons()
926 struct synaptics_data *priv = psmouse->private; in synaptics_report_ext_buttons()
936 !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02)) in synaptics_report_ext_buttons()
968 static void synaptics_report_buttons(struct psmouse *psmouse, in synaptics_report_buttons() argument
971 struct input_dev *dev = psmouse->dev; in synaptics_report_buttons()
972 struct synaptics_data *priv = psmouse->private; in synaptics_report_buttons()
985 synaptics_report_ext_buttons(psmouse, hw); in synaptics_report_buttons()
988 static void synaptics_report_mt_data(struct psmouse *psmouse, in synaptics_report_mt_data() argument
992 struct input_dev *dev = psmouse->dev; in synaptics_report_mt_data()
993 struct synaptics_data *priv = psmouse->private; in synaptics_report_mt_data()
1023 synaptics_report_buttons(psmouse, sgm); in synaptics_report_mt_data()
1028 static void synaptics_image_sensor_process(struct psmouse *psmouse, in synaptics_image_sensor_process() argument
1031 struct synaptics_data *priv = psmouse->private; in synaptics_image_sensor_process()
1049 synaptics_report_mt_data(psmouse, sgm, num_fingers); in synaptics_image_sensor_process()
1064 static void synaptics_process_packet(struct psmouse *psmouse) in synaptics_process_packet() argument
1066 struct input_dev *dev = psmouse->dev; in synaptics_process_packet()
1067 struct synaptics_data *priv = psmouse->private; in synaptics_process_packet()
1073 if (synaptics_parse_hw_state(psmouse->packet, priv, &hw)) in synaptics_process_packet()
1077 synaptics_image_sensor_process(psmouse, &hw); in synaptics_process_packet()
1129 synaptics_report_mt_data(psmouse, &hw, num_fingers); in synaptics_process_packet()
1159 synaptics_report_buttons(psmouse, &hw); in synaptics_process_packet()
1164 static bool synaptics_validate_byte(struct psmouse *psmouse, in synaptics_validate_byte() argument
1172 const u8 *packet = psmouse->packet; in synaptics_validate_byte()
1190 psmouse_err(psmouse, "unknown packet type %d\n", pkt_type); in synaptics_validate_byte()
1196 synaptics_detect_pkt_type(struct psmouse *psmouse) in synaptics_detect_pkt_type() argument
1201 if (!synaptics_validate_byte(psmouse, i, SYN_NEWABS_STRICT)) { in synaptics_detect_pkt_type()
1202 psmouse_info(psmouse, "using relaxed packet validation\n"); in synaptics_detect_pkt_type()
1210 static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse) in synaptics_process_byte() argument
1212 struct synaptics_data *priv = psmouse->private; in synaptics_process_byte()
1214 if (psmouse->pktcnt >= 6) { /* Full packet received */ in synaptics_process_byte()
1216 priv->pkt_type = synaptics_detect_pkt_type(psmouse); in synaptics_process_byte()
1219 synaptics_is_pt_packet(psmouse->packet)) { in synaptics_process_byte()
1222 psmouse->packet); in synaptics_process_byte()
1224 synaptics_process_packet(psmouse); in synaptics_process_byte()
1229 return synaptics_validate_byte(psmouse, psmouse->pktcnt - 1, priv->pkt_type) ? in synaptics_process_byte()
1253 static int set_input_params(struct psmouse *psmouse, in set_input_params() argument
1256 struct input_dev *dev = psmouse->dev; in set_input_params()
1355 if (psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in set_input_params()
1363 static ssize_t synaptics_show_disable_gesture(struct psmouse *psmouse, in synaptics_show_disable_gesture() argument
1366 struct synaptics_data *priv = psmouse->private; in synaptics_show_disable_gesture()
1371 static ssize_t synaptics_set_disable_gesture(struct psmouse *psmouse, in synaptics_set_disable_gesture() argument
1375 struct synaptics_data *priv = psmouse->private; in synaptics_set_disable_gesture()
1395 if (synaptics_mode_cmd(psmouse, priv->mode)) in synaptics_set_disable_gesture()
1405 static void synaptics_disconnect(struct psmouse *psmouse) in synaptics_disconnect() argument
1407 struct synaptics_data *priv = psmouse->private; in synaptics_disconnect()
1413 psmouse_smbus_cleanup(psmouse); in synaptics_disconnect()
1417 device_remove_file(&psmouse->ps2dev.serio->dev, in synaptics_disconnect()
1420 synaptics_reset(psmouse); in synaptics_disconnect()
1422 psmouse->private = NULL; in synaptics_disconnect()
1425 static int synaptics_reconnect(struct psmouse *psmouse) in synaptics_reconnect() argument
1427 struct synaptics_data *priv = psmouse->private; in synaptics_reconnect()
1434 psmouse_reset(psmouse); in synaptics_reconnect()
1445 ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID); in synaptics_reconnect()
1446 error = synaptics_detect(psmouse, 0); in synaptics_reconnect()
1453 psmouse_dbg(psmouse, "reconnected after %d tries\n", retry); in synaptics_reconnect()
1455 error = synaptics_query_hardware(psmouse, &info); in synaptics_reconnect()
1457 psmouse_err(psmouse, "Unable to query device.\n"); in synaptics_reconnect()
1461 error = synaptics_set_mode(psmouse); in synaptics_reconnect()
1463 psmouse_err(psmouse, "Unable to initialize device.\n"); in synaptics_reconnect()
1471 psmouse_err(psmouse, in synaptics_reconnect()
1557 static int synaptics_init_ps2(struct psmouse *psmouse, in synaptics_init_ps2() argument
1564 synaptics_apply_quirks(psmouse, info); in synaptics_init_ps2()
1566 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); in synaptics_init_ps2()
1579 priv->is_forcepad = psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids); in synaptics_init_ps2()
1581 err = synaptics_set_mode(psmouse); in synaptics_init_ps2()
1583 psmouse_err(psmouse, "Unable to initialize device.\n"); in synaptics_init_ps2()
1590 psmouse_info(psmouse, in synaptics_init_ps2()
1598 err = set_input_params(psmouse, priv); in synaptics_init_ps2()
1600 psmouse_err(psmouse, in synaptics_init_ps2()
1612 psmouse->model = ((info->model_id & 0x00ff0000) >> 8) | in synaptics_init_ps2()
1616 psmouse->protocol_handler = synaptics_process_byte; in synaptics_init_ps2()
1617 psmouse->pktsize = 6; in synaptics_init_ps2()
1620 psmouse->protocol_handler = psmouse_process_byte; in synaptics_init_ps2()
1621 psmouse->pktsize = 3; in synaptics_init_ps2()
1624 psmouse->set_rate = synaptics_set_rate; in synaptics_init_ps2()
1625 psmouse->disconnect = synaptics_disconnect; in synaptics_init_ps2()
1626 psmouse->reconnect = synaptics_reconnect; in synaptics_init_ps2()
1627 psmouse->fast_reconnect = NULL; in synaptics_init_ps2()
1628 psmouse->cleanup = synaptics_reset; in synaptics_init_ps2()
1630 psmouse->resync_time = 0; in synaptics_init_ps2()
1633 synaptics_pt_create(psmouse); in synaptics_init_ps2()
1640 if (psmouse->rate >= 80 && impaired_toshiba_kbc) { in synaptics_init_ps2()
1641 psmouse_info(psmouse, in synaptics_init_ps2()
1644 psmouse->rate = 40; in synaptics_init_ps2()
1648 err = device_create_file(&psmouse->ps2dev.serio->dev, in synaptics_init_ps2()
1651 psmouse_err(psmouse, in synaptics_init_ps2()
1665 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) in __synaptics_init() argument
1670 psmouse_reset(psmouse); in __synaptics_init()
1672 error = synaptics_query_hardware(psmouse, &info); in __synaptics_init()
1674 psmouse_err(psmouse, "Unable to query device: %d\n", error); in __synaptics_init()
1678 return synaptics_init_ps2(psmouse, &info, absolute_mode); in __synaptics_init()
1681 int synaptics_init_absolute(struct psmouse *psmouse) in synaptics_init_absolute() argument
1683 return __synaptics_init(psmouse, true); in synaptics_init_absolute()
1686 int synaptics_init_relative(struct psmouse *psmouse) in synaptics_init_relative() argument
1688 return __synaptics_init(psmouse, false); in synaptics_init_relative()
1691 static int synaptics_setup_ps2(struct psmouse *psmouse, in synaptics_setup_ps2() argument
1704 psmouse_info(psmouse, in synaptics_setup_ps2()
1709 error = synaptics_init_ps2(psmouse, info, absolute_mode); in synaptics_setup_ps2()
1723 synaptics_setup_ps2(struct psmouse *psmouse, in synaptics_setup_ps2() argument
1749 static int synaptics_create_intertouch(struct psmouse *psmouse, in synaptics_create_intertouch() argument
1754 psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in synaptics_create_intertouch()
1775 return psmouse_smbus_init(psmouse, &intertouch_board, in synaptics_create_intertouch()
1784 static int synaptics_setup_intertouch(struct psmouse *psmouse, in synaptics_setup_intertouch() argument
1794 if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && in synaptics_setup_intertouch()
1795 !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) { in synaptics_setup_intertouch()
1797 if (!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) in synaptics_setup_intertouch()
1798 psmouse_info(psmouse, in synaptics_setup_intertouch()
1801 psmouse->ps2dev.serio->firmware_id); in synaptics_setup_intertouch()
1807 psmouse_info(psmouse, "Trying to set up SMBus access\n"); in synaptics_setup_intertouch()
1809 error = synaptics_create_intertouch(psmouse, info, leave_breadcrumbs); in synaptics_setup_intertouch()
1812 psmouse_info(psmouse, "SMbus companion is not ready yet\n"); in synaptics_setup_intertouch()
1814 psmouse_err(psmouse, "unable to create intertouch device\n"); in synaptics_setup_intertouch()
1822 int synaptics_init_smbus(struct psmouse *psmouse) in synaptics_init_smbus() argument
1827 psmouse_reset(psmouse); in synaptics_init_smbus()
1829 error = synaptics_query_hardware(psmouse, &info); in synaptics_init_smbus()
1831 psmouse_err(psmouse, "Unable to query device: %d\n", error); in synaptics_init_smbus()
1838 return synaptics_create_intertouch(psmouse, &info, false); in synaptics_init_smbus()
1844 synaptics_setup_intertouch(struct psmouse *psmouse, in synaptics_setup_intertouch() argument
1851 int synaptics_init_smbus(struct psmouse *psmouse) in synaptics_init_smbus() argument
1861 int synaptics_init(struct psmouse *psmouse) in synaptics_init() argument
1867 psmouse_reset(psmouse); in synaptics_init()
1869 error = synaptics_query_hardware(psmouse, &info); in synaptics_init()
1871 psmouse_err(psmouse, "Unable to query device: %d\n", error); in synaptics_init()
1879 !psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) { in synaptics_init()
1880 psmouse_warn(psmouse, in synaptics_init()
1885 error = synaptics_setup_intertouch(psmouse, &info, true); in synaptics_init()
1890 retval = synaptics_setup_ps2(psmouse, &info); in synaptics_init()
1896 psmouse_smbus_cleanup(psmouse); in synaptics_init()
1904 int synaptics_init(struct psmouse *psmouse) in synaptics_init() argument