Lines Matching +full:motion +full:- +full:sensors

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2011-2015 Synaptics Incorporated
42 * by parsing that sensors query registers.
46 * sensors data registers must be determined by parsing its query registers.
181 * struct f11_2d_sensor_queries - describes sensor capabilities
185 * @nr_fingers: describes the maximum number of fingers the 2-D sensor
187 * @has_rel: the sensor supports relative motion reporting.
193 * @nr_x_electrodes: the maximum number of electrodes the 2-D sensor
195 * @nr_y_electrodes: the maximum number of electrodes the 2-D sensor
205 * @has_anchored_finger: then the sensor supports the high-precision second
206 * finger tracking provided by the manual tracking and motion sensitivity
224 * @has_single_tap: a basic single-tap gesture is supported.
225 * @has_tap_n_hold: tap-and-hold gesture is supported.
226 * @has_double_tap: double-tap gesture is supported.
229 * tap or as the first tap of a double-tap or tap-and-hold gesture.
234 * @has_palm_det: the 2-D sensor notifies the host whenever a large conductive
235 * object such as a palm or a cheek touches the 2-D sensor.
244 * @has_mf_edge_motion: indicates whether multi-finger edge motion gesture
246 * @has_mf_scroll_inertia: indicates whether multi-finger scroll inertia
430 /* Query 15 - 18 */
486 * @f_state - start of finger state registers.
487 * @abs_pos - start of absolute position registers (if present).
488 * @rel_pos - start of relative data registers (if present).
489 * @gest_1 - gesture flags (if present).
490 * @gest_2 - gesture flags & finger count (if present).
491 * @pinch - pinch motion register (if present).
492 * @flick - flick distance X & Y, flick time (if present).
493 * @rotate - rotate motion and finger separation.
494 * @multi_scroll - chiral deltas for X and Y (if present).
495 * @scroll_zones - scroll deltas for 4 regions (if present).
511 /** Data pertaining to F11 in general. For per-sensor data, see struct
514 * @dev_query - F11 device specific query registers.
515 * @dev_controls - F11 device specific control registers.
516 * @dev_controls_mutex - lock for the control registers.
517 * @rezero_wait_ms - if nonzero, upon resume we will wait this many
521 * @sensors - per sensor data structures.
550 struct rmi_2d_sensor *sensor = &f11->sensor; in rmi_f11_rel_pos_report()
551 struct f11_2d_data *data = &f11->data; in rmi_f11_rel_pos_report()
554 x = data->rel_pos[n_finger * RMI_F11_REL_BYTES]; in rmi_f11_rel_pos_report()
555 y = data->rel_pos[n_finger * RMI_F11_REL_BYTES + 1]; in rmi_f11_rel_pos_report()
566 struct f11_2d_data *data = &f11->data; in rmi_f11_abs_pos_process()
567 u8 *pos_data = &data->abs_pos[n_finger * RMI_F11_ABS_BYTES]; in rmi_f11_abs_pos_process()
572 obj->type = RMI_2D_OBJECT_FINGER; in rmi_f11_abs_pos_process()
575 obj->type = RMI_2D_OBJECT_NONE; in rmi_f11_abs_pos_process()
578 obj->mt_tool = tool_type; in rmi_f11_abs_pos_process()
579 obj->x = (pos_data[0] << 4) | (pos_data[2] & 0x0F); in rmi_f11_abs_pos_process()
580 obj->y = (pos_data[1] << 4) | (pos_data[2] >> 4); in rmi_f11_abs_pos_process()
581 obj->z = pos_data[4]; in rmi_f11_abs_pos_process()
582 obj->wx = pos_data[3] & 0x0f; in rmi_f11_abs_pos_process()
583 obj->wy = pos_data[3] >> 4; in rmi_f11_abs_pos_process()
597 const u8 *f_state = f11->data.f_state; in rmi_f11_finger_handler()
602 int abs_size = sensor->nbr_fingers * RMI_F11_ABS_BYTES; in rmi_f11_finger_handler()
604 if (sensor->report_abs) { in rmi_f11_finger_handler()
608 abs_fingers = sensor->nbr_fingers; in rmi_f11_finger_handler()
619 rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i], in rmi_f11_finger_handler()
627 if (sensor->kernel_tracking) in rmi_f11_finger_handler()
628 input_mt_assign_slots(sensor->input, in rmi_f11_finger_handler()
629 sensor->tracking_slots, in rmi_f11_finger_handler()
630 sensor->tracking_pos, in rmi_f11_finger_handler()
631 sensor->nbr_fingers, in rmi_f11_finger_handler()
632 sensor->dmax); in rmi_f11_finger_handler()
640 rmi_2d_sensor_abs_report(sensor, &sensor->objs[i], i); in rmi_f11_finger_handler()
643 input_mt_sync_frame(sensor->input); in rmi_f11_finger_handler()
644 } else if (sensor->report_rel) { in rmi_f11_finger_handler()
645 if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size) in rmi_f11_finger_handler()
646 rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES; in rmi_f11_finger_handler()
648 rel_fingers = sensor->nbr_fingers; in rmi_f11_finger_handler()
658 struct rmi_2d_sensor *sensor = &f11->sensor; in f11_2d_construct_data()
659 struct f11_2d_sensor_queries *query = &f11->sens_query; in f11_2d_construct_data()
660 struct f11_2d_data *data = &f11->data; in f11_2d_construct_data()
663 sensor->nbr_fingers = (query->nr_fingers == 5 ? 10 : in f11_2d_construct_data()
664 query->nr_fingers + 1); in f11_2d_construct_data()
666 sensor->pkt_size = DIV_ROUND_UP(sensor->nbr_fingers, 4); in f11_2d_construct_data()
668 if (query->has_abs) { in f11_2d_construct_data()
669 sensor->pkt_size += (sensor->nbr_fingers * 5); in f11_2d_construct_data()
670 sensor->attn_size = sensor->pkt_size; in f11_2d_construct_data()
673 if (query->has_rel) in f11_2d_construct_data()
674 sensor->pkt_size += (sensor->nbr_fingers * 2); in f11_2d_construct_data()
676 /* Check if F11_2D_Query7 is non-zero */ in f11_2d_construct_data()
677 if (query->query7_nonzero) in f11_2d_construct_data()
678 sensor->pkt_size += sizeof(u8); in f11_2d_construct_data()
680 /* Check if F11_2D_Query7 or F11_2D_Query8 is non-zero */ in f11_2d_construct_data()
681 if (query->query7_nonzero || query->query8_nonzero) in f11_2d_construct_data()
682 sensor->pkt_size += sizeof(u8); in f11_2d_construct_data()
684 if (query->has_pinch || query->has_flick || query->has_rotate) { in f11_2d_construct_data()
685 sensor->pkt_size += 3; in f11_2d_construct_data()
686 if (!query->has_flick) in f11_2d_construct_data()
687 sensor->pkt_size--; in f11_2d_construct_data()
688 if (!query->has_rotate) in f11_2d_construct_data()
689 sensor->pkt_size--; in f11_2d_construct_data()
692 if (query->has_touch_shapes) in f11_2d_construct_data()
693 sensor->pkt_size += in f11_2d_construct_data()
694 DIV_ROUND_UP(query->nr_touch_shapes + 1, 8); in f11_2d_construct_data()
696 sensor->data_pkt = devm_kzalloc(&sensor->fn->dev, sensor->pkt_size, in f11_2d_construct_data()
698 if (!sensor->data_pkt) in f11_2d_construct_data()
699 return -ENOMEM; in f11_2d_construct_data()
701 data->f_state = sensor->data_pkt; in f11_2d_construct_data()
702 i = DIV_ROUND_UP(sensor->nbr_fingers, 4); in f11_2d_construct_data()
704 if (query->has_abs) { in f11_2d_construct_data()
705 data->abs_pos = &sensor->data_pkt[i]; in f11_2d_construct_data()
706 i += (sensor->nbr_fingers * RMI_F11_ABS_BYTES); in f11_2d_construct_data()
709 if (query->has_rel) { in f11_2d_construct_data()
710 data->rel_pos = &sensor->data_pkt[i]; in f11_2d_construct_data()
711 i += (sensor->nbr_fingers * RMI_F11_REL_BYTES); in f11_2d_construct_data()
714 if (query->query7_nonzero) { in f11_2d_construct_data()
715 data->gest_1 = &sensor->data_pkt[i]; in f11_2d_construct_data()
719 if (query->query7_nonzero || query->query8_nonzero) { in f11_2d_construct_data()
720 data->gest_2 = &sensor->data_pkt[i]; in f11_2d_construct_data()
724 if (query->has_pinch) { in f11_2d_construct_data()
725 data->pinch = &sensor->data_pkt[i]; in f11_2d_construct_data()
729 if (query->has_flick) { in f11_2d_construct_data()
730 if (query->has_pinch) { in f11_2d_construct_data()
731 data->flick = data->pinch; in f11_2d_construct_data()
734 data->flick = &sensor->data_pkt[i]; in f11_2d_construct_data()
739 if (query->has_rotate) { in f11_2d_construct_data()
740 if (query->has_flick) { in f11_2d_construct_data()
741 data->rotate = data->flick + 1; in f11_2d_construct_data()
743 data->rotate = &sensor->data_pkt[i]; in f11_2d_construct_data()
748 if (query->has_touch_shapes) in f11_2d_construct_data()
749 data->shapes = &sensor->data_pkt[i]; in f11_2d_construct_data()
756 struct rmi_device *rmi_dev = fn->rmi_dev; in f11_read_control_regs()
759 ctrl->ctrl0_11_address = ctrl_base_addr; in f11_read_control_regs()
760 error = rmi_read_block(rmi_dev, ctrl_base_addr, ctrl->ctrl0_11, in f11_read_control_regs()
763 dev_err(&fn->dev, "Failed to read ctrl0, code: %d.\n", error); in f11_read_control_regs()
775 struct rmi_device *rmi_dev = fn->rmi_dev; in f11_write_control_regs()
778 error = rmi_write_block(rmi_dev, ctrl_base_addr, ctrl->ctrl0_11, in f11_write_control_regs()
801 sensor_query->nr_fingers = query_buf[0] & RMI_F11_NR_FINGERS_MASK; in rmi_f11_get_query_parameters()
802 sensor_query->has_rel = !!(query_buf[0] & RMI_F11_HAS_REL); in rmi_f11_get_query_parameters()
803 sensor_query->has_abs = !!(query_buf[0] & RMI_F11_HAS_ABS); in rmi_f11_get_query_parameters()
804 sensor_query->has_gestures = !!(query_buf[0] & RMI_F11_HAS_GESTURES); in rmi_f11_get_query_parameters()
805 sensor_query->has_sensitivity_adjust = in rmi_f11_get_query_parameters()
807 sensor_query->configurable = !!(query_buf[0] & RMI_F11_CONFIGURABLE); in rmi_f11_get_query_parameters()
809 sensor_query->nr_x_electrodes = in rmi_f11_get_query_parameters()
811 sensor_query->nr_y_electrodes = in rmi_f11_get_query_parameters()
813 sensor_query->max_electrodes = in rmi_f11_get_query_parameters()
818 if (sensor_query->has_abs) { in rmi_f11_get_query_parameters()
823 sensor_query->abs_data_size = in rmi_f11_get_query_parameters()
825 sensor_query->has_anchored_finger = in rmi_f11_get_query_parameters()
827 sensor_query->has_adj_hyst = in rmi_f11_get_query_parameters()
829 sensor_query->has_dribble = in rmi_f11_get_query_parameters()
831 sensor_query->has_bending_correction = in rmi_f11_get_query_parameters()
833 sensor_query->has_large_object_suppression = in rmi_f11_get_query_parameters()
835 sensor_query->has_jitter_filter = in rmi_f11_get_query_parameters()
840 if (sensor_query->has_rel) { in rmi_f11_get_query_parameters()
842 &sensor_query->f11_2d_query6); in rmi_f11_get_query_parameters()
848 if (sensor_query->has_gestures) { in rmi_f11_get_query_parameters()
854 sensor_query->has_single_tap = in rmi_f11_get_query_parameters()
856 sensor_query->has_tap_n_hold = in rmi_f11_get_query_parameters()
858 sensor_query->has_double_tap = in rmi_f11_get_query_parameters()
860 sensor_query->has_early_tap = in rmi_f11_get_query_parameters()
862 sensor_query->has_flick = in rmi_f11_get_query_parameters()
864 sensor_query->has_press = in rmi_f11_get_query_parameters()
866 sensor_query->has_pinch = in rmi_f11_get_query_parameters()
868 sensor_query->has_chiral = in rmi_f11_get_query_parameters()
872 sensor_query->has_palm_det = in rmi_f11_get_query_parameters()
874 sensor_query->has_rotate = in rmi_f11_get_query_parameters()
876 sensor_query->has_touch_shapes = in rmi_f11_get_query_parameters()
878 sensor_query->has_scroll_zones = in rmi_f11_get_query_parameters()
880 sensor_query->has_individual_scroll_zones = in rmi_f11_get_query_parameters()
882 sensor_query->has_mf_scroll = in rmi_f11_get_query_parameters()
884 sensor_query->has_mf_edge_motion = in rmi_f11_get_query_parameters()
886 sensor_query->has_mf_scroll_inertia = in rmi_f11_get_query_parameters()
889 sensor_query->query7_nonzero = !!(query_buf[0]); in rmi_f11_get_query_parameters()
890 sensor_query->query8_nonzero = !!(query_buf[1]); in rmi_f11_get_query_parameters()
895 if (f11->has_query9) { in rmi_f11_get_query_parameters()
900 sensor_query->has_pen = in rmi_f11_get_query_parameters()
902 sensor_query->has_proximity = in rmi_f11_get_query_parameters()
904 sensor_query->has_palm_det_sensitivity = in rmi_f11_get_query_parameters()
906 sensor_query->has_suppress_on_palm_detect = in rmi_f11_get_query_parameters()
908 sensor_query->has_two_pen_thresholds = in rmi_f11_get_query_parameters()
910 sensor_query->has_contact_geometry = in rmi_f11_get_query_parameters()
912 sensor_query->has_pen_hover_discrimination = in rmi_f11_get_query_parameters()
914 sensor_query->has_pen_filters = in rmi_f11_get_query_parameters()
920 if (sensor_query->has_touch_shapes) { in rmi_f11_get_query_parameters()
925 sensor_query->nr_touch_shapes = query_buf[0] & in rmi_f11_get_query_parameters()
931 if (f11->has_query11) { in rmi_f11_get_query_parameters()
936 sensor_query->has_z_tuning = in rmi_f11_get_query_parameters()
938 sensor_query->has_algorithm_selection = in rmi_f11_get_query_parameters()
940 sensor_query->has_w_tuning = in rmi_f11_get_query_parameters()
942 sensor_query->has_pitch_info = in rmi_f11_get_query_parameters()
944 sensor_query->has_finger_size = in rmi_f11_get_query_parameters()
946 sensor_query->has_segmentation_aggressiveness = in rmi_f11_get_query_parameters()
949 sensor_query->has_XY_clip = in rmi_f11_get_query_parameters()
951 sensor_query->has_drumming_filter = in rmi_f11_get_query_parameters()
957 if (f11->has_query12) { in rmi_f11_get_query_parameters()
962 sensor_query->has_gapless_finger = in rmi_f11_get_query_parameters()
964 sensor_query->has_gapless_finger_tuning = in rmi_f11_get_query_parameters()
966 sensor_query->has_8bit_w = in rmi_f11_get_query_parameters()
968 sensor_query->has_adjustable_mapping = in rmi_f11_get_query_parameters()
970 sensor_query->has_info2 = in rmi_f11_get_query_parameters()
972 sensor_query->has_physical_props = in rmi_f11_get_query_parameters()
974 sensor_query->has_finger_limit = in rmi_f11_get_query_parameters()
976 sensor_query->has_linear_coeff_2 = in rmi_f11_get_query_parameters()
982 if (sensor_query->has_jitter_filter) { in rmi_f11_get_query_parameters()
987 sensor_query->jitter_window_size = query_buf[0] & in rmi_f11_get_query_parameters()
989 sensor_query->jitter_filter_type = (query_buf[0] & in rmi_f11_get_query_parameters()
996 if (sensor_query->has_info2) { in rmi_f11_get_query_parameters()
1001 sensor_query->light_control = in rmi_f11_get_query_parameters()
1003 sensor_query->is_clear = in rmi_f11_get_query_parameters()
1005 sensor_query->clickpad_props = in rmi_f11_get_query_parameters()
1008 sensor_query->mouse_buttons = in rmi_f11_get_query_parameters()
1011 sensor_query->has_advanced_gestures = in rmi_f11_get_query_parameters()
1017 if (sensor_query->has_physical_props) { in rmi_f11_get_query_parameters()
1023 sensor_query->x_sensor_size_mm = in rmi_f11_get_query_parameters()
1025 sensor_query->y_sensor_size_mm = in rmi_f11_get_query_parameters()
1029 * query 15 - 18 contain the size of the sensor in rmi_f11_get_query_parameters()
1030 * and query 19 - 26 contain bezel dimensions in rmi_f11_get_query_parameters()
1035 if (f11->has_query27) in rmi_f11_get_query_parameters()
1038 if (f11->has_query28) { in rmi_f11_get_query_parameters()
1055 f11->has_acm = true; in rmi_f11_get_query_parameters()
1063 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f11_initialize()
1073 struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); in rmi_f11_initialize()
1078 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "Initializing F11 values.\n"); in rmi_f11_initialize()
1080 mask_size = BITS_TO_LONGS(drvdata->irq_count) * sizeof(unsigned long); in rmi_f11_initialize()
1085 f11 = devm_kzalloc(&fn->dev, sizeof(struct f11_data) + mask_size * 2, in rmi_f11_initialize()
1088 return -ENOMEM; in rmi_f11_initialize()
1090 if (fn->dev.of_node) { in rmi_f11_initialize()
1091 rc = rmi_2d_sensor_of_probe(&fn->dev, &f11->sensor_pdata); in rmi_f11_initialize()
1095 f11->sensor_pdata = pdata->sensor_pdata; in rmi_f11_initialize()
1098 f11->rezero_wait_ms = f11->sensor_pdata.rezero_wait; in rmi_f11_initialize()
1100 f11->abs_mask = (unsigned long *)((char *)f11 in rmi_f11_initialize()
1102 f11->rel_mask = (unsigned long *)((char *)f11 in rmi_f11_initialize()
1105 set_bit(fn->irq_pos, f11->abs_mask); in rmi_f11_initialize()
1106 set_bit(fn->irq_pos + 1, f11->rel_mask); in rmi_f11_initialize()
1108 query_base_addr = fn->fd.query_base_addr; in rmi_f11_initialize()
1109 control_base_addr = fn->fd.control_base_addr; in rmi_f11_initialize()
1115 f11->has_query9 = !!(buf & RMI_F11_HAS_QUERY9); in rmi_f11_initialize()
1116 f11->has_query11 = !!(buf & RMI_F11_HAS_QUERY11); in rmi_f11_initialize()
1117 f11->has_query12 = !!(buf & RMI_F11_HAS_QUERY12); in rmi_f11_initialize()
1118 f11->has_query27 = !!(buf & RMI_F11_HAS_QUERY27); in rmi_f11_initialize()
1119 f11->has_query28 = !!(buf & RMI_F11_HAS_QUERY28); in rmi_f11_initialize()
1122 sensor = &f11->sensor; in rmi_f11_initialize()
1123 sensor->fn = fn; in rmi_f11_initialize()
1126 &f11->sens_query, query_offset); in rmi_f11_initialize()
1131 rc = f11_read_control_regs(fn, &f11->dev_controls, in rmi_f11_initialize()
1134 dev_err(&fn->dev, in rmi_f11_initialize()
1139 if (f11->sens_query.has_info2) { in rmi_f11_initialize()
1140 if (f11->sens_query.is_clear) in rmi_f11_initialize()
1141 f11->sensor.sensor_type = rmi_sensor_touchscreen; in rmi_f11_initialize()
1143 f11->sensor.sensor_type = rmi_sensor_touchpad; in rmi_f11_initialize()
1146 sensor->report_abs = f11->sens_query.has_abs; in rmi_f11_initialize()
1148 sensor->axis_align = in rmi_f11_initialize()
1149 f11->sensor_pdata.axis_align; in rmi_f11_initialize()
1151 sensor->topbuttonpad = f11->sensor_pdata.topbuttonpad; in rmi_f11_initialize()
1152 sensor->kernel_tracking = f11->sensor_pdata.kernel_tracking; in rmi_f11_initialize()
1153 sensor->dmax = f11->sensor_pdata.dmax; in rmi_f11_initialize()
1154 sensor->dribble = f11->sensor_pdata.dribble; in rmi_f11_initialize()
1155 sensor->palm_detect = f11->sensor_pdata.palm_detect; in rmi_f11_initialize()
1157 if (f11->sens_query.has_physical_props) { in rmi_f11_initialize()
1158 sensor->x_mm = f11->sens_query.x_sensor_size_mm; in rmi_f11_initialize()
1159 sensor->y_mm = f11->sens_query.y_sensor_size_mm; in rmi_f11_initialize()
1161 sensor->x_mm = f11->sensor_pdata.x_mm; in rmi_f11_initialize()
1162 sensor->y_mm = f11->sensor_pdata.y_mm; in rmi_f11_initialize()
1165 if (sensor->sensor_type == rmi_sensor_default) in rmi_f11_initialize()
1166 sensor->sensor_type = in rmi_f11_initialize()
1167 f11->sensor_pdata.sensor_type; in rmi_f11_initialize()
1169 sensor->report_abs = sensor->report_abs in rmi_f11_initialize()
1170 && !(f11->sensor_pdata.disable_report_mask in rmi_f11_initialize()
1173 if (!sensor->report_abs) in rmi_f11_initialize()
1178 sensor->report_rel = f11->sens_query.has_rel; in rmi_f11_initialize()
1192 sensor->max_x = max_x_pos; in rmi_f11_initialize()
1193 sensor->max_y = max_y_pos; in rmi_f11_initialize()
1199 if (f11->has_acm) in rmi_f11_initialize()
1200 f11->sensor.attn_size += f11->sensor.nbr_fingers * 2; in rmi_f11_initialize()
1202 /* allocate the in-kernel tracking buffers */ in rmi_f11_initialize()
1203 sensor->tracking_pos = devm_kcalloc(&fn->dev, in rmi_f11_initialize()
1204 sensor->nbr_fingers, sizeof(struct input_mt_pos), in rmi_f11_initialize()
1206 sensor->tracking_slots = devm_kcalloc(&fn->dev, in rmi_f11_initialize()
1207 sensor->nbr_fingers, sizeof(int), GFP_KERNEL); in rmi_f11_initialize()
1208 sensor->objs = devm_kcalloc(&fn->dev, in rmi_f11_initialize()
1209 sensor->nbr_fingers, in rmi_f11_initialize()
1212 if (!sensor->tracking_pos || !sensor->tracking_slots || !sensor->objs) in rmi_f11_initialize()
1213 return -ENOMEM; in rmi_f11_initialize()
1215 ctrl = &f11->dev_controls; in rmi_f11_initialize()
1216 if (sensor->axis_align.delta_x_threshold) in rmi_f11_initialize()
1217 ctrl->ctrl0_11[RMI_F11_DELTA_X_THRESHOLD] = in rmi_f11_initialize()
1218 sensor->axis_align.delta_x_threshold; in rmi_f11_initialize()
1220 if (sensor->axis_align.delta_y_threshold) in rmi_f11_initialize()
1221 ctrl->ctrl0_11[RMI_F11_DELTA_Y_THRESHOLD] = in rmi_f11_initialize()
1222 sensor->axis_align.delta_y_threshold; in rmi_f11_initialize()
1228 if (sensor->axis_align.delta_x_threshold || in rmi_f11_initialize()
1229 sensor->axis_align.delta_y_threshold) { in rmi_f11_initialize()
1230 ctrl->ctrl0_11[0] &= ~RMI_F11_REPORT_MODE_MASK; in rmi_f11_initialize()
1231 ctrl->ctrl0_11[0] |= RMI_F11_REPORT_MODE_REDUCED; in rmi_f11_initialize()
1234 if (f11->sens_query.has_dribble) { in rmi_f11_initialize()
1235 switch (sensor->dribble) { in rmi_f11_initialize()
1237 ctrl->ctrl0_11[0] &= ~BIT(6); in rmi_f11_initialize()
1240 ctrl->ctrl0_11[0] |= BIT(6); in rmi_f11_initialize()
1248 if (f11->sens_query.has_palm_det) { in rmi_f11_initialize()
1249 switch (sensor->palm_detect) { in rmi_f11_initialize()
1251 ctrl->ctrl0_11[11] &= ~BIT(0); in rmi_f11_initialize()
1254 ctrl->ctrl0_11[11] |= BIT(0); in rmi_f11_initialize()
1262 rc = f11_write_control_regs(fn, &f11->sens_query, in rmi_f11_initialize()
1263 &f11->dev_controls, fn->fd.control_base_addr); in rmi_f11_initialize()
1265 dev_warn(&fn->dev, "Failed to write control registers\n"); in rmi_f11_initialize()
1267 mutex_init(&f11->dev_controls_mutex); in rmi_f11_initialize()
1269 dev_set_drvdata(&fn->dev, f11); in rmi_f11_initialize()
1276 struct f11_data *f11 = dev_get_drvdata(&fn->dev); in rmi_f11_config()
1277 struct rmi_driver *drv = fn->rmi_dev->driver; in rmi_f11_config()
1278 struct rmi_2d_sensor *sensor = &f11->sensor; in rmi_f11_config()
1281 if (!sensor->report_abs) in rmi_f11_config()
1282 drv->clear_irq_bits(fn->rmi_dev, f11->abs_mask); in rmi_f11_config()
1284 drv->set_irq_bits(fn->rmi_dev, f11->abs_mask); in rmi_f11_config()
1286 if (!sensor->report_rel) in rmi_f11_config()
1287 drv->clear_irq_bits(fn->rmi_dev, f11->rel_mask); in rmi_f11_config()
1289 drv->set_irq_bits(fn->rmi_dev, f11->rel_mask); in rmi_f11_config()
1291 rc = f11_write_control_regs(fn, &f11->sens_query, in rmi_f11_config()
1292 &f11->dev_controls, fn->fd.query_base_addr); in rmi_f11_config()
1302 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f11_attention()
1303 struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); in rmi_f11_attention()
1304 struct f11_data *f11 = dev_get_drvdata(&fn->dev); in rmi_f11_attention()
1305 u16 data_base_addr = fn->fd.data_base_addr; in rmi_f11_attention()
1307 int valid_bytes = f11->sensor.pkt_size; in rmi_f11_attention()
1309 if (drvdata->attn_data.data) { in rmi_f11_attention()
1314 if (f11->sensor.attn_size > drvdata->attn_data.size) in rmi_f11_attention()
1315 valid_bytes = drvdata->attn_data.size; in rmi_f11_attention()
1317 valid_bytes = f11->sensor.attn_size; in rmi_f11_attention()
1318 memcpy(f11->sensor.data_pkt, drvdata->attn_data.data, in rmi_f11_attention()
1320 drvdata->attn_data.data += valid_bytes; in rmi_f11_attention()
1321 drvdata->attn_data.size -= valid_bytes; in rmi_f11_attention()
1324 data_base_addr, f11->sensor.data_pkt, in rmi_f11_attention()
1325 f11->sensor.pkt_size); in rmi_f11_attention()
1330 rmi_f11_finger_handler(f11, &f11->sensor, valid_bytes); in rmi_f11_attention()
1337 struct f11_data *f11 = dev_get_drvdata(&fn->dev); in rmi_f11_resume()
1340 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "Resuming...\n"); in rmi_f11_resume()
1341 if (!f11->rezero_wait_ms) in rmi_f11_resume()
1344 mdelay(f11->rezero_wait_ms); in rmi_f11_resume()
1346 error = rmi_write(fn->rmi_dev, fn->fd.command_base_addr, in rmi_f11_resume()
1349 dev_err(&fn->dev, in rmi_f11_resume()
1367 f11 = dev_get_drvdata(&fn->dev); in rmi_f11_probe()
1368 error = rmi_2d_sensor_configure_input(fn, &f11->sensor); in rmi_f11_probe()