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()
121 static int wacom_penpartner_irq(struct wacom_wac *wacom) in wacom_penpartner_irq()
165 static int wacom_pl_irq(struct wacom_wac *wacom) in wacom_pl_irq()
226 static int wacom_ptu_irq(struct wacom_wac *wacom) in wacom_ptu_irq()
255 static int wacom_dtu_irq(struct wacom_wac *wacom) in wacom_dtu_irq()
285 static int wacom_dtus_irq(struct wacom_wac *wacom) in wacom_dtus_irq()
336 static int wacom_graphire_irq(struct wacom_wac *wacom) in wacom_graphire_irq()
491 static void wacom_intuos_schedule_prox_event(struct wacom_wac *wacom_wac) in wacom_intuos_schedule_prox_event() argument
493 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_intuos_schedule_prox_event()
494 struct wacom_features *features = &wacom_wac->features; in wacom_intuos_schedule_prox_event()
508 static int wacom_intuos_pad(struct wacom_wac *wacom) in wacom_intuos_pad()
775 static void wacom_exit_report(struct wacom_wac *wacom) in wacom_exit_report()
814 static int wacom_intuos_inout(struct wacom_wac *wacom) in wacom_intuos_inout()
873 static inline bool touch_is_muted(struct wacom_wac *wacom_wac) in touch_is_muted() argument
875 return wacom_wac->probe_complete && in touch_is_muted()
876 wacom_wac->shared->has_mute_touch_switch && in touch_is_muted()
877 !wacom_wac->shared->is_touch_on; in touch_is_muted()
880 static inline bool report_touch_events(struct wacom_wac *wacom) in report_touch_events()
885 static inline bool delay_pen_events(struct wacom_wac *wacom) in delay_pen_events()
890 static int wacom_intuos_general(struct wacom_wac *wacom) in wacom_intuos_general()
1063 static int wacom_intuos_irq(struct wacom_wac *wacom) in wacom_intuos_irq()
1100 static int wacom_remote_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_remote_irq() argument
1102 unsigned char *data = wacom_wac->data; in wacom_remote_irq()
1104 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_remote_irq()
1118 wacom_wac->id[0] = PAD_DEVICE_ID; in wacom_remote_irq()
1189 static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_remote_status_irq() argument
1191 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_remote_status_irq()
1192 unsigned char *data = wacom_wac->data; in wacom_remote_status_irq()
1223 wacom_schedule_work(wacom_wac, WACOM_WORKER_REMOTE); in wacom_remote_status_irq()
1234 static void wacom_intuos_bt_process_data(struct wacom_wac *wacom, in wacom_intuos_bt_process_data()
1245 static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) in wacom_intuos_bt_irq()
1281 static int wacom_wac_finger_count_touches(struct wacom_wac *wacom) in wacom_wac_finger_count_touches()
1305 static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_pen()
1412 static void wacom_intuos_pro2_bt_touch(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_touch()
1479 static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_pad()
1509 static void wacom_intuos_pro2_bt_battery(struct wacom_wac *wacom) in wacom_intuos_pro2_bt_battery()
1520 static void wacom_intuos_gen3_bt_pad(struct wacom_wac *wacom) in wacom_intuos_gen3_bt_pad()
1536 static void wacom_intuos_gen3_bt_battery(struct wacom_wac *wacom) in wacom_intuos_gen3_bt_battery()
1547 static int wacom_intuos_pro2_bt_irq(struct wacom_wac *wacom, size_t len) in wacom_intuos_pro2_bt_irq()
1570 static int wacom_24hdt_irq(struct wacom_wac *wacom) in wacom_24hdt_irq()
1641 static int wacom_mt_touch(struct wacom_wac *wacom) in wacom_mt_touch()
1692 static int wacom_tpc_mt_touch(struct wacom_wac *wacom) in wacom_tpc_mt_touch()
1720 static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len) in wacom_tpc_single_touch()
1756 static int wacom_tpc_pen(struct wacom_wac *wacom) in wacom_tpc_pen()
1786 static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) in wacom_tpc_irq()
1892 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_map_usage() local
1893 struct wacom_features *features = &wacom_wac->features; in wacom_map_usage()
1933 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_battery_usage_mapping() local
1934 struct wacom_features *features = &wacom_wac->features; in wacom_wac_battery_usage_mapping()
1950 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_battery_event() local
1956 wacom_wac->hid_data.bat_status = POWER_SUPPLY_STATUS_UNKNOWN; in wacom_wac_battery_event()
1960 wacom_wac->hid_data.battery_capacity = value; in wacom_wac_battery_event()
1961 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1962 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1967 wacom_wac->hid_data.battery_capacity = value; in wacom_wac_battery_event()
1968 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1969 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1972 wacom_wac->hid_data.bat_charging = value; in wacom_wac_battery_event()
1973 wacom_wac->hid_data.ps_connected = value; in wacom_wac_battery_event()
1974 wacom_wac->hid_data.bat_connected = 1; in wacom_wac_battery_event()
1975 wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; in wacom_wac_battery_event()
1990 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_battery_report() local
1991 struct wacom_features *features = &wacom_wac->features; in wacom_wac_battery_report()
1994 int status = wacom_wac->hid_data.bat_status; in wacom_wac_battery_report()
1995 int capacity = wacom_wac->hid_data.battery_capacity; in wacom_wac_battery_report()
1996 bool charging = wacom_wac->hid_data.bat_charging; in wacom_wac_battery_report()
1997 bool connected = wacom_wac->hid_data.bat_connected; in wacom_wac_battery_report()
1998 bool powered = wacom_wac->hid_data.ps_connected; in wacom_wac_battery_report()
2000 wacom_notify_battery(wacom_wac, status, capacity, charging, in wacom_wac_battery_report()
2009 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_usage_mapping() local
2010 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pad_usage_mapping()
2011 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_usage_mapping()
2044 wacom_wac->is_soft_touch_switch = true; in wacom_wac_pad_usage_mapping()
2055 wacom_wac->has_mute_touch_switch = true; in wacom_wac_pad_usage_mapping()
2095 if (!wacom_wac->has_mode_change) { in wacom_wac_pad_usage_mapping()
2096 wacom_wac->has_mode_change = true; in wacom_wac_pad_usage_mapping()
2097 wacom_wac->is_direct_mode = true; in wacom_wac_pad_usage_mapping()
2118 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_event() local
2119 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_event()
2120 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pad_event()
2134 wacom_wac->hid_data.inrange_state |= value; in wacom_wac_pad_event()
2143 if (wacom_wac->shared->touch_input) { in wacom_wac_pad_event()
2144 bool *is_touch_on = &wacom_wac->shared->is_touch_on; in wacom_wac_pad_event()
2151 input_report_switch(wacom_wac->shared->touch_input, in wacom_wac_pad_event()
2153 input_sync(wacom_wac->shared->touch_input); in wacom_wac_pad_event()
2197 if (wacom_wac->is_direct_mode != value) { in wacom_wac_pad_event()
2198 wacom_wac->is_direct_mode = value; in wacom_wac_pad_event()
2199 wacom_schedule_work(&wacom->wacom_wac, WACOM_WORKER_MODE_CHANGE); in wacom_wac_pad_event()
2216 wacom_wac->hid_data.pad_input_event_flag = true; in wacom_wac_pad_event()
2224 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_pre_report() local
2226 wacom_wac->hid_data.inrange_state = 0; in wacom_wac_pad_pre_report()
2233 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pad_report() local
2234 struct input_dev *input = wacom_wac->pad_input; in wacom_wac_pad_report()
2235 bool active = wacom_wac->hid_data.inrange_state != 0; in wacom_wac_pad_report()
2238 if (wacom_wac->hid_data.pad_input_event_flag) { in wacom_wac_pad_report()
2242 wacom_wac->hid_data.pad_input_event_flag = false; in wacom_wac_pad_report()
2246 static void wacom_set_barrel_switch3_usage(struct wacom_wac *wacom_wac) in wacom_set_barrel_switch3_usage() argument
2248 struct input_dev *input = wacom_wac->pen_input; in wacom_set_barrel_switch3_usage()
2249 struct wacom_features *features = &wacom_wac->features; in wacom_set_barrel_switch3_usage()
2252 wacom_wac->hid_data.barrelswitch && in wacom_set_barrel_switch3_usage()
2253 wacom_wac->hid_data.barrelswitch2 && in wacom_set_barrel_switch3_usage()
2254 wacom_wac->hid_data.serialhi && in wacom_set_barrel_switch3_usage()
2255 !wacom_wac->hid_data.barrelswitch3) { in wacom_set_barrel_switch3_usage()
2265 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_usage_mapping() local
2266 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pen_usage_mapping()
2267 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_usage_mapping()
2309 wacom_wac->hid_data.barrelswitch = true; in wacom_wac_pen_usage_mapping()
2310 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2314 wacom_wac->hid_data.barrelswitch2 = true; in wacom_wac_pen_usage_mapping()
2315 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2330 wacom_wac->hid_data.serialhi = true; in wacom_wac_pen_usage_mapping()
2331 wacom_set_barrel_switch3_usage(wacom_wac); in wacom_wac_pen_usage_mapping()
2339 wacom_wac->hid_data.barrelswitch3 = true; in wacom_wac_pen_usage_mapping()
2350 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_event() local
2351 struct wacom_features *features = &wacom_wac->features; in wacom_wac_pen_event()
2352 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_event()
2355 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_pen_event()
2369 wacom_wac->hid_data.inrange_state = value; in wacom_wac_pen_event()
2371 wacom_wac->hid_data.sense_state = value; in wacom_wac_pen_event()
2374 wacom_wac->hid_data.invert_state = value; in wacom_wac_pen_event()
2378 wacom_wac->hid_data.tipswitch |= value; in wacom_wac_pen_event()
2381 wacom_wac->hid_data.barrelswitch = value; in wacom_wac_pen_event()
2384 wacom_wac->hid_data.barrelswitch2 = value; in wacom_wac_pen_event()
2388 wacom_wac->serial[0] = (wacom_wac->serial[0] & ~0xFFFFFFFFULL); in wacom_wac_pen_event()
2389 wacom_wac->serial[0] |= wacom_s32tou(value, field->report_size); in wacom_wac_pen_event()
2394 if (!wacom_is_art_pen(wacom_wac->id[0])) return; in wacom_wac_pen_event()
2404 wacom_wac->hid_data.sense_state = value; in wacom_wac_pen_event()
2410 wacom_wac->serial[0] = (wacom_wac->serial[0] & 0xFFFFFFFF); in wacom_wac_pen_event()
2411 wacom_wac->serial[0] |= ((__u64)raw_value) << 32; in wacom_wac_pen_event()
2418 wacom_wac->id[0] |= raw_value & 0xFFFFF; in wacom_wac_pen_event()
2430 wacom_wac->id[0] |= wacom_s32tou(value, field->report_size); in wacom_wac_pen_event()
2461 wacom_wac->is_invalid_bt_frame = !value; in wacom_wac_pen_event()
2464 wacom_wac->hid_data.barrelswitch3 = value; in wacom_wac_pen_event()
2467 if (wacom_wac->hid_data.sequence_number != value) in wacom_wac_pen_event()
2468 …hid_warn(hdev, "Dropped %hu packets", (unsigned short)(value - wacom_wac->hid_data.sequence_number… in wacom_wac_pen_event()
2469 wacom_wac->hid_data.sequence_number = value + 1; in wacom_wac_pen_event()
2476 if (!usage->type || delay_pen_events(wacom_wac)) in wacom_wac_pen_event()
2480 if (wacom_wac->hid_data.inrange_state) in wacom_wac_pen_event()
2482 else if (wacom_wac->shared->stylus_in_proximity && !wacom_wac->hid_data.sense_state) in wacom_wac_pen_event()
2490 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_pre_report() local
2492 wacom_wac->is_invalid_bt_frame = false; in wacom_wac_pen_pre_report()
2500 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_pen_report() local
2501 struct input_dev *input = wacom_wac->pen_input; in wacom_wac_pen_report()
2502 bool range = wacom_wac->hid_data.inrange_state; in wacom_wac_pen_report()
2503 bool sense = wacom_wac->hid_data.sense_state; in wacom_wac_pen_report()
2505 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_pen_report()
2508 if (!wacom_wac->tool[0] && range) { /* first in range */ in wacom_wac_pen_report()
2510 if (wacom_wac->hid_data.invert_state) in wacom_wac_pen_report()
2511 wacom_wac->tool[0] = BTN_TOOL_RUBBER; in wacom_wac_pen_report()
2512 else if (wacom_wac->id[0]) in wacom_wac_pen_report()
2513 wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]); in wacom_wac_pen_report()
2515 wacom_wac->tool[0] = BTN_TOOL_PEN; in wacom_wac_pen_report()
2519 wacom_wac->shared->stylus_in_proximity = sense; in wacom_wac_pen_report()
2521 if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) { in wacom_wac_pen_report()
2522 int id = wacom_wac->id[0]; in wacom_wac_pen_report()
2523 if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3) { in wacom_wac_pen_report()
2524 int sw_state = wacom_wac->hid_data.barrelswitch | in wacom_wac_pen_report()
2525 (wacom_wac->hid_data.barrelswitch2 << 1); in wacom_wac_pen_report()
2526 wacom_wac->hid_data.barrelswitch = sw_state == 1; in wacom_wac_pen_report()
2527 wacom_wac->hid_data.barrelswitch2 = sw_state == 2; in wacom_wac_pen_report()
2528 wacom_wac->hid_data.barrelswitch3 = sw_state == 3; in wacom_wac_pen_report()
2530 input_report_key(input, BTN_STYLUS, wacom_wac->hid_data.barrelswitch); in wacom_wac_pen_report()
2531 input_report_key(input, BTN_STYLUS2, wacom_wac->hid_data.barrelswitch2); in wacom_wac_pen_report()
2532 input_report_key(input, BTN_STYLUS3, wacom_wac->hid_data.barrelswitch3); in wacom_wac_pen_report()
2538 if (wacom_wac->serial[0] >> 52 == 1) in wacom_wac_pen_report()
2547 wacom_wac->hid_data.tipswitch); in wacom_wac_pen_report()
2548 input_report_key(input, wacom_wac->tool[0], sense); in wacom_wac_pen_report()
2549 if (wacom_wac->serial[0]) { in wacom_wac_pen_report()
2550 input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); in wacom_wac_pen_report()
2554 wacom_wac->hid_data.tipswitch = false; in wacom_wac_pen_report()
2560 wacom_wac->tool[0] = 0; in wacom_wac_pen_report()
2561 wacom_wac->id[0] = 0; in wacom_wac_pen_report()
2562 wacom_wac->serial[0] = 0; in wacom_wac_pen_report()
2570 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_usage_mapping() local
2571 struct input_dev *input = wacom_wac->touch_input; in wacom_wac_finger_usage_mapping()
2572 unsigned touch_max = wacom_wac->features.touch_max; in wacom_wac_finger_usage_mapping()
2600 wacom_wac->hid_data.cc_report = field->report->id; in wacom_wac_finger_usage_mapping()
2601 wacom_wac->hid_data.cc_index = field->index; in wacom_wac_finger_usage_mapping()
2602 wacom_wac->hid_data.cc_value_index = usage->usage_index; in wacom_wac_finger_usage_mapping()
2620 static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac, in wacom_wac_finger_slot() argument
2623 struct hid_data *hid_data = &wacom_wac->hid_data; in wacom_wac_finger_slot()
2624 bool mt = wacom_wac->features.touch_max > 1; in wacom_wac_finger_slot()
2626 report_touch_events(wacom_wac); in wacom_wac_finger_slot()
2628 if (touch_is_muted(wacom_wac)) { in wacom_wac_finger_slot()
2629 if (!wacom_wac->shared->touch_down) in wacom_wac_finger_slot()
2634 wacom_wac->hid_data.num_received++; in wacom_wac_finger_slot()
2635 if (wacom_wac->hid_data.num_received > wacom_wac->hid_data.num_expected) in wacom_wac_finger_slot()
2698 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_event() local
2700 struct wacom_features *features = &wacom->wacom_wac.features; in wacom_wac_finger_event()
2702 if (touch_is_muted(wacom_wac) && !wacom_wac->shared->touch_down) in wacom_wac_finger_event()
2705 if (wacom_wac->is_invalid_bt_frame) in wacom_wac_finger_event()
2710 wacom_wac->hid_data.confidence = value; in wacom_wac_finger_event()
2713 wacom_wac->hid_data.x = value; in wacom_wac_finger_event()
2716 wacom_wac->hid_data.y = value; in wacom_wac_finger_event()
2719 wacom_wac->hid_data.width = value; in wacom_wac_finger_event()
2722 wacom_wac->hid_data.height = value; in wacom_wac_finger_event()
2725 wacom_wac->hid_data.id = value; in wacom_wac_finger_event()
2728 wacom_wac->hid_data.tipswitch = value; in wacom_wac_finger_event()
2731 wacom_wac->is_invalid_bt_frame = !value; in wacom_wac_finger_event()
2744 if (equivalent_usage == wacom_wac->hid_data.last_slot_field) { in wacom_wac_finger_event()
2745 bool touch_removed = wacom_wac_slot_is_active(wacom_wac->touch_input, in wacom_wac_finger_event()
2746 wacom_wac->hid_data.id) && !wacom_wac->hid_data.tipswitch; in wacom_wac_finger_event()
2748 if (wacom_wac->hid_data.confidence || touch_removed) { in wacom_wac_finger_event()
2749 wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input); in wacom_wac_finger_event()
2759 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_pre_report() local
2760 struct hid_data* hid_data = &wacom_wac->hid_data; in wacom_wac_finger_pre_report()
2763 if (touch_is_muted(wacom_wac) && !wacom_wac->shared->touch_down) in wacom_wac_finger_pre_report()
2766 wacom_wac->is_invalid_bt_frame = false; in wacom_wac_finger_pre_report()
2813 hid_data->num_expected = wacom_wac->features.touch_max; in wacom_wac_finger_pre_report()
2822 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_finger_report() local
2823 struct input_dev *input = wacom_wac->touch_input; in wacom_wac_finger_report()
2824 unsigned touch_max = wacom_wac->features.touch_max; in wacom_wac_finger_report()
2827 if (wacom_wac->hid_data.num_expected == 0) in wacom_wac_finger_report()
2834 if (wacom_wac->hid_data.num_received < wacom_wac->hid_data.num_expected) in wacom_wac_finger_report()
2841 wacom_wac->hid_data.num_received = 0; in wacom_wac_finger_report()
2842 wacom_wac->hid_data.num_expected = 0; in wacom_wac_finger_report()
2845 wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(wacom_wac); in wacom_wac_finger_report()
2852 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_usage_mapping() local
2853 struct wacom_features *features = &wacom_wac->features; in wacom_wac_usage_mapping()
2874 if (wacom->wacom_wac.features.type != HID_GENERIC) in wacom_wac_event()
2885 else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) in wacom_wac_event()
2887 else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) in wacom_wac_event()
2937 else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) in wacom_wac_collection()
2939 else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) in wacom_wac_collection()
2948 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_wac_report() local
2955 if (wacom_wac->features.type != HID_GENERIC) in wacom_wac_report()
2973 if (pad_in_hid_field && wacom->wacom_wac.pad_input) in wacom_wac_report()
2975 if (pen_in_hid_field && wacom->wacom_wac.pen_input) in wacom_wac_report()
2977 if (finger_in_hid_field && wacom->wacom_wac.touch_input) in wacom_wac_report()
2993 if (true_pad && wacom->wacom_wac.pad_input) in wacom_wac_report()
2997 static int wacom_bpt_touch(struct wacom_wac *wacom) in wacom_bpt_touch()
3038 static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) in wacom_bpt3_touch_msg()
3081 static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) in wacom_bpt3_button_msg()
3097 static int wacom_bpt3_touch(struct wacom_wac *wacom) in wacom_bpt3_touch()
3128 static int wacom_bpt_pen(struct wacom_wac *wacom) in wacom_bpt_pen()
3203 static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) in wacom_bpt_irq()
3220 static void wacom_bamboo_pad_pen_event(struct wacom_wac *wacom, in wacom_bamboo_pad_pen_event()
3246 static int wacom_bamboo_pad_touch_event(struct wacom_wac *wacom, in wacom_bamboo_pad_touch_event()
3286 static int wacom_bamboo_pad_irq(struct wacom_wac *wacom, size_t len) in wacom_bamboo_pad_irq()
3304 static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) in wacom_wireless_irq()
3346 static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_status_irq() argument
3348 struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); in wacom_status_irq()
3349 struct wacom_features *features = &wacom_wac->features; in wacom_status_irq()
3350 unsigned char *data = wacom_wac->data; in wacom_status_irq()
3357 wacom_wac->shared->touch_input && in wacom_status_irq()
3359 input_report_switch(wacom_wac->shared->touch_input, in wacom_status_irq()
3361 input_sync(wacom_wac->shared->touch_input); in wacom_status_irq()
3368 wacom_notify_battery(wacom_wac, WACOM_POWER_SUPPLY_STATUS_AUTO, in wacom_status_irq()
3374 wacom_schedule_work(wacom_wac, WACOM_WORKER_BATTERY); in wacom_status_irq()
3380 wacom_schedule_work(wacom_wac, WACOM_WORKER_BATTERY); in wacom_status_irq()
3381 wacom_notify_battery(wacom_wac, POWER_SUPPLY_STATUS_UNKNOWN, 0, 0, 0, 0); in wacom_status_irq()
3386 void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) in wacom_wac_irq() argument
3390 switch (wacom_wac->features.type) { in wacom_wac_irq()
3392 sync = wacom_penpartner_irq(wacom_wac); in wacom_wac_irq()
3396 sync = wacom_pl_irq(wacom_wac); in wacom_wac_irq()
3403 sync = wacom_graphire_irq(wacom_wac); in wacom_wac_irq()
3407 sync = wacom_ptu_irq(wacom_wac); in wacom_wac_irq()
3411 sync = wacom_dtu_irq(wacom_wac); in wacom_wac_irq()
3416 sync = wacom_dtus_irq(wacom_wac); in wacom_wac_irq()
3436 sync = wacom_intuos_irq(wacom_wac); in wacom_wac_irq()
3440 sync = wacom_intuos_bt_irq(wacom_wac, len); in wacom_wac_irq()
3445 sync = wacom_24hdt_irq(wacom_wac); in wacom_wac_irq()
3455 sync = wacom_bpt3_touch(wacom_wac); in wacom_wac_irq()
3456 else if (wacom_wac->data[0] == WACOM_REPORT_USB) in wacom_wac_irq()
3457 sync = wacom_status_irq(wacom_wac, len); in wacom_wac_irq()
3459 sync = wacom_intuos_irq(wacom_wac); in wacom_wac_irq()
3465 sync = wacom_intuos_pro2_bt_irq(wacom_wac, len); in wacom_wac_irq()
3474 sync = wacom_tpc_irq(wacom_wac, len); in wacom_wac_irq()
3482 if (wacom_wac->data[0] == WACOM_REPORT_USB) in wacom_wac_irq()
3483 sync = wacom_status_irq(wacom_wac, len); in wacom_wac_irq()
3485 sync = wacom_bpt_irq(wacom_wac, len); in wacom_wac_irq()
3489 sync = wacom_bamboo_pad_irq(wacom_wac, len); in wacom_wac_irq()
3493 sync = wacom_wireless_irq(wacom_wac, len); in wacom_wac_irq()
3498 if (wacom_wac->data[0] == WACOM_REPORT_DEVICE_LIST) in wacom_wac_irq()
3499 wacom_remote_status_irq(wacom_wac, len); in wacom_wac_irq()
3501 sync = wacom_remote_irq(wacom_wac, len); in wacom_wac_irq()
3510 if (wacom_wac->pen_input) in wacom_wac_irq()
3511 input_sync(wacom_wac->pen_input); in wacom_wac_irq()
3512 if (wacom_wac->touch_input) in wacom_wac_irq()
3513 input_sync(wacom_wac->touch_input); in wacom_wac_irq()
3514 if (wacom_wac->pad_input) in wacom_wac_irq()
3515 input_sync(wacom_wac->pad_input); in wacom_wac_irq()
3519 static void wacom_setup_basic_pro_pen(struct wacom_wac *wacom_wac) in wacom_setup_basic_pro_pen() argument
3521 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_basic_pro_pen()
3530 0, wacom_wac->features.distance_max, wacom_wac->features.distance_fuzz, 0); in wacom_setup_basic_pro_pen()
3533 static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) in wacom_setup_cintiq() argument
3535 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_cintiq()
3536 struct wacom_features *features = &wacom_wac->features; in wacom_setup_cintiq()
3538 wacom_setup_basic_pro_pen(wacom_wac); in wacom_setup_cintiq()
3552 static void wacom_setup_intuos(struct wacom_wac *wacom_wac) in wacom_setup_intuos() argument
3554 struct input_dev *input_dev = wacom_wac->pen_input; in wacom_setup_intuos()
3558 wacom_setup_cintiq(wacom_wac); in wacom_setup_intuos()
3575 struct wacom_wac *wacom_wac = &wacom->wacom_wac; in wacom_setup_device_quirks() local
3576 struct wacom_features *features = &wacom->wacom_wac.features; in wacom_setup_device_quirks()
3712 __clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3713 __clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3714 __clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit); in wacom_setup_device_quirks()
3715 __clear_bit(ABS_Z, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3716 __clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3717 __clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3718 __clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3719 __clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3720 __clear_bit(ABS_MISC, wacom_wac->pen_input->absbit); in wacom_setup_device_quirks()
3721 __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit); in wacom_setup_device_quirks()
3722 __clear_bit(EV_MSC, wacom_wac->pen_input->evbit); in wacom_setup_device_quirks()
3727 struct wacom_wac *wacom_wac) in wacom_setup_pen_input_capabilities() argument
3729 struct wacom_features *features = &wacom_wac->features; in wacom_setup_pen_input_capabilities()
3798 wacom_setup_cintiq(wacom_wac); in wacom_setup_pen_input_capabilities()
3813 wacom_setup_intuos(wacom_wac); in wacom_setup_pen_input_capabilities()
3831 wacom_setup_intuos(wacom_wac); in wacom_setup_pen_input_capabilities()
3872 wacom_setup_basic_pro_pen(wacom_wac); in wacom_setup_pen_input_capabilities()
3892 struct wacom_wac *wacom_wac) in wacom_setup_touch_input_capabilities() argument
3894 struct wacom_features *features = &wacom_wac->features; in wacom_setup_touch_input_capabilities()
3938 if (wacom_wac->shared->touch->product == 0x361) { in wacom_setup_touch_input_capabilities()
3944 else if (wacom_wac->shared->touch->product == 0x360) { in wacom_setup_touch_input_capabilities()
3950 else if (wacom_wac->shared->touch->product == 0x393) { in wacom_setup_touch_input_capabilities()
3980 if (wacom_wac->shared->touch->product == 0x32C || in wacom_setup_touch_input_capabilities()
3981 wacom_wac->shared->touch->product == 0xF6) { in wacom_setup_touch_input_capabilities()
3984 wacom_wac->has_mute_touch_switch = true; in wacom_setup_touch_input_capabilities()
3985 wacom_wac->is_soft_touch_switch = true; in wacom_setup_touch_input_capabilities()
4094 if (wacom->wacom_wac.features.type == WACOM_21UX2) in wacom_is_led_toggled()
4099 if (wacom->wacom_wac.features.type == INTUOSP2_BT) in wacom_is_led_toggled()
4112 if (wacom->wacom_wac.features.type == WACOM_24HD) in wacom_update_led()
4165 struct wacom_wac *wacom_wac) in wacom_setup_pad_input_capabilities() argument
4167 struct wacom_features *features = &wacom_wac->features; in wacom_setup_pad_input_capabilities()
4175 if (features->type == REMOTE && input_dev == wacom_wac->pad_input) in wacom_setup_pad_input_capabilities()