brintos

brintos / linux-shallow public Read only

0
0
Text · 1.5 KiB · 03f7dd4 Raw
57 lines · c
1// SPDX-License-Identifier: GPL-2.0-or-later2/*3 *  USB HID quirks support for Network Technologies, Inc. "USB-SUN" USB4 *  adapter for pre-USB Sun keyboards5 *6 *  Copyright (c) 2011 Google, Inc.7 *8 * Based on HID apple driver by9 *  Copyright (c) 1999 Andreas Gal10 *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>11 *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc12 *  Copyright (c) 2006-2007 Jiri Kosina13 *  Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>14 */15 16/*17 */18 19#include <linux/device.h>20#include <linux/input.h>21#include <linux/hid.h>22#include <linux/module.h>23 24#include "hid-ids.h"25 26MODULE_AUTHOR("Jonathan Klabunde Tomer <jktomer@google.com>");27MODULE_DESCRIPTION("HID driver for Network Technologies USB-SUN keyboard adapter");28 29/*30 * NTI Sun keyboard adapter has wrong logical maximum in report descriptor31 */32static const __u8 *nti_usbsun_report_fixup(struct hid_device *hdev, __u8 *rdesc,33		unsigned int *rsize)34{35	if (*rsize >= 60 && rdesc[53] == 0x65 && rdesc[59] == 0x65) {36		hid_info(hdev, "fixing up NTI USB-SUN keyboard adapter report descriptor\n");37		rdesc[53] = rdesc[59] = 0xe7;38	}39	return rdesc;40}41 42static const struct hid_device_id nti_devices[] = {43	{ HID_USB_DEVICE(USB_VENDOR_ID_NTI, USB_DEVICE_ID_USB_SUN) },44	{ }45};46MODULE_DEVICE_TABLE(hid, nti_devices);47 48static struct hid_driver nti_driver = {49	.name = "nti",50	.id_table = nti_devices,51	.report_fixup = nti_usbsun_report_fixup52};53 54module_hid_driver(nti_driver);55 56MODULE_LICENSE("GPL");57