* [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor
@ 2014-09-14 15:56 Frank Praznik
2014-09-14 15:56 ` [PATCH 2/2] hid: sony: Update file header and correct comments Frank Praznik
2014-09-15 11:53 ` [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: Frank Praznik @ 2014-09-14 15:56 UTC (permalink / raw)
To: linux-input; +Cc: jkosina, Frank Praznik
Fix a few minor issues in the HID descriptor:
- A 6 bit entry had a logical maximum of 255 when the largest it can be is 63.
- A logical max value was incorrectly being set to -1 instead of 255.
- Set the min/max of the gyroscopes to -8192/8191 as that is the range of
values which represent the true controller orientation. Any values beyond
those extents are just noise.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
---
drivers/hid/hid-sony.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index ecc6616..75da56d 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -176,7 +176,7 @@ static u8 dualshock4_usb_rdesc[] = {
0x75, 0x06, /* Report Size (6), */
0x95, 0x01, /* Report Count (1), */
0x15, 0x00, /* Logical Minimum (0), */
- 0x25, 0x7F, /* Logical Maximum (127), */
+ 0x25, 0x3F, /* Logical Maximum (63), */
0x81, 0x02, /* Input (Variable), */
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x33, /* Usage (Rx), */
@@ -200,14 +200,14 @@ static u8 dualshock4_usb_rdesc[] = {
0x81, 0x02, /* Input (Variable), */
0x19, 0x43, /* Usage Minimum (43h), */
0x29, 0x45, /* Usage Maximum (45h), */
- 0x16, 0xFF, 0xBF, /* Logical Minimum (-16385), */
- 0x26, 0x00, 0x40, /* Logical Maximum (16384), */
+ 0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */
+ 0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */
0x95, 0x03, /* Report Count (3), */
0x81, 0x02, /* Input (Variable), */
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
0x09, 0x21, /* Usage (21h), */
0x15, 0x00, /* Logical Minimum (0), */
- 0x25, 0xFF, /* Logical Maximum (255), */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x27, /* Report Count (39), */
0x81, 0x02, /* Input (Variable), */
@@ -509,8 +509,8 @@ static u8 dualshock4_bt_rdesc[] = {
0x81, 0x02, /* Input (Variable), */
0x19, 0x43, /* Usage Minimum (43h), */
0x29, 0x45, /* Usage Maximum (45h), */
- 0x16, 0xFF, 0xBF, /* Logical Minimum (-16385), */
- 0x26, 0x00, 0x40, /* Logical Maximum (16384), */
+ 0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */
+ 0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */
0x95, 0x03, /* Report Count (3), */
0x81, 0x02, /* Input (Variable), */
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] hid: sony: Update file header and correct comments
2014-09-14 15:56 [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Frank Praznik
@ 2014-09-14 15:56 ` Frank Praznik
2014-09-15 11:53 ` [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Frank Praznik @ 2014-09-14 15:56 UTC (permalink / raw)
To: linux-input; +Cc: jkosina, Frank Praznik
Update the file header and correct an outdated comment block.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
---
drivers/hid/hid-sony.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 75da56d..96a8ec5 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1,5 +1,5 @@
/*
- * HID driver for Sony / PS2 / PS3 BD devices.
+ * HID driver for Sony / PS2 / PS3 / PS4 BD devices.
*
* Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
@@ -8,6 +8,7 @@
* Copyright (c) 2012 David Dillow <dave@thedillows.org>
* Copyright (c) 2006-2013 Jiri Kosina
* Copyright (c) 2013 Colin Leitner <colin.leitner@gmail.com>
+ * Copyright (c) 2014 Frank Praznik <frank.praznik@gmail.com>
*/
/*
@@ -395,11 +396,11 @@ static u8 dualshock4_usb_rdesc[] = {
/*
* The default behavior of the Dualshock 4 is to send reports using report
- * type 1 when running over Bluetooth. However, as soon as it receives a
- * report of type 17 to set the LEDs or rumble it starts returning it's state
- * in report 17 instead of 1. Since report 17 is undefined in the default HID
+ * type 1 when running over Bluetooth. However, when feature report 2 is
+ * requested during the controller initialization it starts sending input
+ * reports in report 17. Since report 17 is undefined in the default HID
* descriptor the button and axis definitions must be moved to report 17 or
- * the HID layer won't process the received input once a report is sent.
+ * the HID layer won't process the received input.
*/
static u8 dualshock4_bt_rdesc[] = {
0x05, 0x01, /* Usage Page (Desktop), */
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor
2014-09-14 15:56 [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Frank Praznik
2014-09-14 15:56 ` [PATCH 2/2] hid: sony: Update file header and correct comments Frank Praznik
@ 2014-09-15 11:53 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2014-09-15 11:53 UTC (permalink / raw)
To: Frank Praznik; +Cc: linux-input
On Sun, 14 Sep 2014, Frank Praznik wrote:
> Fix a few minor issues in the HID descriptor:
> - A 6 bit entry had a logical maximum of 255 when the largest it can be is 63.
> - A logical max value was incorrectly being set to -1 instead of 255.
> - Set the min/max of the gyroscopes to -8192/8191 as that is the range of
> values which represent the true controller orientation. Any values beyond
> those extents are just noise.
>
> Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Both applied to for-3.18/sony. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-15 11:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 15:56 [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Frank Praznik
2014-09-14 15:56 ` [PATCH 2/2] hid: sony: Update file header and correct comments Frank Praznik
2014-09-15 11:53 ` [PATCH 1/2] hid: sony: Corrections for the DualShock 4 HID descriptor Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).