linux/drivers/hid/wacom_sys.c

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

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

#define WAC_MSG_RETRIES
#define WAC_CMD_RETRIES

#define DEV_ATTR_RW_PERM
#define DEV_ATTR_WO_PERM
#define DEV_ATTR_RO_PERM

static int wacom_get_report(struct hid_device *hdev, u8 type, u8 *buf,
			    size_t size, unsigned int retries)
{}

static int wacom_set_report(struct hid_device *hdev, u8 type, u8 *buf,
			    size_t size, unsigned int retries)
{}

static void wacom_wac_queue_insert(struct hid_device *hdev,
				   struct kfifo_rec_ptr_2 *fifo,
				   u8 *raw_data, int size)
{}

static void wacom_wac_queue_flush(struct hid_device *hdev,
				  struct kfifo_rec_ptr_2 *fifo)
{}

static int wacom_wac_pen_serial_enforce(struct hid_device *hdev,
		struct hid_report *report, u8 *raw_data, int report_size)
{}

static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
		u8 *raw_data, int size)
{}

static int wacom_open(struct input_dev *dev)
{}

static void wacom_close(struct input_dev *dev)
{}

/*
 * Calculate the resolution of the X or Y axis using hidinput_calc_abs_res.
 */
static int wacom_calc_hid_res(int logical_extents, int physical_extents,
			       unsigned unit, int exponent)
{}

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

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

/*
 * Interface Descriptor of wacom devices can be incomplete and
 * inconsistent so wacom_features table is used to store stylus
 * device's packet lengths, various maximum values, and tablet
 * resolution based on product ID's.
 *
 * For devices that contain 2 interfaces, wacom_features table is
 * inaccurate for the touch interface.  Since the Interface Descriptor
 * for touch interfaces has pretty complete data, this function exists
 * to query tablet for this missing information instead of hard coding in
 * an additional table.
 *
 * A typical Interface Descriptor for a stylus will contain a
 * boot mouse application collection that is not of interest and this
 * function will ignore it.
 *
 * It also contains a digitizer application collection that also is not
 * of interest since any information it contains would be duplicate
 * of what is in wacom_features. Usually it defines a report of an array
 * of bytes that could be used as max length of the stylus packet returned.
 * If it happens to define a Digitizer-Stylus Physical Collection then
 * the X and Y logical values contain valid data but it is ignored.
 *
 * A typical Interface Descriptor for a touch interface will contain a
 * Digitizer-Finger Physical Collection which will define both logical
 * X/Y maximum as well as the physical size of tablet. Since touch
 * interfaces haven't supported pressure or distance, this is enough
 * information to override invalid values in the wacom_features table.
 *
 * Intuos5 touch interface and 3rd gen Bamboo Touch do not contain useful
 * data. We deal with them after returning from this function.
 */
static void wacom_usage_mapping(struct hid_device *hdev,
		struct hid_field *field, struct hid_usage *usage)
{}

static void wacom_post_parse_hid(struct hid_device *hdev,
				 struct wacom_features *features)
{}

static void wacom_parse_hid(struct hid_device *hdev,
			   struct wacom_features *features)
{}

static int wacom_hid_set_device_mode(struct hid_device *hdev)
{}

static int wacom_set_device_mode(struct hid_device *hdev,
				 struct wacom_wac *wacom_wac)
{}

static int wacom_bt_query_tablet_data(struct hid_device *hdev, u8 speed,
		struct wacom_features *features)
{}

/*
 * Switch the tablet into its most-capable mode. Wacom tablets are
 * typically configured to power-up in a mode which sends mouse-like
 * reports to the OS. To get absolute position, pressure data, etc.
 * from the tablet, it is necessary to switch the tablet out of this
 * mode and into one which sends the full range of tablet data.
 */
static int _wacom_query_tablet_data(struct wacom *wacom)
{}

static void wacom_retrieve_hid_descriptor(struct hid_device *hdev,
					 struct wacom_features *features)
{}

struct wacom_hdev_data {};

static LIST_HEAD(wacom_udev_list);
static DEFINE_MUTEX(wacom_udev_list_lock);

static bool wacom_are_sibling(struct hid_device *hdev,
		struct hid_device *sibling)
{}

static struct wacom_hdev_data *wacom_get_hdev_data(struct hid_device *hdev)
{}

static void wacom_release_shared_data(struct kref *kref)
{}

static void wacom_remove_shared_data(void *res)
{}

static int wacom_add_shared_data(struct hid_device *hdev)
{}

static int wacom_led_control(struct wacom *wacom)
{}

static int wacom_led_putimage(struct wacom *wacom, int button_id, u8 xfer_id,
		const unsigned len, const void *img)
{}

static ssize_t wacom_led_select_store(struct device *dev, int set_id,
				      const char *buf, size_t count)
{}

#define DEVICE_LED_SELECT_ATTR(SET_ID)

DEVICE_LED_SELECT_ATTR();
DEVICE_LED_SELECT_ATTR();

static ssize_t wacom_luminance_store(struct wacom *wacom, u8 *dest,
				     const char *buf, size_t count)
{}

#define DEVICE_LUMINANCE_ATTR(name, field)

DEVICE_LUMINANCE_ATTR();
DEVICE_LUMINANCE_ATTR();
DEVICE_LUMINANCE_ATTR();

static ssize_t wacom_button_image_store(struct device *dev, int button_id,
					const char *buf, size_t count)
{}

#define DEVICE_BTNIMG_ATTR(BUTTON_ID)

DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();
DEVICE_BTNIMG_ATTR();

static struct attribute *cintiq_led_attrs[] =;

static const struct attribute_group cintiq_led_attr_group =;

static struct attribute *intuos4_led_attrs[] =;

static const struct attribute_group intuos4_led_attr_group =;

static struct attribute *intuos5_led_attrs[] =;

static const struct attribute_group intuos5_led_attr_group =;

static struct attribute *generic_led_attrs[] =;

static const struct attribute_group generic_led_attr_group =;

struct wacom_sysfs_group_devres {};

static void wacom_devm_sysfs_group_release(struct device *dev, void *res)
{}

static int __wacom_devm_sysfs_create_group(struct wacom *wacom,
					   struct kobject *root,
					   const struct attribute_group *group)
{}

static int wacom_devm_sysfs_create_group(struct wacom *wacom,
					 const struct attribute_group *group)
{}

static void wacom_devm_kfifo_release(struct device *dev, void *res)
{}

static int wacom_devm_kfifo_alloc(struct wacom *wacom)
{}

enum led_brightness wacom_leds_brightness_get(struct wacom_led *led)
{}

static enum led_brightness __wacom_led_brightness_get(struct led_classdev *cdev)
{}

static int wacom_led_brightness_set(struct led_classdev *cdev,
				    enum led_brightness brightness)
{}

static void wacom_led_readonly_brightness_set(struct led_classdev *cdev,
					       enum led_brightness brightness)
{}

static int wacom_led_register_one(struct device *dev, struct wacom *wacom,
				  struct wacom_led *led, unsigned int group,
				  unsigned int id, bool read_only)
{}

static void wacom_led_groups_release_one(void *data)
{}

static int wacom_led_groups_alloc_and_register_one(struct device *dev,
						   struct wacom *wacom,
						   int group_id, int count,
						   bool read_only)
{}

struct wacom_led *wacom_led_find(struct wacom *wacom, unsigned int group_id,
				 unsigned int id)
{}

/*
 * wacom_led_next: gives the next available led with a wacom trigger.
 *
 * returns the next available struct wacom_led which has its default trigger
 * or the current one if none is available.
 */
struct wacom_led *wacom_led_next(struct wacom *wacom, struct wacom_led *cur)
{}

static void wacom_led_groups_release(void *data)
{}

static int wacom_led_groups_allocate(struct wacom *wacom, int count)
{}

static int wacom_leds_alloc_and_register(struct wacom *wacom, int group_count,
					 int led_per_group, bool read_only)
{}

int wacom_initialize_leds(struct wacom *wacom)
{}

static void wacom_init_work(struct work_struct *work)
{}

static void wacom_query_tablet_data(struct wacom *wacom)
{}

static enum power_supply_property wacom_battery_props[] =;

static int wacom_battery_get_property(struct power_supply *psy,
				      enum power_supply_property psp,
				      union power_supply_propval *val)
{}

static int __wacom_initialize_battery(struct wacom *wacom,
				      struct wacom_battery *battery)
{}

static int wacom_initialize_battery(struct wacom *wacom)
{}

static void wacom_destroy_battery(struct wacom *wacom)
{}

static void wacom_aes_battery_handler(struct work_struct *work)
{}

static ssize_t wacom_show_speed(struct device *dev,
				struct device_attribute
				*attr, char *buf)
{}

static ssize_t wacom_store_speed(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{}

static DEVICE_ATTR(speed, DEV_ATTR_RW_PERM,
		wacom_show_speed, wacom_store_speed);


static ssize_t wacom_show_remote_mode(struct kobject *kobj,
				      struct kobj_attribute *kattr,
				      char *buf, int index)
{}

#define DEVICE_EKR_ATTR_GROUP(SET_ID)

DEVICE_EKR_ATTR_GROUP();
DEVICE_EKR_ATTR_GROUP();
DEVICE_EKR_ATTR_GROUP();
DEVICE_EKR_ATTR_GROUP();
DEVICE_EKR_ATTR_GROUP();

static int wacom_remote_create_attr_group(struct wacom *wacom, __u32 serial,
					  int index)
{}

static int wacom_cmd_unpair_remote(struct wacom *wacom, unsigned char selector)
{}

static ssize_t wacom_store_unpair_remote(struct kobject *kobj,
					 struct kobj_attribute *attr,
					 const char *buf, size_t count)
{}

static struct kobj_attribute unpair_remote_attr =;

static const struct attribute *remote_unpair_attrs[] =;

static void wacom_remotes_destroy(void *data)
{}

static int wacom_initialize_remotes(struct wacom *wacom)
{}

static struct input_dev *wacom_allocate_input(struct wacom *wacom)
{}

static int wacom_allocate_inputs(struct wacom *wacom)
{}

static int wacom_setup_inputs(struct wacom *wacom)
{}

static int wacom_register_inputs(struct wacom *wacom)
{}

/*
 * Not all devices report physical dimensions from HID.
 * Compute the default from hardcoded logical dimension
 * and resolution before driver overwrites them.
 */
static void wacom_set_default_phy(struct wacom_features *features)
{}

static void wacom_calculate_res(struct wacom_features *features)
{}

void wacom_battery_work(struct work_struct *work)
{}

static size_t wacom_compute_pktlen(struct hid_device *hdev)
{}

static void wacom_update_name(struct wacom *wacom, const char *suffix)
{}

static void wacom_release_resources(struct wacom *wacom)
{}

static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
{}

static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
{}

static void wacom_wireless_work(struct work_struct *work)
{}

static void wacom_remote_destroy_battery(struct wacom *wacom, int index)
{}

static void wacom_remote_destroy_one(struct wacom *wacom, unsigned int index)
{}

static int wacom_remote_create_one(struct wacom *wacom, u32 serial,
				   unsigned int index)
{}

static int wacom_remote_attach_battery(struct wacom *wacom, int index)
{}

static void wacom_remote_work(struct work_struct *work)
{}

static void wacom_mode_change_work(struct work_struct *work)
{}

static int wacom_probe(struct hid_device *hdev,
		const struct hid_device_id *id)
{}

static void wacom_remove(struct hid_device *hdev)
{}

#ifdef CONFIG_PM
static int wacom_resume(struct hid_device *hdev)
{}

static int wacom_reset_resume(struct hid_device *hdev)
{}
#endif /* CONFIG_PM */

static struct hid_driver wacom_driver =;
module_hid_driver();

MODULE_VERSION();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();