Lines Matching refs:cytp

31 	struct cytp_data *cytp = psmouse->private;  in cypress_set_packet_size()  local
32 cytp->pkt_size = n; in cypress_set_packet_size()
180 struct cytp_data *cytp = psmouse->private; in cypress_read_fw_version() local
190 cytp->fw_version = param[2] & FW_VERSION_MASX; in cypress_read_fw_version()
191 cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; in cypress_read_fw_version()
197 if (cytp->fw_version >= 11) in cypress_read_fw_version()
198 cytp->tp_metrics_supported = 0; in cypress_read_fw_version()
200 psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); in cypress_read_fw_version()
202 cytp->tp_metrics_supported); in cypress_read_fw_version()
209 struct cytp_data *cytp = psmouse->private; in cypress_read_tp_metrics() local
213 cytp->tp_width = CYTP_DEFAULT_WIDTH; in cypress_read_tp_metrics()
214 cytp->tp_high = CYTP_DEFAULT_HIGH; in cypress_read_tp_metrics()
215 cytp->tp_max_abs_x = CYTP_ABS_MAX_X; in cypress_read_tp_metrics()
216 cytp->tp_max_abs_y = CYTP_ABS_MAX_Y; in cypress_read_tp_metrics()
217 cytp->tp_min_pressure = CYTP_MIN_PRESSURE; in cypress_read_tp_metrics()
218 cytp->tp_max_pressure = CYTP_MAX_PRESSURE; in cypress_read_tp_metrics()
219 cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; in cypress_read_tp_metrics()
220 cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; in cypress_read_tp_metrics()
222 if (!cytp->tp_metrics_supported) in cypress_read_tp_metrics()
228 cytp->tp_max_abs_x = (param[1] << 8) | param[0]; in cypress_read_tp_metrics()
229 cytp->tp_max_abs_y = (param[3] << 8) | param[2]; in cypress_read_tp_metrics()
230 cytp->tp_min_pressure = param[4]; in cypress_read_tp_metrics()
231 cytp->tp_max_pressure = param[5]; in cypress_read_tp_metrics()
234 if (!cytp->tp_max_pressure || in cypress_read_tp_metrics()
235 cytp->tp_max_pressure < cytp->tp_min_pressure || in cypress_read_tp_metrics()
236 !cytp->tp_width || !cytp->tp_high || in cypress_read_tp_metrics()
237 !cytp->tp_max_abs_x || in cypress_read_tp_metrics()
238 cytp->tp_max_abs_x < cytp->tp_width || in cypress_read_tp_metrics()
239 !cytp->tp_max_abs_y || in cypress_read_tp_metrics()
240 cytp->tp_max_abs_y < cytp->tp_high) in cypress_read_tp_metrics()
243 cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; in cypress_read_tp_metrics()
244 cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; in cypress_read_tp_metrics()
248 psmouse_dbg(psmouse, "cytp->tp_width = %d\n", cytp->tp_width); in cypress_read_tp_metrics()
249 psmouse_dbg(psmouse, "cytp->tp_high = %d\n", cytp->tp_high); in cypress_read_tp_metrics()
250 psmouse_dbg(psmouse, "cytp->tp_max_abs_x = %d\n", cytp->tp_max_abs_x); in cypress_read_tp_metrics()
251 psmouse_dbg(psmouse, "cytp->tp_max_abs_y = %d\n", cytp->tp_max_abs_y); in cypress_read_tp_metrics()
252 psmouse_dbg(psmouse, "cytp->tp_min_pressure = %d\n", cytp->tp_min_pressure); in cypress_read_tp_metrics()
253 psmouse_dbg(psmouse, "cytp->tp_max_pressure = %d\n", cytp->tp_max_pressure); in cypress_read_tp_metrics()
254 psmouse_dbg(psmouse, "cytp->tp_res_x = %d\n", cytp->tp_res_x); in cypress_read_tp_metrics()
255 psmouse_dbg(psmouse, "cytp->tp_res_y = %d\n", cytp->tp_res_y); in cypress_read_tp_metrics()
297 struct cytp_data *cytp = psmouse->private; in cypress_set_absolute_mode() local
306 cytp->mode = (cytp->mode & ~CYTP_BIT_ABS_REL_MASK) in cypress_set_absolute_mode()
319 struct cytp_data *cytp = psmouse->private; in cypress_reset() local
321 cytp->mode = 0; in cypress_reset()
327 struct cytp_data *cytp) in cypress_set_input_params() argument
331 if (!cytp->tp_res_x || !cytp->tp_res_y) in cypress_set_input_params()
335 input_set_abs_params(input, ABS_X, 0, cytp->tp_max_abs_x, 0, 0); in cypress_set_input_params()
336 input_set_abs_params(input, ABS_Y, 0, cytp->tp_max_abs_y, 0, 0); in cypress_set_input_params()
338 cytp->tp_min_pressure, cytp->tp_max_pressure, 0, 0); in cypress_set_input_params()
342 input_set_abs_params(input, ABS_MT_POSITION_X, 0, cytp->tp_max_abs_x, 0, 0); in cypress_set_input_params()
343 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cytp->tp_max_abs_y, 0, 0); in cypress_set_input_params()
353 input_abs_set_res(input, ABS_X, cytp->tp_res_x); in cypress_set_input_params()
354 input_abs_set_res(input, ABS_Y, cytp->tp_res_y); in cypress_set_input_params()
356 input_abs_set_res(input, ABS_MT_POSITION_X, cytp->tp_res_x); in cypress_set_input_params()
357 input_abs_set_res(input, ABS_MT_POSITION_Y, cytp->tp_res_y); in cypress_set_input_params()
405 struct cytp_data *cytp, in cypress_parse_packet() argument
421 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) in cypress_parse_packet()
429 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) in cypress_parse_packet()
436 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) in cypress_parse_packet()
479 struct cytp_data *cytp = psmouse->private; in cypress_process_packet() local
486 cypress_parse_packet(psmouse, cytp, &report_data); in cypress_process_packet()
525 struct cytp_data *cytp = psmouse->private; in cypress_validate_byte() local
527 if (index < 0 || index > cytp->pkt_size) in cypress_validate_byte()
547 if ((cytp->mode & CYTP_BIT_ABS_REL_MASK) == 0) in cypress_validate_byte()
554 if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE) in cypress_validate_byte()
564 struct cytp_data *cytp = psmouse->private; in cypress_protocol_handler() local
566 if (psmouse->pktcnt >= cytp->pkt_size) { in cypress_protocol_handler()
576 struct cytp_data *cytp = psmouse->private; in cypress_set_rate() local
581 cytp->mode |= CYTP_BIT_HIGH_RATE; in cypress_set_rate()
584 cytp->mode &= ~CYTP_BIT_HIGH_RATE; in cypress_set_rate()
624 struct cytp_data *cytp; in cypress_init() local
627 cytp = kzalloc(sizeof(*cytp), GFP_KERNEL); in cypress_init()
628 if (!cytp) in cypress_init()
631 psmouse->private = cytp; in cypress_init()
648 error = cypress_set_input_params(psmouse->dev, cytp); in cypress_init()
672 kfree(cytp); in cypress_init()