History log of /drivers/hid/hid-sony.c
Revision Date Author Comments
c9e4d87758e95ef9d78a7767e2405ebaf54adcd8 10-Jun-2011 Simon Wood <simon@mungewell.org> HID: hid-sony: fix endiannes of Sixaxis accel/gyro values

The accelerometers/gyro on the Sixaxis are reported in the wrong
endianness (ie. not compatible with HID), so this patch intercepts
the report and swaps the appropriate bytes over.

Accelerometers are scaled with a nominal value of +/-4000 = 1G,
maximum value would be around +/-32768 = 8G.

Gyro on my device always reports -32768, might need some calibration
set within the controller.

Fix extracted from previous patch submission:
https://patchwork.kernel.org/patch/95212/

Signed-off-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
61ab44bebdefab296487e7cd723a634849278827 10-Jun-2011 Simon Wood <simon@mungewell.org> HID: hid-sony: amend Sixaxis descriptor to enable accelerometers

Modify the HID descriptor of the Sixaxis controller to allow the
reporting of the accelerometers and gyro via a joystick axis.

Rewrite section from offset 83:
--
0x75, 0x08, /* Report Size (8), */
/* all the other data lumped together */
0x95, 0x27, /* Report Count (39), */
0x09, 0x01, /* Usage (Pointer), */
0x81, 0x02, /* Input (Variable), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x30, /* Report Count (48), */
0x09, 0x01, /* Usage (Pointer), */
/* Note Output */
0x91, 0x02, /* Output (Variable), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x30, /* Report Count (48), */
0x09, 0x01, /* Usage (Pointer), */
/* Note Feature */
0xB1, 0x02, /* Feature (Variable), */
--
with
--
/* last 2 not used... */
0x95, 0x13, /* Report Count (19), */
0x09, 0x01, /* Usage (Pointer), */
0x81, 0x02, /* Input (Variable), */
/* Padding */
0x95, 0x0C, /* Report Count (12), */
0x81, 0x01, /* Input (Constant), */
0x75, 0x10, /* Report Size (16), */
0x95, 0x04, /* Report Count (4), */
0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
0x46, 0xFF, 0x03, /* Physical Maximum (1023), */
0x09, 0x01, /* Usage (Pointer), */
0x81, 0x02, /* Input (Variable), */
--

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
35dca5b4a67a93bbb75c2753d6dc432dc8f82e5d 28-Apr-2011 Jiri Kosina <jkosina@suse.cz> HID: add support for Sony Navigation Controller

Sony Navigation Controller needs a special report to be sent to it
before it is able to operate, the same way as other Sony controllers
do.

Tested-by: Jacek Lukas Wotka <jlw@team-fatal.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5710fabf315efcd53c54ad4ecc6158f2964745e3 20-Feb-2011 Antonio Ospite <ospite@studenti.unina.it> HID: hid-sony.c: Fix sending Output reports to the Sixaxis

The Sixaxis does not want the report_id as part of the data packet in
Output reports, so we have to discard buf[0] when sending the actual
control message.

Add also some documentation about that and about why
hdev->hid_output_raw_report needs to be overridden.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4291ee305e9bb0699504a66f0e2b7aefcf0512a5 10-Dec-2010 Joe Perches <joe@perches.com> HID: Add and use hid_<level>: dev_<level> equivalents

Neaten current uses of dev_<level> by adding and using
hid specific hid_<level> macros.

Convert existing uses of dev_<level> uses to hid_<level>.
Convert hid-pidff printk uses to hid_<level>.

Remove err_hid and use hid_err instead.

Add missing newlines to logging messages where necessary.
Coalesce format strings.

Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Other miscellaneous changes:

Add const struct hid_device * argument to hid-core functions
extract() and implement() so hid_<level> can be used by them.
Fix bad indentation in hid-core hid_input_field function
that calls extract() function above.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
569b10a506c4d5bc7398d040930539d84d3a2186 19-Oct-2010 Antonio Ospite <ospite@studenti.unina.it> HID: hid-sony: override usbhid_output_raw_report for Sixaxis

Override usbhid_output_raw_report in order to force output reports (sent
via hidraw_write, for instance) on the control endpoint.

The Sony Sixaxis (PS3 Controller) accepts output reports only on the
control endpoint, it silently discards them when they arrive over the
interrupt endpoint where usbhid would normally deliver them.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
816651a7d4a32664261e5f9f88ad0d558faed4cc 03-May-2010 Antonio Ospite <ospite@studenti.unina.it> HID: sony: Apply sixaxis quirks only to sixaxis

Be more explicit and avoid calling sony_set_operational_usb() when we
have USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE.

While at it, rename the sony_set_operational routines to
sixaxis_set_operational as they are sixaxis specific.

This is also in preparation for the sysfs interface to set and get bdaddr
over usb and for some other Sixaxis report fixup.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
73e4008ddddc84d5f2499c17012b340a0dae153e 06-Aug-2010 Nikolai Kondrashov <spbnick@gmail.com> HID: allow resizing and replacing report descriptors

Update hid_driver's report_fixup prototype to allow changing report
descriptor size and/or returning completely different report descriptor.
Update existing usage accordingly.

This is to give more freedom in descriptor fixup and to allow having a whole
fixed descriptor in the code for the sake of readability.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fddb33f2e8872fa4857dd29f0b71a523c9ed5577 03-May-2010 Antonio Ospite <ospite@studenti.unina.it> HID: sony: fix sony_set_operational_bt

Don't send the report type as part of the data, this prevents the
controller from going into the operational state at all.

This is completely equivalent to what the code originally meant to accomplish:
as per in net/bluetooth/hidp/core.c::hidp_output_raw_report(), by using
HID_FEATURE_REPORT here, what will be actually sent is
(HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE) which is exactly 0x53.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
eabe5c90580a065aed8ce6a5ba53eb443d317fae 09-Feb-2010 Bastien Nocera <hadess@hadess.net> HID: fix typo in error message

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
f9ce7c283c16538955d5d094101889792bcde109 20-Jan-2010 Bastien Nocera <hadess@hadess.net> HID: Enable Sixaxis controller over Bluetooth

Now that hid_output_raw_report works, port the PS3 Sixaxis
Bluetooth quirk from user-space, into kernel-space.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a24f423bdf253ccee369adc6c5451b40a0716fbb 02-Jul-2009 Peter Huewe <peterhuewe@gmx.de> HID: adding __init/__exit macros to module init/exit functions

Trivial patch which adds the __init and __exit macros to the module_init /
module_exit functions of several HID drivers from drivers/hid/

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
afa5eb7c68689ced4284f01c96feed44a2d0a127 18-Mar-2009 Jiri Slaby <jirislaby@gmail.com> HID: remove compat stuff

This removal was scheduled and there is no problem with later
distros to adapt for the new bus, thanks to aliases.

module-init-tools map files are deprecated nowadays, so that
the patch which introduced hid ones into the m-i-t won't be
accepted and hence there is no reason for leaving compat stuff in.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
4dfdc46468a142216b284eea66040f49df3f7191 30-Dec-2008 Jiri Kosina <jkosina@suse.cz> HID: fix error condition propagation in hid-sony driver

sony_set_operational() only propagates return value from
usb_control_msg(), which returns negative on error and number
of transferred bytes otherwise.

Reported-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
cc6e0bbb47f02fd36cd55b3189c0c79079096ab8 23-Oct-2008 Jiri Kosina <jkosina@suse.cz> HID: Add support for Sony Vaio VGX-TP1E

The Sony Vaio VGX-TP1E multimedia PC has a wireless keyboard with
a touchpad.

The mouse pointer is wrongly declared as constant non-data variable, which make
HID code to completely ignore all the "Pointer" usages.
Fix the report descriptor before it enters the parser to contain touchpad
pointer description that is correctly parsable (declaring data rather than
constant).

Reported-by: Stefan Hundhammer <sh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
93c10132a7ac160df3175b53f7ee857625412165 27-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move connect quirks

Move connecting from usbhid to the hid layer and fix also hidp in
that manner.
This removes all the ignore/force hidinput/hiddev connecting quirks.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
bd28ce008bdc68ef5902f68d2d62cbb7fa78c415 25-Jun-2008 Jiri Slaby <jirislaby@gmail.com> HID: move sony quirks

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>