Provide full hid, usbhid and uhid modules instead of a glue to the current hid

Kernels <2.6.38 are incompatible with some of the multitouch devices
which present a lot of fields in their report desriptor.
Instead of maintaining a glue to the current hid subsystem, just ship a
new and up to date one.

The code of hid-core.c hid-debug.c hid-input.c hid-multitouch.c hidraw.c
uhid.c and usbhid/* is synchronised with upstream.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
move uhid.c to uhid_compat.c

Just to avoid name clash with further modprobes

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Update install/uninstall scripts

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Compat: move headers under include

Also inline input_get_mt() and input_set_mt()

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
move compat layer from hid-multitouch to hid

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Use compat layers for input and mt

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
hidraw devices should be named hidraw-compatN

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Add missing headers from 3.10 for ealier kernels to compile

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
remove #if 0 block

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Be closer to upstream releases

- Use LINUX_BACKPORT in compat-input and compat-mt
- add struct input_dev field in struct __compat_input_dev to allow
  overriding of input_allocate_device, input_register_device and
  input_unregister_device so that it the compat layer is not seen from
  the caller.

This works for kernel 3.6

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Ship the real mt.h

stay closer to upstream for all the other files (no need to change the
includes).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Fix compile for kernel <3.9

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Fix compile for kernels <2.6.35

usb_buffer_alloc has been renamed into usb_alloc_coherent

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Allow hid-input to be compiled with older kernels

There has been quite some changes regarding hidinput_setkeycode and
hidinput_getkeycode in 2.6.35, 2.6.37 and 2.6.39. Include the different
versions to get a fully functional hid-input module.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Remove .group attrib for kernels before 3.5

Automatic detection of multitouch devices from hid generic can work
in kernels before 3.5 by using the patch introduced in 3.2:
b77c3920e90e96 "HID: add autodetection of multitouch devices"

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Add usbhid from 2.6.34 for earlier kernels

In 2.6.38 (at least) there has been changes regarding the usb
implementation. This is not the point of this backport, so found
a way for earlier kernels to compile.

Taking the 2.6.34 version as this is the last stable release before
the change.

Note that hiddev is removed as it is of no use here.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Makefile: fix builds when some symbols are not defined

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Update few headers

- add uhid.h in include/linux for compatibility with older kernels
- remove include/linux/hiddev.h as hiddev as been killed

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Fix ABS_MT_FIRST and ABS_MT_LAST definitions

If the kernel already contains some ABS_MT_* definitions, FIRST
and LAST are not correctly set.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
compat-input: fix add_input_randomness call

random.h was missing for earlier kernels

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>