linux/drivers/hid/hid-ntrig.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  HID driver for N-Trig touchscreens
 *
 *  Copyright (c) 2008-2010 Rafi Rubin
 *  Copyright (c) 2009-2010 Stephane Chatty
 */

/*
 */

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/usb.h>
#include "usbhid/usbhid.h"
#include <linux/module.h>
#include <linux/slab.h>

#include "hid-ids.h"

#define NTRIG_DUPLICATE_USAGES

static unsigned int min_width;
module_param(min_width, uint, 0644);
MODULE_PARM_DESC();

static unsigned int min_height;
module_param(min_height, uint, 0644);
MODULE_PARM_DESC();

static unsigned int activate_slack =;
module_param(activate_slack, uint, 0644);
MODULE_PARM_DESC();

static unsigned int deactivate_slack =;
module_param(deactivate_slack, uint, 0644);
MODULE_PARM_DESC();

static unsigned int activation_width =;
module_param(activation_width, uint, 0644);
MODULE_PARM_DESC();

static unsigned int activation_height =;
module_param(activation_height, uint, 0644);
MODULE_PARM_DESC();

struct ntrig_data {};


/*
 * This function converts the 4 byte raw firmware code into
 * a string containing 5 comma separated numbers.
 */
static int ntrig_version_string(unsigned char *raw, char *buf)
{}

static inline int ntrig_get_mode(struct hid_device *hdev)
{}

static inline void ntrig_set_mode(struct hid_device *hdev, const int mode)
{}

static void ntrig_report_version(struct hid_device *hdev)
{}

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

static DEVICE_ATTR(sensor_physical_width, S_IRUGO, show_phys_width, NULL);

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

static DEVICE_ATTR(sensor_physical_height, S_IRUGO, show_phys_height, NULL);

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

static DEVICE_ATTR(sensor_logical_width, S_IRUGO, show_log_width, NULL);

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

static DEVICE_ATTR(sensor_logical_height, S_IRUGO, show_log_height, NULL);

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

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

static DEVICE_ATTR(min_width, S_IWUSR | S_IRUGO, show_min_width, set_min_width);

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

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

static DEVICE_ATTR(min_height, S_IWUSR | S_IRUGO, show_min_height,
		   set_min_height);

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

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

static DEVICE_ATTR(activate_slack, S_IWUSR | S_IRUGO, show_activate_slack,
		   set_activate_slack);

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

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

static DEVICE_ATTR(activation_width, S_IWUSR | S_IRUGO, show_activation_width,
		   set_activation_width);

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

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

static DEVICE_ATTR(activation_height, S_IWUSR | S_IRUGO,
		   show_activation_height, set_activation_height);

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

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

static DEVICE_ATTR(deactivate_slack, S_IWUSR | S_IRUGO, show_deactivate_slack,
		   set_deactivate_slack);

static struct attribute *sysfs_attrs[] =;

static const struct attribute_group ntrig_attribute_group =;

/*
 * this driver is aimed at two firmware versions in circulation:
 *  - dual pen/finger single touch
 *  - finger multitouch, pen not working
 */

static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi,
			       struct hid_field *field, struct hid_usage *usage,
			       unsigned long **bit, int *max)
{}

static int ntrig_input_mapped(struct hid_device *hdev, struct hid_input *hi,
			      struct hid_field *field, struct hid_usage *usage,
			      unsigned long **bit, int *max)
{}

/*
 * this function is called upon all reports
 * so that we can filter contact point information,
 * decide whether we are in multi or single touch mode
 * and call input_mt_sync after each point if necessary
 */
static int ntrig_event (struct hid_device *hid, struct hid_field *field,
			struct hid_usage *usage, __s32 value)
{}

static int ntrig_input_configured(struct hid_device *hid,
		struct hid_input *hidinput)

{}

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

static void ntrig_remove(struct hid_device *hdev)
{}

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

static const struct hid_usage_id ntrig_grabbed_usages[] =;

static struct hid_driver ntrig_driver =;
module_hid_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();