linux/drivers/hid/hid-keytouch.c
<<
>>
Prefs
   1/*
   2 *  HID driver for Keytouch devices not fully compliant with HID standard
   3 *
   4 *  Copyright (c) 2011 Jiri Kosina
   5 */
   6
   7/*
   8 * This program is free software; you can redistribute it and/or modify it
   9 * under the terms of the GNU General Public License as published by the Free
  10 * Software Foundation; either version 2 of the License, or (at your option)
  11 * any later version.
  12 */
  13
  14#include <linux/device.h>
  15#include <linux/hid.h>
  16#include <linux/module.h>
  17
  18#include "hid-ids.h"
  19
  20/* Replace the broken report descriptor of this device with rather
  21 * a default one */
  22static __u8 keytouch_fixed_rdesc[] = {
  230x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7, 0x15,
  240x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, 0x75, 0x08,
  250x81, 0x01, 0x95, 0x03, 0x75, 0x01, 0x05, 0x08, 0x19, 0x01, 0x29, 0x03, 0x91,
  260x02, 0x95, 0x05, 0x75, 0x01, 0x91, 0x01, 0x95, 0x06, 0x75, 0x08, 0x15, 0x00,
  270x26, 0xff, 0x00, 0x05, 0x07, 0x19, 0x00, 0x2a, 0xff, 0x00, 0x81, 0x00, 0xc0
  28};
  29
  30static __u8 *keytouch_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  31                unsigned int *rsize)
  32{
  33        hid_info(hdev, "fixing up Keytouch IEC report descriptor\n");
  34
  35        rdesc = keytouch_fixed_rdesc;
  36        *rsize = sizeof(keytouch_fixed_rdesc);
  37
  38        return rdesc;
  39}
  40
  41static const struct hid_device_id keytouch_devices[] = {
  42        { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
  43        { }
  44};
  45MODULE_DEVICE_TABLE(hid, keytouch_devices);
  46
  47static struct hid_driver keytouch_driver = {
  48        Generals="line" name="L48">  48        Gestatic struE_TABLE" class="sref">MODULEa>      m2(  39}
  48  ="+tabl   Gestatic ="+tabl =keytouch_fixed_rdesc" class="s>keytouch_devices);
  40
  48  sref">keytouch_report_fixupct keytouch_report_fixup(struct   41static co5st st51rs/hid/hid-keytouch.c#L45" id="L45" class="l5ne" name5"L42">  42        {5  43        {5}
__u8inita> *inita> *initid" cvoidd/hid-keytouch.c#L32" id="L32" class="l5ne" name5"L44">  44};
   5rf="+register>hid_driver keytouch_driver = {
  46
  47static st5uct <5s/hid/hid-keytouch.c#L38" id="L38" class="l5ne" name5"L48">  48        G5neral58href="+codevoideclass="sref">__u8exita> *exita> *exitid" cvoidd/hid-keytouch.c#L32" id="L32" class="l5ne" name5"L39">  39}
  40
rf="+unregister>hid_driver keytouch_driver = {
  41static co6st st61s/hid/hid-keytouch.c#L40" id="L40" class="l6ne" name6"L42">  42        {6  43        {6}
hids="sref">inita> *initid" id/hid-keytouch.c#L46" id="L46" class="l6ne" name6"L44">  44};
hids="sref">exita> *exitid" id/hid-keytouch.c#L46" id="L46" class="l6e" name=6"L5">   5(MODULEa>    GPLef="drivers/hid/hid-keytouch.c#L34" id="L34" class="l6e" name=""L6">   6
MODULEa>     href="drivef="drivers/hid/hid-keytouch.c#L34" id="L34" class="l6ne" name6"L47">  47static st6uct <6ment">/pre  
    <

ent">

&quooter"> The origrivl LXRdistributa href="hid-keytohttp://sourceforge.net/projects/lxr">LXRd oneunitykeytouerlxr@; div ih&qsubuooter"> lxr.; Redpill L