HID: sony: Always override the Sixaxis descriptor
authorAntonio Ospite <ao2@ao2.it>
Tue, 24 Jun 2014 11:28:41 +0000 (13:28 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 25 Jun 2014 19:21:18 +0000 (21:21 +0200)
commitc607fb8d671693ddc699b56d18cbd185e4a91ad2
tree29dd819b4d2b40e445bf89d33006d054f982e15d
parent50764650c9e6e8498d273ad714f68ee8eec96692
HID: sony: Always override the Sixaxis descriptor

Simplify the logic of overriding the Sixaxis HID descriptor, this will
make it easier to amend the descriptor in future commits.

The current code does this:

if (original sixaxis via USB or BT)
fixup only a part of the descriptor
else if (sixaxis compatible controller)
override the _whole_ descriptor

but the end result is exactly the same, except for the trailing zero in
the case of original BT controllers.

So let's just regularize the process, and always override the HID
descriptor.

Always overriding the descriptor changes the current semantic a little
bit, before this change the BT descriptor still had the trailing zero
byte, while now it is exactly the same as the descriptor of the
controller via USB, but that does not affect proper operation of the
device.

Note that overriding the whole descriptor for original devices is not
strictly necessary for now, but it simplifies the code and in the future
the report descriptor will be patched further and keys will be remapped,
so it's handy to have only one place to patch.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c