mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 21:52:04 +00:00
9d262f35b1
make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-a4tech.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-apple.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-aureal.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-belkin.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-betopff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-bigbenff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-cherry.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-chicony.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-cypress.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-dr.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-emsff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-elecom.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-elo.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-evision.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-ezkey.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-vivaldi-common.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-google-hammer.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-google-stadiaff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-gyration.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-holtek-kbd.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-holtek-mouse.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-ite.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-kensington.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-keytouch.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-kye.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-lcpower.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-lenovo.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-logitech.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-magicmouse.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-maltron.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-mf.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-megaworld.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-microsoft.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-monterey.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-ntrig.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-ortek.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-prodikeys.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-pl.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-petalynx.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-primax.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-razer.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-redragon.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-retrode.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-saitek.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-samsung.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-semitek.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-sjoy.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-sony.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-speedlink.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-steam.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-steelseries.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-sunplus.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-gaff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-tmff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-tivo.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-topseed.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-twinhan.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-uclogic.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-xinmo.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-zpff.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-zydacron.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-viewsonic.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-waltop.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-winwing.o Add the missing invocations of the MODULE_DESCRIPTION() macro. Note: All HID drivers that had explicit entries in the MAINTAINERS file were fixed individually. This patch fixes all remaining HID drivers that fall under the generic "HID CORE LAYER" entry in the MAINTAINERS file. Almost all descriptions were taken from the header comment in each file. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20240604-md-hid-misc-v1-1-4f9560796f3c@quicinc.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
167 lines
8.2 KiB
C
167 lines
8.2 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* HID driver for Maltron L90
|
|
*
|
|
* Copyright (c) 1999 Andreas Gal
|
|
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
|
|
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
|
|
* Copyright (c) 2008 Jiri Slaby
|
|
* Copyright (c) 2012 David Dillow <dave@thedillows.org>
|
|
* Copyright (c) 2006-2013 Jiri Kosina
|
|
* Copyright (c) 2013 Colin Leitner <colin.leitner@gmail.com>
|
|
* Copyright (c) 2014-2016 Frank Praznik <frank.praznik@gmail.com>
|
|
* Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
|
|
* Copyright (c) 2016 Yuxuan Shui <yshuiv7@gmail.com>
|
|
* Copyright (c) 2018 William Whistler <wtbw@wtbw.co.uk>
|
|
*/
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/hid.h>
|
|
#include <linux/module.h>
|
|
|
|
#include "hid-ids.h"
|
|
|
|
/* The original buggy USB descriptor */
|
|
static u8 maltron_rdesc_o[] = {
|
|
0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
|
|
0x09, 0x80, /* Usage (Sys Control) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x02, /* Report ID (2) */
|
|
0x75, 0x01, /* Report Size (1) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x15, 0x00, /* Logical Minimum (0) */
|
|
0x25, 0x01, /* Logical Maximum (1) */
|
|
0x09, 0x82, /* Usage (Sys Sleep) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x09, 0x82, /* Usage (Sys Sleep) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x09, 0x83, /* Usage (Sys Wake Up) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x75, 0x05, /* Report Size (5) */
|
|
0x81, 0x01, /* Input (Const,Array,Abs) */
|
|
0xC0, /* End Collection */
|
|
0x05, 0x0C, /* Usage Page (Consumer) */
|
|
0x09, 0x01, /* Usage (Consumer Control) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x03, /* Report ID (3) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x75, 0x10, /* Report Size (16) */
|
|
0x19, 0x00, /* Usage Minimum (Unassigned) */
|
|
0x2A, 0xFF, 0x7F, /* Usage Maximum (0x7FFF) */
|
|
0x81, 0x00, /* Input (Data,Array,Abs) */
|
|
0xC0, /* End Collection */
|
|
0x06, 0x7F, 0xFF, /* Usage Page (Vendor Defined 0xFF7F) */
|
|
0x09, 0x01, /* Usage (0x01) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x04, /* Report ID (4) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x75, 0x10, /* Report Size (16) */
|
|
0x19, 0x00, /* Usage Minimum (0x00) */
|
|
0x2A, 0xFF, 0x7F, /* Usage Maximum (0x7FFF) */
|
|
0x81, 0x00, /* Input (Data,Array,Abs) */
|
|
0x75, 0x02, /* Report Size (2) */
|
|
0x25, 0x02, /* Logical Maximum (2) */
|
|
0x09, 0x90, /* Usage (0x90) */
|
|
0xB1, 0x02, /* Feature (Data,Var,Abs) */
|
|
0x75, 0x06, /* Report Size (6) */
|
|
0xB1, 0x01, /* Feature (Const,Array,Abs) */
|
|
0x75, 0x01, /* Report Size (1) */
|
|
0x25, 0x01, /* Logical Maximum (1) */
|
|
0x05, 0x08, /* Usage Page (LEDs) */
|
|
0x09, 0x2A, /* Usage (On-Line) */
|
|
0x91, 0x02, /* Output (Data,Var,Abs) */
|
|
0x09, 0x4B, /* Usage (Generic Indicator) */
|
|
0x91, 0x02, /* Output (Data,Var,Abs) */
|
|
0x75, 0x06, /* Report Size (6) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x91, 0x01, /* Output (Const,Array,Abs) */
|
|
0xC0 /* End Collection */
|
|
};
|
|
|
|
/* The patched descriptor, allowing media key events to be accepted as valid */
|
|
static u8 maltron_rdesc[] = {
|
|
0x05, 0x01, /* Usage Page (Generic Desktop Ctrls) */
|
|
0x09, 0x80, /* Usage (Sys Control) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x02, /* Report ID (2) */
|
|
0x75, 0x01, /* Report Size (1) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x15, 0x00, /* Logical Minimum (0) */
|
|
0x25, 0x01, /* Logical Maximum (1) */
|
|
0x09, 0x82, /* Usage (Sys Sleep) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x09, 0x82, /* Usage (Sys Sleep) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x09, 0x83, /* Usage (Sys Wake Up) */
|
|
0x81, 0x06, /* Input (Data,Var,Rel) */
|
|
0x75, 0x05, /* Report Size (5) */
|
|
0x81, 0x01, /* Input (Const,Array,Abs) */
|
|
0xC0, /* End Collection */
|
|
0x05, 0x0C, /* Usage Page (Consumer) */
|
|
0x09, 0x01, /* Usage (Consumer Control) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x03, /* Report ID (3) */
|
|
0x15, 0x00, /* Logical Minimum (0) - changed */
|
|
0x26, 0xFF, 0x7F, /* Logical Maximum (32767) - changed */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x75, 0x10, /* Report Size (16) */
|
|
0x19, 0x00, /* Usage Minimum (Unassigned) */
|
|
0x2A, 0xFF, 0x7F, /* Usage Maximum (0x7FFF) */
|
|
0x81, 0x00, /* Input (Data,Array,Abs) */
|
|
0xC0, /* End Collection */
|
|
0x06, 0x7F, 0xFF, /* Usage Page (Vendor Defined 0xFF7F) */
|
|
0x09, 0x01, /* Usage (0x01) */
|
|
0xA1, 0x01, /* Collection (Application) */
|
|
0x85, 0x04, /* Report ID (4) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x75, 0x10, /* Report Size (16) */
|
|
0x19, 0x00, /* Usage Minimum (0x00) */
|
|
0x2A, 0xFF, 0x7F, /* Usage Maximum (0x7FFF) */
|
|
0x81, 0x00, /* Input (Data,Array,Abs) */
|
|
0x75, 0x02, /* Report Size (2) */
|
|
0x25, 0x02, /* Logical Maximum (2) */
|
|
0x09, 0x90, /* Usage (0x90) */
|
|
0xB1, 0x02, /* Feature (Data,Var,Abs) */
|
|
0x75, 0x06, /* Report Size (6) */
|
|
0xB1, 0x01, /* Feature (Const,Array,Abs) */
|
|
0x75, 0x01, /* Report Size (1) */
|
|
0x25, 0x01, /* Logical Maximum (1) */
|
|
0x05, 0x08, /* Usage Page (LEDs) */
|
|
0x09, 0x2A, /* Usage (On-Line) */
|
|
0x91, 0x02, /* Output (Data,Var,Abs) */
|
|
0x09, 0x4B, /* Usage (Generic Indicator) */
|
|
0x91, 0x02, /* Output (Data,Var,Abs) */
|
|
0x75, 0x06, /* Report Size (6) */
|
|
0x95, 0x01, /* Report Count (1) */
|
|
0x91, 0x01, /* Output (Const,Array,Abs) */
|
|
0xC0 /* End Collection */
|
|
};
|
|
|
|
static __u8 *maltron_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
|
unsigned int *rsize)
|
|
{
|
|
if (*rsize == sizeof(maltron_rdesc_o) &&
|
|
!memcmp(maltron_rdesc_o, rdesc, sizeof(maltron_rdesc_o))) {
|
|
hid_info(hdev, "Replacing Maltron L90 keyboard report descriptor\n");
|
|
*rsize = sizeof(maltron_rdesc);
|
|
return maltron_rdesc;
|
|
}
|
|
return rdesc;
|
|
}
|
|
|
|
static const struct hid_device_id maltron_devices[] = {
|
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_MALTRON_KB)},
|
|
{ }
|
|
};
|
|
MODULE_DEVICE_TABLE(hid, maltron_devices);
|
|
|
|
static struct hid_driver maltron_driver = {
|
|
.name = "maltron",
|
|
.id_table = maltron_devices,
|
|
.report_fixup = maltron_report_fixup
|
|
};
|
|
module_hid_driver(maltron_driver);
|
|
|
|
MODULE_DESCRIPTION("HID driver for Maltron L90");
|
|
MODULE_LICENSE("GPL");
|