linux/drivers/hid/hid-kye.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  HID driver for Kye/Genius devices not fully compliant with HID standard
 *
 *  Copyright (c) 2009 Jiri Kosina
 *  Copyright (c) 2009 Tomas Hanak
 *  Copyright (c) 2012 Nikolai Kondrashov
 *  Copyright (c) 2023 David Yang
 */

#include <asm-generic/unaligned.h>
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

/* Data gathered from Database/VID0458_PID????/Vista/TBoard/default.xml in ioTablet driver
 *
 * TODO:
 *   - Add battery and sleep support for EasyPen M406W and MousePen M508WX
 *   - Investigate ScrollZ.MiceFMT buttons of EasyPen M406
 */

static const __u8 easypen_m406_control_rdesc[] =;

static const __u8 easypen_m506_control_rdesc[] =;

static const __u8 easypen_m406w_control_rdesc[] =;

static const __u8 easypen_m610x_control_rdesc[] =;

static const __u8 pensketch_m912_control_rdesc[] =;

static const __u8 mousepen_m508wx_control_rdesc[] =;

static const __u8 mousepen_m508x_control_rdesc[] =;

static const __u8 easypen_m406xe_control_rdesc[] =;

static const __u8 pensketch_t609a_control_rdesc[] =;

/* Fix indexes in kye_tablet_fixup() if you change this */
static const __u8 kye_tablet_rdesc[] =;

/* Fix indexes in kye_tablet_fixup() if you change this */
static const __u8 kye_tablet_mouse_rdesc[] =;

static const struct kye_tablet_info {} kye_tablets_info[] =;

static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize, int offset, const char *device_name)
{}

/*
 * Fix tablet descriptor of so-called "DataFormat 2".
 *
 * Though we may achieve a usable descriptor from original vendor-defined one,
 * some problems exist:
 *  - Their Logical Maximum never exceed 32767 (7F FF), though device do report
 *    values greater than that;
 *  - Physical Maximums are arbitrarily filled (always equal to Logical
 *    Maximum);
 *  - Detail for control buttons are not provided (a vendor-defined Usage Page
 *    with fixed content).
 *
 * Thus we use a pre-defined parameter table rather than digging it from
 * original descriptor.
 *
 * We may as well write a fallback routine for unrecognized kye tablet, but it's
 * clear kye are unlikely to produce new models in the foreseeable future, so we
 * simply enumerate all possible models.
 */
static __u8 *kye_tablet_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize)
{}

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

static int kye_tablet_enable(struct hid_device *hdev)
{}

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

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

static struct hid_driver kye_driver =;
module_hid_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();