H A D | cypress_ps2.c | 34 struct cytp_data *cytp = psmouse->private; cypress_set_packet_size() local 35 cytp->pkt_size = n; cypress_set_packet_size() 225 struct cytp_data *cytp = psmouse->private; cypress_read_fw_version() local 235 cytp->fw_version = param[2] & FW_VERSION_MASX; cypress_read_fw_version() 236 cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; cypress_read_fw_version() 242 if (cytp->fw_version >= 11) cypress_read_fw_version() 243 cytp->tp_metrics_supported = 0; cypress_read_fw_version() 245 psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); cypress_read_fw_version() 246 psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", cypress_read_fw_version() 247 cytp->tp_metrics_supported); cypress_read_fw_version() 254 struct cytp_data *cytp = psmouse->private; cypress_read_tp_metrics() local 258 cytp->tp_width = CYTP_DEFAULT_WIDTH; cypress_read_tp_metrics() 259 cytp->tp_high = CYTP_DEFAULT_HIGH; cypress_read_tp_metrics() 260 cytp->tp_max_abs_x = CYTP_ABS_MAX_X; cypress_read_tp_metrics() 261 cytp->tp_max_abs_y = CYTP_ABS_MAX_Y; cypress_read_tp_metrics() 262 cytp->tp_min_pressure = CYTP_MIN_PRESSURE; cypress_read_tp_metrics() 263 cytp->tp_max_pressure = CYTP_MAX_PRESSURE; cypress_read_tp_metrics() 264 cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; cypress_read_tp_metrics() 265 cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; cypress_read_tp_metrics() 267 if (!cytp->tp_metrics_supported) cypress_read_tp_metrics() 273 cytp->tp_max_abs_x = (param[1] << 8) | param[0]; cypress_read_tp_metrics() 274 cytp->tp_max_abs_y = (param[3] << 8) | param[2]; cypress_read_tp_metrics() 275 cytp->tp_min_pressure = param[4]; cypress_read_tp_metrics() 276 cytp->tp_max_pressure = param[5]; cypress_read_tp_metrics() 279 if (!cytp->tp_max_pressure || cypress_read_tp_metrics() 280 cytp->tp_max_pressure < cytp->tp_min_pressure || cypress_read_tp_metrics() 281 !cytp->tp_width || !cytp->tp_high || cypress_read_tp_metrics() 282 !cytp->tp_max_abs_x || cypress_read_tp_metrics() 283 cytp->tp_max_abs_x < cytp->tp_width || cypress_read_tp_metrics() 284 !cytp->tp_max_abs_y || cypress_read_tp_metrics() 285 cytp->tp_max_abs_y < cytp->tp_high) cypress_read_tp_metrics() 288 cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; cypress_read_tp_metrics() 289 cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; cypress_read_tp_metrics() 293 psmouse_dbg(psmouse, "cytp->tp_width = %d\n", cytp->tp_width); cypress_read_tp_metrics() 294 psmouse_dbg(psmouse, "cytp->tp_high = %d\n", cytp->tp_high); cypress_read_tp_metrics() 295 psmouse_dbg(psmouse, "cytp->tp_max_abs_x = %d\n", cytp->tp_max_abs_x); cypress_read_tp_metrics() 296 psmouse_dbg(psmouse, "cytp->tp_max_abs_y = %d\n", cytp->tp_max_abs_y); cypress_read_tp_metrics() 297 psmouse_dbg(psmouse, "cytp->tp_min_pressure = %d\n", cytp->tp_min_pressure); cypress_read_tp_metrics() 298 psmouse_dbg(psmouse, "cytp->tp_max_pressure = %d\n", cytp->tp_max_pressure); cypress_read_tp_metrics() 299 psmouse_dbg(psmouse, "cytp->tp_res_x = %d\n", cytp->tp_res_x); cypress_read_tp_metrics() 300 psmouse_dbg(psmouse, "cytp->tp_res_y = %d\n", cytp->tp_res_y); cypress_read_tp_metrics() 342 struct cytp_data *cytp = psmouse->private; cypress_set_absolute_mode() local 348 cytp->mode = (cytp->mode & ~CYTP_BIT_ABS_REL_MASK) cypress_set_absolute_mode() 361 struct cytp_data *cytp = psmouse->private; cypress_reset() local 363 cytp->mode = 0; cypress_reset() 369 struct cytp_data *cytp) cypress_set_input_params() 373 if (!cytp->tp_res_x || !cytp->tp_res_y) cypress_set_input_params() 377 input_set_abs_params(input, ABS_X, 0, cytp->tp_max_abs_x, 0, 0); cypress_set_input_params() 378 input_set_abs_params(input, ABS_Y, 0, cytp->tp_max_abs_y, 0, 0); cypress_set_input_params() 380 cytp->tp_min_pressure, cytp->tp_max_pressure, 0, 0); cypress_set_input_params() 384 input_set_abs_params(input, ABS_MT_POSITION_X, 0, cytp->tp_max_abs_x, 0, 0); cypress_set_input_params() 385 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cytp->tp_max_abs_y, 0, 0); cypress_set_input_params() 395 input_abs_set_res(input, ABS_X, cytp->tp_res_x); cypress_set_input_params() 396 input_abs_set_res(input, ABS_Y, cytp->tp_res_y); cypress_set_input_params() 398 input_abs_set_res(input, ABS_MT_POSITION_X, cytp->tp_res_x); cypress_set_input_params() 399 input_abs_set_res(input, ABS_MT_POSITION_Y, cytp->tp_res_y); cypress_set_input_params() 417 input_set_drvdata(input, cytp); cypress_set_input_params() 449 struct cytp_data *cytp, struct cytp_report_data *report_data) cypress_parse_packet() 464 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) cypress_parse_packet() 472 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) cypress_parse_packet() 479 if (cytp->mode & CYTP_BIT_ABS_PRESSURE) cypress_parse_packet() 522 struct cytp_data *cytp = psmouse->private; cypress_process_packet() local 529 cypress_parse_packet(psmouse, cytp, &report_data); cypress_process_packet() 568 struct cytp_data *cytp = psmouse->private; cypress_validate_byte() local 570 if (index < 0 || index > cytp->pkt_size) cypress_validate_byte() 590 if ((cytp->mode & CYTP_BIT_ABS_REL_MASK) == 0) cypress_validate_byte() 597 if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE) cypress_validate_byte() 607 struct cytp_data *cytp = psmouse->private; cypress_protocol_handler() local 609 if (psmouse->pktcnt >= cytp->pkt_size) { cypress_protocol_handler() 619 struct cytp_data *cytp = psmouse->private; cypress_set_rate() local 623 cytp->mode |= CYTP_BIT_HIGH_RATE; cypress_set_rate() 626 cytp->mode &= ~CYTP_BIT_HIGH_RATE; cypress_set_rate() 665 struct cytp_data *cytp; cypress_init() local 667 cytp = kzalloc(sizeof(struct cytp_data), GFP_KERNEL); cypress_init() 668 if (!cytp) cypress_init() 671 psmouse->private = cytp; cypress_init() 686 if (cypress_set_input_params(psmouse->dev, cytp) < 0) { cypress_init() 709 kfree(cytp); cypress_init() 368 cypress_set_input_params(struct input_dev *input, struct cytp_data *cytp) cypress_set_input_params() argument 448 cypress_parse_packet(struct psmouse *psmouse, struct cytp_data *cytp, struct cytp_report_data *report_data) cypress_parse_packet() argument
|