linux/drivers/hid/wacom_wac.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  USB Wacom tablet support - Wacom specific code
 */

#include "wacom_wac.h"
#include "wacom.h"
#include <linux/input/mt.h>
#include <linux/jiffies.h>

/* resolution for penabled devices */
#define WACOM_PL_RES
#define WACOM_PENPRTN_RES
#define WACOM_VOLITO_RES
#define WACOM_GRAPHIRE_RES
#define WACOM_INTUOS_RES
#define WACOM_INTUOS3_RES

/* Newer Cintiq and DTU have an offset between tablet and screen areas */
#define WACOM_DTU_OFFSET
#define WACOM_CINTIQ_OFFSET

/*
 * Scale factor relating reported contact size to logical contact area.
 * 2^14/pi is a good approximation on Intuos5 and 3rd-gen Bamboo
 */
#define WACOM_CONTACT_AREA_SCALE

static bool touch_arbitration =;
module_param(touch_arbitration, bool, 0644);
MODULE_PARM_DESC();

static void wacom_report_numbered_buttons(struct input_dev *input_dev,
				int button_count, int mask);

static int wacom_numbered_button_to_key(int n);

static void wacom_update_led(struct wacom *wacom, int button_count, int mask,
			     int group);

static void wacom_force_proxout(struct wacom_wac *wacom_wac)
{}

void wacom_idleprox_timeout(struct timer_list *list)
{}

/*
 * Percent of battery capacity for Graphire.
 * 8th value means AC online and show 100% capacity.
 */
static unsigned short batcap_gr[8] =;

/*
 * Percent of battery capacity for Intuos4 WL, AC has a separate bit.
 */
static unsigned short batcap_i4[8] =;

static void __wacom_notify_battery(struct wacom_battery *battery,
				   int bat_status, int bat_capacity,
				   bool bat_charging, bool bat_connected,
				   bool ps_connected)
{}

static void wacom_notify_battery(struct wacom_wac *wacom_wac,
	int bat_status, int bat_capacity, bool bat_charging,
	bool bat_connected, bool ps_connected)
{}

static int wacom_penpartner_irq(struct wacom_wac *wacom)
{}

static int wacom_pl_irq(struct wacom_wac *wacom)
{}

static int wacom_ptu_irq(struct wacom_wac *wacom)
{}

static int wacom_dtu_irq(struct wacom_wac *wacom)
{}

static int wacom_dtus_irq(struct wacom_wac *wacom)
{}

static int wacom_graphire_irq(struct wacom_wac *wacom)
{}

static void wacom_intuos_schedule_prox_event(struct wacom_wac *wacom_wac)
{}

static int wacom_intuos_pad(struct wacom_wac *wacom)
{}

static int wacom_intuos_id_mangle(int tool_id)
{}

static bool wacom_is_art_pen(int tool_id)
{}

static int wacom_intuos_get_tool_type(int tool_id)
{}

static void wacom_exit_report(struct wacom_wac *wacom)
{}

static int wacom_intuos_inout(struct wacom_wac *wacom)
{}

static inline bool touch_is_muted(struct wacom_wac *wacom_wac)
{}

static inline bool report_touch_events(struct wacom_wac *wacom)
{}

static inline bool delay_pen_events(struct wacom_wac *wacom)
{}

static int wacom_intuos_general(struct wacom_wac *wacom)
{}

static int wacom_intuos_irq(struct wacom_wac *wacom)
{}

static int wacom_remote_irq(struct wacom_wac *wacom_wac, size_t len)
{}

static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len)
{}

static int int_dist(int x1, int y1, int x2, int y2)
{}

static void wacom_intuos_bt_process_data(struct wacom_wac *wacom,
		unsigned char *data)
{}

static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len)
{}

static int wacom_wac_finger_count_touches(struct wacom_wac *wacom)
{}

static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
{}

static void wacom_intuos_pro2_bt_touch(struct wacom_wac *wacom)
{}

static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)
{}

static void wacom_intuos_pro2_bt_battery(struct wacom_wac *wacom)
{}

static void wacom_intuos_gen3_bt_pad(struct wacom_wac *wacom)
{}

static void wacom_intuos_gen3_bt_battery(struct wacom_wac *wacom)
{}

static int wacom_intuos_pro2_bt_irq(struct wacom_wac *wacom, size_t len)
{}

static int wacom_24hdt_irq(struct wacom_wac *wacom)
{}

static int wacom_mt_touch(struct wacom_wac *wacom)
{}

static int wacom_tpc_mt_touch(struct wacom_wac *wacom)
{}

static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
{}

static int wacom_tpc_pen(struct wacom_wac *wacom)
{}

static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
{}

static int wacom_offset_rotation(struct input_dev *input, struct hid_usage *usage,
				 int value, int num, int denom)
{}

int wacom_equivalent_usage(int usage)
{}

static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage,
		struct hid_field *field, __u8 type, __u16 code, int fuzz)
{}

static void wacom_wac_battery_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

static void wacom_wac_battery_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{}

static void wacom_wac_battery_pre_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_battery_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_pad_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{}

static void wacom_wac_pad_pre_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_pad_report(struct hid_device *hdev,
		struct hid_report *report, struct hid_field *field)
{}

static void wacom_set_barrel_switch3_usage(struct wacom_wac *wacom_wac)
{}

static void wacom_wac_pen_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{}

static void wacom_wac_pen_pre_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_pen_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_finger_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
		struct input_dev *input)
{}

static void wacom_wac_finger_event(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage, __s32 value)
{}

static void wacom_wac_finger_pre_report(struct hid_device *hdev,
		struct hid_report *report)
{}

static void wacom_wac_finger_report(struct hid_device *hdev,
		struct hid_report *report)
{}

void wacom_wac_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

void wacom_wac_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{}

static void wacom_report_events(struct hid_device *hdev,
				struct hid_report *report, int collection_index,
				int field_index)
{}

static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *report,
			 int collection_index, struct hid_field *field,
			 int field_index)
{}

void wacom_wac_report(struct hid_device *hdev, struct hid_report *report)
{}

static int wacom_bpt_touch(struct wacom_wac *wacom)
{}

static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
{}

static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
{}

static int wacom_bpt3_touch(struct wacom_wac *wacom)
{}

static int wacom_bpt_pen(struct wacom_wac *wacom)
{}

static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
{}

static void wacom_bamboo_pad_pen_event(struct wacom_wac *wacom,
		unsigned char *data)
{}

static int wacom_bamboo_pad_touch_event(struct wacom_wac *wacom,
		unsigned char *data)
{}

static int wacom_bamboo_pad_irq(struct wacom_wac *wacom, size_t len)
{}

static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
{}

static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
{}

void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
{}

static void wacom_setup_basic_pro_pen(struct wacom_wac *wacom_wac)
{}

static void wacom_setup_cintiq(struct wacom_wac *wacom_wac)
{}

static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
{}

void wacom_setup_device_quirks(struct wacom *wacom)
{}

int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
				   struct wacom_wac *wacom_wac)
{}

int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
					 struct wacom_wac *wacom_wac)
{}

static int wacom_numbered_button_to_key(int n)
{}

static void wacom_setup_numbered_buttons(struct input_dev *input_dev,
				int button_count)
{}

static void wacom_24hd_update_leds(struct wacom *wacom, int mask, int group)
{}

static bool wacom_is_led_toggled(struct wacom *wacom, int button_count,
				 int mask, int group)
{}

static void wacom_update_led(struct wacom *wacom, int button_count, int mask,
			     int group)
{}

static void wacom_report_numbered_buttons(struct input_dev *input_dev,
				int button_count, int mask)
{}

int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
				   struct wacom_wac *wacom_wac)
{}

static const struct wacom_features wacom_features_0x00 =;
static const struct wacom_features wacom_features_0x10 =;
static const struct wacom_features wacom_features_0x81 =;
static const struct wacom_features wacom_features_0x11 =;
static const struct wacom_features wacom_features_0x12 =;
static const struct wacom_features wacom_features_0x13 =;
static const struct wacom_features wacom_features_0x14 =;
static const struct wacom_features wacom_features_0x15 =;
static const struct wacom_features wacom_features_0x16 =;
static const struct wacom_features wacom_features_0x17 =;
static const struct wacom_features wacom_features_0x18 =;
static const struct wacom_features wacom_features_0x19 =;
static const struct wacom_features wacom_features_0x60 =;
static const struct wacom_features wacom_features_0x61 =;
static const struct wacom_features wacom_features_0x62 =;
static const struct wacom_features wacom_features_0x63 =;
static const struct wacom_features wacom_features_0x64 =;
static const struct wacom_features wacom_features_0x65 =;
static const struct wacom_features wacom_features_0x69 =;
static const struct wacom_features wacom_features_0x6A =;
static const struct wacom_features wacom_features_0x6B =;
static const struct wacom_features wacom_features_0x20 =;
static const struct wacom_features wacom_features_0x21 =;
static const struct wacom_features wacom_features_0x22 =;
static const struct wacom_features wacom_features_0x23 =;
static const struct wacom_features wacom_features_0x24 =;
static const struct wacom_features wacom_features_0x30 =;
static const struct wacom_features wacom_features_0x31 =;
static const struct wacom_features wacom_features_0x32 =;
static const struct wacom_features wacom_features_0x33 =;
static const struct wacom_features wacom_features_0x34 =;
static const struct wacom_features wacom_features_0x35 =;
static const struct wacom_features wacom_features_0x37 =;
static const struct wacom_features wacom_features_0x38 =;
static const struct wacom_features wacom_features_0x39 =;
static const struct wacom_features wacom_features_0xC4 =;
static const struct wacom_features wacom_features_0xC0 =;
static const struct wacom_features wacom_features_0xC2 =;
static const struct wacom_features wacom_features_0x03 =;
static const struct wacom_features wacom_features_0x41 =;
static const struct wacom_features wacom_features_0x42 =;
static const struct wacom_features wacom_features_0x43 =;
static const struct wacom_features wacom_features_0x44 =;
static const struct wacom_features wacom_features_0x45 =;
static const struct wacom_features wacom_features_0xB0 =;
static const struct wacom_features wacom_features_0xB1 =;
static const struct wacom_features wacom_features_0xB2 =;
static const struct wacom_features wacom_features_0xB3 =;
static const struct wacom_features wacom_features_0xB4 =;
static const struct wacom_features wacom_features_0xB5 =;
static const struct wacom_features wacom_features_0xB7 =;
static const struct wacom_features wacom_features_0xB8 =;
static const struct wacom_features wacom_features_0xB9 =;
static const struct wacom_features wacom_features_0xBA =;
static const struct wacom_features wacom_features_0xBB =;
static const struct wacom_features wacom_features_0xBC =;
static const struct wacom_features wacom_features_0xBD =;
static const struct wacom_features wacom_features_0x26 =;
static const struct wacom_features wacom_features_0x27 =;
static const struct wacom_features wacom_features_0x28 =;
static const struct wacom_features wacom_features_0x29 =;
static const struct wacom_features wacom_features_0x2A =;
static const struct wacom_features wacom_features_0x314 =;
static const struct wacom_features wacom_features_0x315 =;
static const struct wacom_features wacom_features_0x317 =;
static const struct wacom_features wacom_features_0xF4 =;
static const struct wacom_features wacom_features_0xF8 =;
static const struct wacom_features wacom_features_0xF6 =;
static const struct wacom_features wacom_features_0x32A =;
static const struct wacom_features wacom_features_0x32B =;
static const struct wacom_features wacom_features_0x32C =;
static const struct wacom_features wacom_features_0x3F =;
static const struct wacom_features wacom_features_0xC5 =;
static const struct wacom_features wacom_features_0xC6 =;
static const struct wacom_features wacom_features_0x304 =;
static const struct wacom_features wacom_features_0x333 =;
static const struct wacom_features wacom_features_0x335 =;
static const struct wacom_features wacom_features_0xC7 =;
static const struct wacom_features wacom_features_0xCE =;
static const struct wacom_features wacom_features_0xF0 =;
static const struct wacom_features wacom_features_0xFB =;
static const struct wacom_features wacom_features_0x32F =;
static const struct wacom_features wacom_features_0x336 =;
static const struct wacom_features wacom_features_0x57 =;
static const struct wacom_features wacom_features_0x59 =/* Pen */
	{};
static const struct wacom_features wacom_features_0x5D =/* Touch */
	{};
static const struct wacom_features wacom_features_0xCC =;
static const struct wacom_features wacom_features_0xFA =;
static const struct wacom_features wacom_features_0x5B =;
static const struct wacom_features wacom_features_0x5E =;
static const struct wacom_features wacom_features_0x90 =; /* Pen-only */
static const struct wacom_features wacom_features_0x93 =;
static const struct wacom_features wacom_features_0x97 =; /* Pen-only */
static const struct wacom_features wacom_features_0x9A =;
static const struct wacom_features wacom_features_0x9F =;
static const struct wacom_features wacom_features_0xE2 =;
static const struct wacom_features wacom_features_0xE3 =;
static const struct wacom_features wacom_features_0xE5 =;
static const struct wacom_features wacom_features_0xE6 =;
static const struct wacom_features wacom_features_0xEC =; /* Pen-only */
static const struct wacom_features wacom_features_0xED =;
static const struct wacom_features wacom_features_0xEF =; /* Pen-only */
static const struct wacom_features wacom_features_0x100 =;
static const struct wacom_features wacom_features_0x101 =;
static const struct wacom_features wacom_features_0x10D =;
static const struct wacom_features wacom_features_0x10E =;
static const struct wacom_features wacom_features_0x10F =;
static const struct wacom_features wacom_features_0x116 =;
static const struct wacom_features wacom_features_0x12C =; /* Pen-only */
static const struct wacom_features wacom_features_0x4001 =;
static const struct wacom_features wacom_features_0x4004 =;
static const struct wacom_features wacom_features_0x5000 =;
static const struct wacom_features wacom_features_0x5002 =;
static const struct wacom_features wacom_features_0x47 =;
static const struct wacom_features wacom_features_0x84 =;
static const struct wacom_features wacom_features_0xD0 =;
static const struct wacom_features wacom_features_0xD1 =;
static const struct wacom_features wacom_features_0xD2 =;
static const struct wacom_features wacom_features_0xD3 =;
static const struct wacom_features wacom_features_0xD4 =;
static const struct wacom_features wacom_features_0xD5 =;
static const struct wacom_features wacom_features_0xD6 =;
static const struct wacom_features wacom_features_0xD7 =;
static const struct wacom_features wacom_features_0xD8 =;
static const struct wacom_features wacom_features_0xDA =;
static const struct wacom_features wacom_features_0xDB =;
static const struct wacom_features wacom_features_0xDD =;
static const struct wacom_features wacom_features_0xDE =;
static const struct wacom_features wacom_features_0xDF =;
static const struct wacom_features wacom_features_0x300 =;
static const struct wacom_features wacom_features_0x301 =;
static const struct wacom_features wacom_features_0x302 =;
static const struct wacom_features wacom_features_0x303 =;
static const struct wacom_features wacom_features_0x30E =;
static const struct wacom_features wacom_features_0x6004 =;
static const struct wacom_features wacom_features_0x307 =;
static const struct wacom_features wacom_features_0x309 =;
static const struct wacom_features wacom_features_0x30A =;
static const struct wacom_features wacom_features_0x30C =;
static const struct wacom_features wacom_features_0x318 =;
static const struct wacom_features wacom_features_0x319 =;
static const struct wacom_features wacom_features_0x325 =;
static const struct wacom_features wacom_features_0x326 =/* Touch */
	{};
static const struct wacom_features wacom_features_0x323 =;
static const struct wacom_features wacom_features_0x331 =;
static const struct wacom_features wacom_features_0x33B =;
static const struct wacom_features wacom_features_0x33C =;
static const struct wacom_features wacom_features_0x33D =;
static const struct wacom_features wacom_features_0x33E =;
static const struct wacom_features wacom_features_0x343 =;
static const struct wacom_features wacom_features_0x360 =;
static const struct wacom_features wacom_features_0x361 =;
static const struct wacom_features wacom_features_0x377 =;
static const struct wacom_features wacom_features_0x379 =;
static const struct wacom_features wacom_features_0x37A =;
static const struct wacom_features wacom_features_0x37B =;
static const struct wacom_features wacom_features_0x393 =;
static const struct wacom_features wacom_features_0x3c6 =;
static const struct wacom_features wacom_features_0x3c8 =;
static const struct wacom_features wacom_features_0x3dd =;

static const struct wacom_features wacom_features_HID_ANY_ID =;

static const struct wacom_features wacom_features_0x94 =;

#define USB_DEVICE_WACOM(prod)

#define BT_DEVICE_WACOM(prod)

#define I2C_DEVICE_WACOM(prod)

#define USB_DEVICE_LENOVO(prod)

const struct hid_device_id wacom_ids[] =;
MODULE_DEVICE_TABLE(hid, wacom_ids);