Lines Matching refs:wacom_wac
41 static void wacom_force_proxout(struct wacom_wac *wacom_wac) in wacom_force_proxout() argument
43 struct input_dev *input = wacom_wac->pen_input; in wacom_force_proxout()
45 wacom_wac->shared->stylus_in_proximity = 0; in wacom_force_proxout()
51 input_report_key(input, wacom_wac->tool[0], 0); in wacom_force_proxout()
52 if (wacom_wac->serial[0]) { in wacom_force_proxout()
57 wacom_wac->tool[0] = 0; in wacom_force_proxout()
58 wacom_wac->id[0] = 0; in wacom_force_proxout()
59 wacom_wac->serial[0] = 0; in wacom_force_proxout()
67 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_idleprox_timeout() local
69 if (!wacom_wac->hid_data.sense_state) { in wacom_idleprox_timeout()
74 wacom_force_proxout(wacom_wac); in wacom_idleprox_timeout()
111 static void wacom_notify_battery(struct wacom_wac *wacom_wac, in wacom_notify_battery() argument
115 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_notify_battery()
117 bool has_quirk = wacom_wac->features.quirks & WACOM_QUIRK_BATTERY; in wacom_notify_battery()
120 wacom_schedule_work(wacom_wac, WACOM_WORKER_BATTERY); in wacom_notify_battery()
126 static int wacom_penpartner_irq(struct wacom_wac *wacom) in wacom_penpartner_irq()
170 static int wacom_pl_irq(struct wacom_wac *wacom) in wacom_pl_irq()
231 static int wacom_ptu_irq(struct wacom_wac *wacom) in wacom_ptu_irq()
260 static int wacom_dtu_irq(struct wacom_wac *wacom) in wacom_dtu_irq()
290 static int wacom_dtus_irq(struct wacom_wac *wacom) in wacom_dtus_irq()
341 static int wacom_graphire_irq(struct wacom_wac *wacom) in wacom_graphire_irq()
496 static void wacom_intuos_schedule_prox_event(struct wacom_wac *wacom_wac) in wacom_intuos_schedule_prox_event() argument
498 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_intuos_schedule_prox_event()
499 struct wacom_features *features = &wacom_wac->features; in wacom_intuos_schedule_prox_event()
513 static int wacom_intuos_pad(struct wacom_wac *wacom) in wacom_intuos_pad()
733 static void wacom_exit_report(struct wacom_wac *wacom) in wacom_exit_report()
772 static int wacom_intuos_inout(struct wacom_wac *wacom) in wacom_intuos_inout()
831 static inline bool touch_is_muted(struct wacom_wac *wacom_wac) in touch_is_muted() argument
833 return wacom_wac->probe_complete && in touch_is_muted()
834 wacom_wac->shared->has_mute_touch_switch && in touch_is_muted()
835 !wacom_wac->shared->is_touch_on; in touch_is_muted()
838 static inline bool report_touch_events(struct wacom_wac *wacom) in report_touch_events()
843 static inline bool delay_pen_events(struct wacom_wac *wacom) in delay_pen_events()
848 static int wacom_intuos_general(struct wacom_wac *wacom) in wacom_intuos_general()
1021 static int wacom_intuos_irq(struct wacom_wac *wacom) in wacom_intuos_irq()
1058 static int wacom_remote_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_remote_irq() argument
1060 unsigned char *data = wacom_wac->data; in wacom_remote_irq()
1062 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_remote_irq()
1076 wacom_wac->id[0] = PAD_DEVICE_ID; in wacom_remote_irq()
1148 static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_remote_status_irq() argument
1150 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_remote_status_irq()
1151 unsigned char *data = wacom_wac->data; in wacom_remote_status_irq()
1180 wacom_schedule_work(wacom_wac, WACOM_WORKER_REMOTE); in wacom_remote_status_irq()
1191 static void wacom_intuos_bt_process_data(struct wacom_wac *wacom, in wacom_intuos_bt_process_data()
1202 static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) in wacom_intuos_bt_irq()
1238 static int wacom_wac_finger_count_touches(struct wacom_wac *wacom) in wacom_wac_finger_count_touches()
1262 static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_pen()
1395 static void wacom_intuos_pro2_bt_touch(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_touch()
1462 static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_pad()
1492 static void wacom_intuos_pro2_bt_battery(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_battery()
1503 static void wacom_intuos_gen3_bt_pad(struct wacom_wac *wacom) in wacom_intuos_gen3_bt_pad()
1519 static void wacom_intuos_gen3_bt_battery(struct wacom_wac *wacom) in wacom_intuos_gen3_bt_battery()
1530 static int wacom_intuos_pro2_bt_irq(struct wacom_wac *wacom, size_t len) in wacom_intuos_pro2_bt_irq()
1553 static int wacom_24hdt_irq(struct wacom_wac *wacom) in wacom_24hdt_irq()
1624 static int wacom_mt_touch(struct wacom_wac *wacom) in wacom_mt_touch()
1675 static int wacom_tpc_mt_touch(struct wacom_wac *wacom) in wacom_tpc_mt_touch()
1703 static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len) in wacom_tpc_single_touch()
1739 static int wacom_tpc_pen(struct wacom_wac *wacom) in wacom_tpc_pen()
1769 static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) in wacom_tpc_irq()
1875 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_map_usage() local
1876 struct wacom_features *features = &wacom_wac->features; in wacom_map_usage()
1933 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_battery_event() local
1939 wacom_wac->hid_data.bat_status = POWER_SUPPLY_STATUS_UNKNOWN; in wacom_wac_battery_event()
1943 wacom_wac->hid_data.battery_capacity = value; in wacom_wac_battery_event()
1944 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1945 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1947 wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; in wacom_wac_battery_event()
1951 wacom_wac->hid_data.battery_capacity = value; in wacom_wac_battery_event()
1952 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1953 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1954 wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; in wacom_wac_battery_event()
1957 wacom_wac->hid_data.bat_charging = value; in wacom_wac_battery_event()
1958 wacom_wac->hid_data.ps_connected = value; in wacom_wac_battery_event()
1959 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1960 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1961 wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; in wacom_wac_battery_event()
1976 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_battery_report() local
1978 int status = wacom_wac->hid_data.bat_status; in wacom_wac_battery_report()
1979 int capacity = wacom_wac->hid_data.battery_capacity; in wacom_wac_battery_report()
1980 bool charging = wacom_wac->hid_data.bat_charging; in wacom_wac_battery_report()
1981 bool connected = wacom_wac->hid_data.bat_connected; in wacom_wac_battery_report()
1982 bool powered = wacom_wac->hid_data.ps_connected; in wacom_wac_battery_report()
1984 wacom_notify_battery(wacom_wac, status, capacity, charging, in wacom_wac_battery_report()
1992 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_usage_mapping() local
1993 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pad_usage_mapping()
1994 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_usage_mapping()
2027 wacom_wac->is_soft_touch_switch = true; in wacom_wac_pad_usage_mapping()
2038 wacom_wac->has_mute_touch_switch = true; in wacom_wac_pad_usage_mapping()
2052 wacom_wac->relring_count++; in wacom_wac_pad_usage_mapping()
2053 if (wacom_wac->relring_count == 1) { in wacom_wac_pad_usage_mapping()
2057 else if (wacom_wac->relring_count == 2) { in wacom_wac_pad_usage_mapping()
2062 wacom_wac->absring_count++; in wacom_wac_pad_usage_mapping()
2063 if (wacom_wac->absring_count == 1) in wacom_wac_pad_usage_mapping()
2065 else if (wacom_wac->absring_count == 2) in wacom_wac_pad_usage_mapping()
2094 if (!wacom_wac->has_mode_change) { in wacom_wac_pad_usage_mapping()
2095 wacom_wac->has_mode_change = true; in wacom_wac_pad_usage_mapping()
2096 wacom_wac->is_direct_mode = true; in wacom_wac_pad_usage_mapping()
2117 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_event() local
2118 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_event()
2119 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pad_event()
2136 wacom_wac->hid_data.inrange_state |= value; in wacom_wac_pad_event()
2145 if (wacom_wac->shared->touch_input) { in wacom_wac_pad_event()
2146 bool *is_touch_on = &wacom_wac->shared->is_touch_on; in wacom_wac_pad_event()
2153 input_report_switch(wacom_wac->shared->touch_input, in wacom_wac_pad_event()
2155 input_sync(wacom_wac->shared->touch_input); in wacom_wac_pad_event()
2201 ring_value = &wacom_wac->hid_data.ring_value; in wacom_wac_pad_event()
2212 ring_value = &wacom_wac->hid_data.ring2_value; in wacom_wac_pad_event()
2245 if (wacom_wac->is_direct_mode != value) { in wacom_wac_pad_event()
2246 wacom_wac->is_direct_mode = value; in wacom_wac_pad_event()
2247 wacom_schedule_work(&wacom->wacom_wac, WACOM_WORKER_MODE_CHANGE); in wacom_wac_pad_event()
2264 wacom_wac->hid_data.pad_input_event_flag = true; in wacom_wac_pad_event()
2272 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_pre_report() local
2274 wacom_wac->hid_data.inrange_state = 0; in wacom_wac_pad_pre_report()
2281 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_report() local
2282 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_report()
2283 bool active = wacom_wac->hid_data.inrange_state != 0; in wacom_wac_pad_report()
2286 if (wacom_wac->hid_data.pad_input_event_flag) { in wacom_wac_pad_report()
2290 wacom_wac->hid_data.pad_input_event_flag = false; in wacom_wac_pad_report()
2294 static void wacom_set_barrel_switch3_usage(struct wacom_wac *wacom_wac) in wacom_set_barrel_switch3_usage() argument
2296 struct input_dev *input = wacom_wac->pen_input; in wacom_set_barrel_switch3_usage()
2297 struct wacom_features *features = &wacom_wac->features; in wacom_set_barrel_switch3_usage()
2300 wacom_wac->hid_data.barrelswitch && in wacom_set_barrel_switch3_usage()
2301 wacom_wac->hid_data.barrelswitch2 && in wacom_set_barrel_switch3_usage()
2302 wacom_wac->hid_data.serialhi && in wacom_set_barrel_switch3_usage()
2303 !wacom_wac->hid_data.barrelswitch3) { in wacom_set_barrel_switch3_usage()
2313 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_usage_mapping() local
2314 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pen_usage_mapping()
2315 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_usage_mapping()
2357 wacom_wac->hid_data.barrelswitch = true; in wacom_wac_pen_usage_mapping()
2358 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2362 wacom_wac->hid_data.barrelswitch2 = true; in wacom_wac_pen_usage_mapping()
2363 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2378 wacom_wac->hid_data.serialhi = true; in wacom_wac_pen_usage_mapping()
2379 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2387 wacom_wac->hid_data.barrelswitch3 = true; in wacom_wac_pen_usage_mapping()
2392 wacom_wac->hid_data.sequence_number = -1; in wacom_wac_pen_usage_mapping()
2401 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_event() local
2402 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pen_event()
2403 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_event()
2406 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_pen_event()
2420 wacom_wac->hid_data.inrange_state = value; in wacom_wac_pen_event()
2422 wacom_wac->hid_data.sense_state = value; in wacom_wac_pen_event()
2425 wacom_wac->hid_data.invert_state = value; in wacom_wac_pen_event()
2429 wacom_wac->hid_data.tipswitch |= value; in wacom_wac_pen_event()
2432 wacom_wac->hid_data.barrelswitch = value; in wacom_wac_pen_event()
2435 wacom_wac->hid_data.barrelswitch2 = value; in wacom_wac_pen_event()
2439 wacom_wac->serial[0] = (wacom_wac->serial[0] & ~0xFFFFFFFFULL); in wacom_wac_pen_event()
2440 wacom_wac->serial[0] |= wacom_s32tou(value, field->report_size); in wacom_wac_pen_event()
2445 if (!wacom_is_art_pen(wacom_wac->id[0])) return; in wacom_wac_pen_event()
2455 wacom_wac->hid_data.sense_state = value; in wacom_wac_pen_event()
2461 wacom_wac->serial[0] = (wacom_wac->serial[0] & 0xFFFFFFFF); in wacom_wac_pen_event()
2462 wacom_wac->serial[0] |= ((__u64)raw_value) << 32; in wacom_wac_pen_event()
2469 wacom_wac->id[0] |= raw_value & 0xFFFFF; in wacom_wac_pen_event()
2481 wacom_wac->id[0] |= wacom_s32tou(value, field->report_size); in wacom_wac_pen_event()
2512 wacom_wac->is_invalid_bt_frame = !value; in wacom_wac_pen_event()
2515 wacom_wac->hid_data.barrelswitch3 = value; in wacom_wac_pen_event()
2518 if (wacom_wac->hid_data.sequence_number != value && in wacom_wac_pen_event()
2519 wacom_wac->hid_data.sequence_number >= 0) { in wacom_wac_pen_event()
2521 int drop_count = (value - wacom_wac->hid_data.sequence_number) % sequence_size; in wacom_wac_pen_event()
2524 wacom_wac->hid_data.sequence_number = value + 1; in wacom_wac_pen_event()
2525 if (wacom_wac->hid_data.sequence_number > field->logical_maximum) in wacom_wac_pen_event()
2526 wacom_wac->hid_data.sequence_number = field->logical_minimum; in wacom_wac_pen_event()
2533 if (!usage->type || delay_pen_events(wacom_wac)) in wacom_wac_pen_event()
2537 if (wacom_wac->hid_data.inrange_state) in wacom_wac_pen_event()
2539 else if (wacom_wac->shared->stylus_in_proximity && !wacom_wac->hid_data.sense_state) in wacom_wac_pen_event()
2547 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_pre_report() local
2549 wacom_wac->is_invalid_bt_frame = false; in wacom_wac_pen_pre_report()
2557 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_report() local
2558 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_report()
2559 bool range = wacom_wac->hid_data.inrange_state; in wacom_wac_pen_report()
2560 bool sense = wacom_wac->hid_data.sense_state; in wacom_wac_pen_report()
2561 bool entering_range = !wacom_wac->tool[0] && range; in wacom_wac_pen_report()
2563 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_pen_report()
2568 if (wacom_wac->hid_data.invert_state) in wacom_wac_pen_report()
2569 wacom_wac->tool[0] = BTN_TOOL_RUBBER; in wacom_wac_pen_report()
2570 else if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN) in wacom_wac_pen_report()
2571 wacom_wac->tool[0] = BTN_TOOL_PEN; in wacom_wac_pen_report()
2572 else if (wacom_wac->id[0]) in wacom_wac_pen_report()
2573 wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]); in wacom_wac_pen_report()
2575 wacom_wac->tool[0] = BTN_TOOL_PEN; in wacom_wac_pen_report()
2579 wacom_wac->shared->stylus_in_proximity = sense; in wacom_wac_pen_report()
2581 if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) { in wacom_wac_pen_report()
2582 int id = wacom_wac->id[0]; in wacom_wac_pen_report()
2583 if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3) { in wacom_wac_pen_report()
2584 int sw_state = wacom_wac->hid_data.barrelswitch | in wacom_wac_pen_report()
2585 (wacom_wac->hid_data.barrelswitch2 << 1); in wacom_wac_pen_report()
2586 wacom_wac->hid_data.barrelswitch = sw_state == 1; in wacom_wac_pen_report()
2587 wacom_wac->hid_data.barrelswitch2 = sw_state == 2; in wacom_wac_pen_report()
2588 wacom_wac->hid_data.barrelswitch3 = sw_state == 3; in wacom_wac_pen_report()
2590 input_report_key(input, BTN_STYLUS, wacom_wac->hid_data.barrelswitch); in wacom_wac_pen_report()
2591 input_report_key(input, BTN_STYLUS2, wacom_wac->hid_data.barrelswitch2); in wacom_wac_pen_report()
2592 input_report_key(input, BTN_STYLUS3, wacom_wac->hid_data.barrelswitch3); in wacom_wac_pen_report()
2598 if (wacom_wac->serial[0] >> 52 == 1) in wacom_wac_pen_report()
2607 wacom_wac->hid_data.tipswitch); in wacom_wac_pen_report()
2608 input_report_key(input, wacom_wac->tool[0], sense); in wacom_wac_pen_report()
2609 if (wacom_wac->serial[0]) { in wacom_wac_pen_report()
2615 __u32 serial_lo = wacom_wac->serial[0] & 0xFFFFFFFFu; in wacom_wac_pen_report()
2616 __u32 serial_hi = wacom_wac->serial[0] >> 32; in wacom_wac_pen_report()
2621 wacom_wac->hid_data.tipswitch = false; in wacom_wac_pen_report()
2627 if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN) { in wacom_wac_pen_report()
2636 wacom_wac->tool[0] = 0; in wacom_wac_pen_report()
2637 wacom_wac->id[0] = 0; in wacom_wac_pen_report()
2638 wacom_wac->serial[0] = 0; in wacom_wac_pen_report()
2646 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_usage_mapping() local
2647 struct input_dev *input = wacom_wac->touch_input; in wacom_wac_finger_usage_mapping()
2648 unsigned touch_max = wacom_wac->features.touch_max; in wacom_wac_finger_usage_mapping()
2676 wacom_wac->hid_data.cc_report = field->report->id; in wacom_wac_finger_usage_mapping()
2677 wacom_wac->hid_data.cc_index = field->index; in wacom_wac_finger_usage_mapping()
2678 wacom_wac->hid_data.cc_value_index = usage->usage_index; in wacom_wac_finger_usage_mapping()
2696 static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac, in wacom_wac_finger_slot() argument
2699 struct hid_data *hid_data = &wacom_wac->hid_data; in wacom_wac_finger_slot()
2700 bool mt = wacom_wac->features.touch_max > 1; in wacom_wac_finger_slot()
2702 bool prox = touch_down && report_touch_events(wacom_wac); in wacom_wac_finger_slot()
2704 if (touch_is_muted(wacom_wac)) { in wacom_wac_finger_slot()
2705 if (!wacom_wac->shared->touch_down) in wacom_wac_finger_slot()
2710 wacom_wac->hid_data.num_received++; in wacom_wac_finger_slot()
2711 if (wacom_wac->hid_data.num_received > wacom_wac->hid_data.num_expected) in wacom_wac_finger_slot()
2756 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_event() local
2758 struct wacom_features *features = &wacom->wacom_wac.features; in wacom_wac_finger_event()
2760 if (touch_is_muted(wacom_wac) && !wacom_wac->shared->touch_down) in wacom_wac_finger_event()
2763 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_finger_event()
2768 wacom_wac->hid_data.confidence = value; in wacom_wac_finger_event()
2771 wacom_wac->hid_data.x = value; in wacom_wac_finger_event()
2774 wacom_wac->hid_data.y = value; in wacom_wac_finger_event()
2777 wacom_wac->hid_data.width = value; in wacom_wac_finger_event()
2780 wacom_wac->hid_data.height = value; in wacom_wac_finger_event()
2783 wacom_wac->hid_data.id = value; in wacom_wac_finger_event()
2786 wacom_wac->hid_data.tipswitch = value; in wacom_wac_finger_event()
2789 wacom_wac->is_invalid_bt_frame = !value; in wacom_wac_finger_event()
2802 if (equivalent_usage == wacom_wac->hid_data.last_slot_field) in wacom_wac_finger_event()
2803 wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input); in wacom_wac_finger_event()
2811 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_pre_report() local
2812 struct hid_data* hid_data = &wacom_wac->hid_data; in wacom_wac_finger_pre_report()
2815 if (touch_is_muted(wacom_wac) && !wacom_wac->shared->touch_down) in wacom_wac_finger_pre_report()
2818 wacom_wac->is_invalid_bt_frame = false; in wacom_wac_finger_pre_report()
2865 hid_data->num_expected = wacom_wac->features.touch_max; in wacom_wac_finger_pre_report()
2874 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_report() local
2875 struct input_dev *input = wacom_wac->touch_input; in wacom_wac_finger_report()
2876 unsigned touch_max = wacom_wac->features.touch_max; in wacom_wac_finger_report()
2879 if (wacom_wac->hid_data.num_expected == 0) in wacom_wac_finger_report()
2886 if (wacom_wac->hid_data.num_received < wacom_wac->hid_data.num_expected) in wacom_wac_finger_report()
2893 wacom_wac->hid_data.num_received = 0; in wacom_wac_finger_report()
2894 wacom_wac->hid_data.num_expected = 0; in wacom_wac_finger_report()
2897 wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(wacom_wac); in wacom_wac_finger_report()
2904 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_usage_mapping() local
2905 struct wacom_features *features = &wacom_wac->features; in wacom_wac_usage_mapping()
2926 if (wacom->wacom_wac.features.type != HID_GENERIC) in wacom_wac_event()
2937 else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) in wacom_wac_event()
2939 else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) in wacom_wac_event()
2989 else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) in wacom_wac_collection()
2991 else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) in wacom_wac_collection()
3000 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_report() local
3007 if (wacom_wac->features.type != HID_GENERIC) in wacom_wac_report()
3025 if (pad_in_hid_field && wacom_wac->pad_input) in wacom_wac_report()
3027 if (pen_in_hid_field && wacom_wac->pen_input) in wacom_wac_report()
3029 if (finger_in_hid_field && wacom_wac->touch_input) in wacom_wac_report()
3045 if (true_pad && wacom_wac->pad_input) in wacom_wac_report()
3049 static int wacom_bpt_touch(struct wacom_wac *wacom) in wacom_bpt_touch()
3090 static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) in wacom_bpt3_touch_msg()
3133 static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) in wacom_bpt3_button_msg()
3149 static int wacom_bpt3_touch(struct wacom_wac *wacom) in wacom_bpt3_touch()
3180 static int wacom_bpt_pen(struct wacom_wac *wacom) in wacom_bpt_pen()
3255 static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) in wacom_bpt_irq()
3272 static void wacom_bamboo_pad_pen_event(struct wacom_wac *wacom, in wacom_bamboo_pad_pen_event()
3298 static int wacom_bamboo_pad_touch_event(struct wacom_wac *wacom, in wacom_bamboo_pad_touch_event()
3338 static int wacom_bamboo_pad_irq(struct wacom_wac *wacom, size_t len) in wacom_bamboo_pad_irq()
3356 static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) in wacom_wireless_irq()
3398 static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_status_irq() argument
3400 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_status_irq()
3401 struct wacom_features *features = &wacom_wac->features; in wacom_status_irq()
3402 unsigned char *data = wacom_wac->data; in wacom_status_irq()
3409 wacom_wac->shared->touch_input && in wacom_status_irq()
3411 input_report_switch(wacom_wac->shared->touch_input, in wacom_status_irq()
3413 input_sync(wacom_wac->shared->touch_input); in wacom_status_irq()
3421 wacom_notify_battery(wacom_wac, WACOM_POWER_SUPPLY_STATUS_AUTO, in wacom_status_irq()
3427 wacom_notify_battery(wacom_wac, POWER_SUPPLY_STATUS_UNKNOWN, 0, 0, 0, 0); in wacom_status_irq()
3432 void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_wac_irq() argument
3436 switch (wacom_wac->features.type) { in wacom_wac_irq()
3438 sync = wacom_penpartner_irq(wacom_wac); in wacom_wac_irq()
3442 sync = wacom_pl_irq(wacom_wac); in wacom_wac_irq()
3449 sync = wacom_graphire_irq(wacom_wac); in wacom_wac_irq()
3453 sync = wacom_ptu_irq(wacom_wac); in wacom_wac_irq()
3457 sync = wacom_dtu_irq(wacom_wac); in wacom_wac_irq()
3462 sync = wacom_dtus_irq(wacom_wac); in wacom_wac_irq()
3482 sync = wacom_intuos_irq(wacom_wac); in wacom_wac_irq()
3486 sync = wacom_intuos_bt_irq(wacom_wac, len); in wacom_wac_irq()
3491 sync = wacom_24hdt_irq(wacom_wac); in wacom_wac_irq()
3501 sync = wacom_bpt3_touch(wacom_wac); in wacom_wac_irq()
3502 else if (wacom_wac->data[0] == WACOM_REPORT_USB) in wacom_wac_irq()
3503 sync = wacom_status_irq(wacom_wac, len); in wacom_wac_irq()
3505 sync = wacom_intuos_irq(wacom_wac); in wacom_wac_irq()
3511 sync = wacom_intuos_pro2_bt_irq(wacom_wac, len); in wacom_wac_irq()
3520 sync = wacom_tpc_irq(wacom_wac, len); in wacom_wac_irq()
3528 if (wacom_wac->data[0] == WACOM_REPORT_USB) in wacom_wac_irq()
3529 sync = wacom_status_irq(wacom_wac, len); in wacom_wac_irq()
3531 sync = wacom_bpt_irq(wacom_wac, len); in wacom_wac_irq()
3535 sync = wacom_bamboo_pad_irq(wacom_wac, len); in wacom_wac_irq()
3539 sync = wacom_wireless_irq(wacom_wac, len); in wacom_wac_irq()
3544 if (wacom_wac->data[0] == WACOM_REPORT_DEVICE_LIST) in wacom_wac_irq()
3545 wacom_remote_status_irq(wacom_wac, len); in wacom_wac_irq()
3547 sync = wacom_remote_irq(wacom_wac, len); in wacom_wac_irq()
3556 if (wacom_wac->pen_input) in wacom_wac_irq()
3557 input_sync(wacom_wac->pen_input); in wacom_wac_irq()
3558 if (wacom_wac->touch_input) in wacom_wac_irq()
3559 input_sync(wacom_wac->touch_input); in wacom_wac_irq()
3560 if (wacom_wac->pad_input) in wacom_wac_irq()
3561 input_sync(wacom_wac->pad_input); in wacom_wac_irq()
3565 static void wacom_setup_basic_pro_pen(struct wacom_wac *wacom_wac) in wacom_setup_basic_pro_pen() argument
3567 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_basic_pro_pen()
3576 0, wacom_wac->features.distance_max, wacom_wac->features.distance_fuzz, 0); in wacom_setup_basic_pro_pen()
3579 static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) in wacom_setup_cintiq() argument
3581 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_cintiq()
3582 struct wacom_features *features = &wacom_wac->features; in wacom_setup_cintiq()
3584 wacom_setup_basic_pro_pen(wacom_wac); in wacom_setup_cintiq()
3598 static void wacom_setup_intuos(struct wacom_wac *wacom_wac) in wacom_setup_intuos() argument
3600 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_intuos()
3604 wacom_setup_cintiq(wacom_wac); in wacom_setup_intuos()
3621 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_setup_device_quirks() local
3622 struct wacom_features *features = &wacom->wacom_wac.features; in wacom_setup_device_quirks()
3758 __clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3759 __clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3760 __clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3761 __clear_bit(ABS_Z, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3762 __clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3763 __clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3764 __clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3765 __clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3766 __clear_bit(ABS_MISC, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3767 __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit); in wacom_setup_device_quirks()
3768 __clear_bit(EV_MSC, wacom_wac->pen_input->evbit); in wacom_setup_device_quirks()
3773 struct wacom_wac *wacom_wac) in wacom_setup_pen_input_capabilities() argument
3775 struct wacom_features *features = &wacom_wac->features; in wacom_setup_pen_input_capabilities()
3844 wacom_setup_cintiq(wacom_wac); in wacom_setup_pen_input_capabilities()
3859 wacom_setup_intuos(wacom_wac); in wacom_setup_pen_input_capabilities()
3877 wacom_setup_intuos(wacom_wac); in wacom_setup_pen_input_capabilities()
3918 wacom_setup_basic_pro_pen(wacom_wac); in wacom_setup_pen_input_capabilities()
3938 struct wacom_wac *wacom_wac) in wacom_setup_touch_input_capabilities() argument
3940 struct wacom_features *features = &wacom_wac->features; in wacom_setup_touch_input_capabilities()
3984 if (wacom_wac->shared->touch->product == 0x361) { in wacom_setup_touch_input_capabilities()
3990 else if (wacom_wac->shared->touch->product == 0x360) { in wacom_setup_touch_input_capabilities()
3996 else if (wacom_wac->shared->touch->product == 0x393) { in wacom_setup_touch_input_capabilities()
4026 if (wacom_wac->shared->touch->product == 0x32C || in wacom_setup_touch_input_capabilities()
4027 wacom_wac->shared->touch->product == 0xF6) { in wacom_setup_touch_input_capabilities()
4030 wacom_wac->has_mute_touch_switch = true; in wacom_setup_touch_input_capabilities()
4031 wacom_wac->is_soft_touch_switch = true; in wacom_setup_touch_input_capabilities()
4140 if (wacom->wacom_wac.features.type == WACOM_21UX2) in wacom_is_led_toggled()
4145 if (wacom->wacom_wac.features.type == INTUOSP2_BT) in wacom_is_led_toggled()
4158 if (wacom->wacom_wac.features.type == WACOM_24HD) in wacom_update_led()
4211 struct wacom_wac *wacom_wac) in wacom_setup_pad_input_capabilities() argument
4213 struct wacom_features *features = &wacom_wac->features; in wacom_setup_pad_input_capabilities()
4221 if (features->type == REMOTE && input_dev == wacom_wac->pad_input) in wacom_setup_pad_input_capabilities()