linux/drivers/hid/hid-waltop.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  HID driver for Waltop devices not fully compliant with HID standard
 *
 *  Copyright (c) 2010 Nikolai Kondrashov
 */

/*
 */

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

/*
 * There exists an official driver on the manufacturer's website, which
 * wasn't submitted to the kernel, for some reason. The official driver
 * doesn't seem to support extra features of some tablets, like wheels.
 *
 * It shows that the feature report ID 2 could be used to control any waltop
 * tablet input mode, switching it between "default", "tablet" and "ink".
 *
 * This driver only uses "default" mode for all the supported tablets. This
 * mode tries to be HID-compatible (not very successfully), but cripples the
 * resolution of some tablets.
 *
 * The "tablet" mode uses some proprietary, yet decipherable protocol, which
 * represents the correct resolution, but is possibly HID-incompatible (i.e.
 * indescribable by a report descriptor).
 *
 * The purpose of the "ink" mode is unknown.
 *
 * The feature reports needed for switching to each mode are these:
 *
 * 02 16 00     default
 * 02 16 01     tablet
 * 02 16 02     ink
 */

/* Size of the original report descriptor of Slim Tablet 5.8 inch */
#define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE

/* Fixed Slim Tablet 5.8 inch descriptor */
static __u8 slim_tablet_5_8_inch_rdesc_fixed[] =;

/* Size of the original report descriptor of Slim Tablet 12.1 inch */
#define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE

/* Fixed Slim Tablet 12.1 inch descriptor */
static __u8 slim_tablet_12_1_inch_rdesc_fixed[] =;

/* Size of the original report descriptor of Q Pad */
#define Q_PAD_RDESC_ORIG_SIZE

/* Fixed Q Pad descriptor */
static __u8 q_pad_rdesc_fixed[] =;

/* Size of the original report descriptor of tablet with PID 0038 */
#define PID_0038_RDESC_ORIG_SIZE

/*
 * Fixed report descriptor for tablet with PID 0038.
 */
static __u8 pid_0038_rdesc_fixed[] =;

/* Size of the original report descriptor of Media Tablet 10.6 inch */
#define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE

/* Fixed Media Tablet 10.6 inch descriptor */
static __u8 media_tablet_10_6_inch_rdesc_fixed[] =;

/* Size of the original report descriptor of Media Tablet 14.1 inch */
#define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE

/* Fixed Media Tablet 14.1 inch descriptor */
static __u8 media_tablet_14_1_inch_rdesc_fixed[] =;

/* Size of the original report descriptor of Sirius Battery Free Tablet */
#define SIRIUS_BATTERY_FREE_TABLET_RDESC_ORIG_SIZE

/* Fixed Sirius Battery Free Tablet descriptor */
static __u8 sirius_battery_free_tablet_rdesc_fixed[] =;

static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{}

static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report,
		     u8 *data, int size)
{}

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

static struct hid_driver waltop_driver =;
module_hid_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();