linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] HID: sony: Adjust value range for motion sensors
@ 2016-10-06  2:18 Roderick Colenbrander
  2016-10-06  2:18 ` [PATCH 2/2] HID: sony: Update device ids Roderick Colenbrander
  0 siblings, 1 reply; 5+ messages in thread
From: Roderick Colenbrander @ 2016-10-06  2:18 UTC (permalink / raw)
  To: linux-input
  Cc: Benjamin Tissoires, Jiri Kosina, Tim Bird, Roderick Colenbrander

From: Roderick Colenbrander <roderick.colenbrander@sony.com>

The motion sensor values are 16-bit, so make the value range match.
It is hard to reach the upper values, but they can be reached. At
least the current accelerometer value of 8192 is very easy to pass.

It is still not nice that the motion sensors live in no man's land
in between ABS_MISC and ABS_MT_SLOT, but that's something for another
time, which the proposed ABS_ACCEL_*/ABS_GYRO_* were meant for.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.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 2387aaf..c9916cc 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -405,14 +405,14 @@ static u8 dualshock4_usb_rdesc[] = {
 	0x19, 0x40,         /*      Usage Minimum (40h),            */
 	0x29, 0x42,         /*      Usage Maximum (42h),            */
 	0x16, 0x00, 0x80,   /*      Logical Minimum (-32768),       */
-	0x26, 0x00, 0x7F,   /*      Logical Maximum (32767),        */
+	0x26, 0xFF, 0x7F,   /*      Logical Maximum (32767),        */
 	0x75, 0x10,         /*      Report Size (16),               */
 	0x95, 0x03,         /*      Report Count (3),               */
 	0x81, 0x02,         /*      Input (Variable),               */
 	0x19, 0x43,         /*      Usage Minimum (43h),            */
 	0x29, 0x45,         /*      Usage Maximum (45h),            */
-	0x16, 0x00, 0xE0,   /*      Logical Minimum (-8192),        */
-	0x26, 0xFF, 0x1F,   /*      Logical Maximum (8191),         */
+	0x16, 0x00, 0x80,   /*      Logical Minimum (-32768),       */
+	0x26, 0xFF, 0x7F,   /*      Logical Maximum (32767),        */
 	0x95, 0x03,         /*      Report Count (3),               */
 	0x81, 0x02,         /*      Input (Variable),               */
 	0x06, 0x00, 0xFF,   /*      Usage Page (FF00h),             */
@@ -714,14 +714,14 @@ static u8 dualshock4_bt_rdesc[] = {
 	0x19, 0x40,         /*      Usage Minimum (40h),            */
 	0x29, 0x42,         /*      Usage Maximum (42h),            */
 	0x16, 0x00, 0x80,   /*      Logical Minimum (-32768),       */
-	0x26, 0x00, 0x7F,   /*      Logical Maximum (32767),        */
+	0x26, 0xFF, 0x7F,   /*      Logical Maximum (32767),        */
 	0x75, 0x10,         /*      Report Size (16),               */
 	0x95, 0x03,         /*      Report Count (3),               */
 	0x81, 0x02,         /*      Input (Variable),               */
 	0x19, 0x43,         /*      Usage Minimum (43h),            */
 	0x29, 0x45,         /*      Usage Maximum (45h),            */
-	0x16, 0x00, 0xE0,   /*      Logical Minimum (-8192),        */
-	0x26, 0xFF, 0x1F,   /*      Logical Maximum (8191),         */
+	0x16, 0x00, 0x80,   /*      Logical Minimum (-32768),       */
+	0x26, 0xFF, 0x7F,   /*      Logical Maximum (32767),        */
 	0x95, 0x03,         /*      Report Count (3),               */
 	0x81, 0x02,         /*      Input (Variable),               */
 	0x06, 0x00, 0xFF,   /*      Usage Page (FF00h),             */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] HID: sony: Update device ids
  2016-10-06  2:18 [PATCH 1/2] HID: sony: Adjust value range for motion sensors Roderick Colenbrander
@ 2016-10-06  2:18 ` Roderick Colenbrander
  2016-10-06  4:09   ` Simon Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Roderick Colenbrander @ 2016-10-06  2:18 UTC (permalink / raw)
  To: linux-input
  Cc: Benjamin Tissoires, Jiri Kosina, Tim Bird, Roderick Colenbrander

From: Roderick Colenbrander <roderick.colenbrander@sony.com>

Support additional DS4 model.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
---
 drivers/hid/hid-ids.h  | 1 +
 drivers/hid/hid-sony.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index cd59c79..27f82cc 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -899,6 +899,7 @@
 #define USB_DEVICE_ID_SONY_PS3_BDREMOTE		0x0306
 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
 #define USB_DEVICE_ID_SONY_PS4_CONTROLLER	0x05c4
+#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2	0x09cc
 #define USB_DEVICE_ID_SONY_MOTION_CONTROLLER	0x03d5
 #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
 #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER		0x0002
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index c9916cc..3acdb68 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2639,6 +2639,10 @@ static const struct hid_device_id sony_devices[] = {
 		.driver_data = DUALSHOCK4_CONTROLLER_USB },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER),
 		.driver_data = DUALSHOCK4_CONTROLLER_BT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
+		.driver_data = DUALSHOCK4_CONTROLLER_USB },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
+		.driver_data = DUALSHOCK4_CONTROLLER_BT },
 	/* Nyko Core Controller for PS3 */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER),
 		.driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER },
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] HID: sony: Update device ids
  2016-10-06  2:18 ` [PATCH 2/2] HID: sony: Update device ids Roderick Colenbrander
@ 2016-10-06  4:09   ` Simon Wood
  2016-10-06  4:59     ` Roderick Colenbrander
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Wood @ 2016-10-06  4:09 UTC (permalink / raw)
  To: Roderick Colenbrander
  Cc: linux-input, Benjamin Tissoires, Jiri Kosina, Tim Bird,
	Roderick Colenbrander

On Wed, October 5, 2016 8:18 pm, Roderick Colenbrander wrote:
> From: Roderick Colenbrander <roderick.colenbrander@sony.com>
>
>
> Support additional DS4 model.
>
>
> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
> ---
> drivers/hid/hid-ids.h  | 1 + drivers/hid/hid-sony.c | 4 ++++ 2 files
> changed, 5 insertions(+)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index
> cd59c79..27f82cc 100644 --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -899,6 +899,7 @@
> #define USB_DEVICE_ID_SONY_PS3_BDREMOTE		0x0306
> #define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
> #define USB_DEVICE_ID_SONY_PS4_CONTROLLER	0x05c4
> +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2	0x09cc
> #define USB_DEVICE_ID_SONY_MOTION_CONTROLLER	0x03d5
> #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER	0x042f
> #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER		0x0002
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index
> c9916cc..3acdb68 100644 --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -2639,6 +2639,10 @@ static const struct hid_device_id sony_devices[] =
> {
> .driver_data = DUALSHOCK4_CONTROLLER_USB },
> { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
> USB_DEVICE_ID_SONY_PS4_CONTROLLER),
> .driver_data = DUALSHOCK4_CONTROLLER_BT },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY,
> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> +		.driver_data = DUALSHOCK4_CONTROLLER_USB },
> +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> +		.driver_data = DUALSHOCK4_CONTROLLER_BT },
> /* Nyko Core Controller for PS3 */
> { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE,
> USB_DEVICE_ID_SINO_LITE_CONTROLLER),
> .driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER },

I think you also need to patch hid-core.c, like:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-core.c?id=refs/tags/v4.8#n2057

Great that these patches are coming... thanks.
Simon


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] HID: sony: Update device ids
  2016-10-06  4:09   ` Simon Wood
@ 2016-10-06  4:59     ` Roderick Colenbrander
  2016-10-06 18:53       ` Roderick Colenbrander
  0 siblings, 1 reply; 5+ messages in thread
From: Roderick Colenbrander @ 2016-10-06  4:59 UTC (permalink / raw)
  To: Simon Wood
  Cc: linux-input, Benjamin Tissoires, Jiri Kosina, Tim Bird,
	Roderick Colenbrander

You are right wasn't aware of that. Easy to change tomorrow and will
send an updated version.

On Wed, Oct 5, 2016 at 9:09 PM, Simon Wood <simon@mungewell.org> wrote:
> On Wed, October 5, 2016 8:18 pm, Roderick Colenbrander wrote:
>> From: Roderick Colenbrander <roderick.colenbrander@sony.com>
>>
>>
>> Support additional DS4 model.
>>
>>
>> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
>> ---
>> drivers/hid/hid-ids.h  | 1 + drivers/hid/hid-sony.c | 4 ++++ 2 files
>> changed, 5 insertions(+)
>>
>> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index
>> cd59c79..27f82cc 100644 --- a/drivers/hid/hid-ids.h
>> +++ b/drivers/hid/hid-ids.h
>> @@ -899,6 +899,7 @@
>> #define USB_DEVICE_ID_SONY_PS3_BDREMOTE               0x0306
>> #define USB_DEVICE_ID_SONY_PS3_CONTROLLER     0x0268
>> #define USB_DEVICE_ID_SONY_PS4_CONTROLLER     0x05c4
>> +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2  0x09cc
>> #define USB_DEVICE_ID_SONY_MOTION_CONTROLLER  0x03d5
>> #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER      0x042f
>> #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER            0x0002
>> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index
>> c9916cc..3acdb68 100644 --- a/drivers/hid/hid-sony.c
>> +++ b/drivers/hid/hid-sony.c
>> @@ -2639,6 +2639,10 @@ static const struct hid_device_id sony_devices[] =
>> {
>> .driver_data = DUALSHOCK4_CONTROLLER_USB },
>> { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
>> USB_DEVICE_ID_SONY_PS4_CONTROLLER),
>> .driver_data = DUALSHOCK4_CONTROLLER_BT },
>> +     { HID_USB_DEVICE(USB_VENDOR_ID_SONY,
>> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
>> +             .driver_data = DUALSHOCK4_CONTROLLER_USB },
>> +     { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
>> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
>> +             .driver_data = DUALSHOCK4_CONTROLLER_BT },
>> /* Nyko Core Controller for PS3 */
>> { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE,
>> USB_DEVICE_ID_SINO_LITE_CONTROLLER),
>> .driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER },
>
> I think you also need to patch hid-core.c, like:
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-core.c?id=refs/tags/v4.8#n2057
>
> Great that these patches are coming... thanks.
> Simon
>



-- 
Roderick Colenbrander
Senior Manager of Software Engineering
Gaikai, a Sony Computer Entertainment Company
roderick@gaikai.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] HID: sony: Update device ids
  2016-10-06  4:59     ` Roderick Colenbrander
@ 2016-10-06 18:53       ` Roderick Colenbrander
  0 siblings, 0 replies; 5+ messages in thread
From: Roderick Colenbrander @ 2016-10-06 18:53 UTC (permalink / raw)
  To: Simon Wood
  Cc: linux-input, Benjamin Tissoires, Jiri Kosina, Tim Bird,
	Roderick Colenbrander

Resubmitted the patch with the hid-core changes.

On Wed, Oct 5, 2016 at 9:59 PM, Roderick Colenbrander
<roderick@gaikai.com> wrote:
>
> You are right wasn't aware of that. Easy to change tomorrow and will
> send an updated version.
>
> On Wed, Oct 5, 2016 at 9:09 PM, Simon Wood <simon@mungewell.org> wrote:
> > On Wed, October 5, 2016 8:18 pm, Roderick Colenbrander wrote:
> >> From: Roderick Colenbrander <roderick.colenbrander@sony.com>
> >>
> >>
> >> Support additional DS4 model.
> >>
> >>
> >> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
> >> ---
> >> drivers/hid/hid-ids.h  | 1 + drivers/hid/hid-sony.c | 4 ++++ 2 files
> >> changed, 5 insertions(+)
> >>
> >> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index
> >> cd59c79..27f82cc 100644 --- a/drivers/hid/hid-ids.h
> >> +++ b/drivers/hid/hid-ids.h
> >> @@ -899,6 +899,7 @@
> >> #define USB_DEVICE_ID_SONY_PS3_BDREMOTE               0x0306
> >> #define USB_DEVICE_ID_SONY_PS3_CONTROLLER     0x0268
> >> #define USB_DEVICE_ID_SONY_PS4_CONTROLLER     0x05c4
> >> +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2  0x09cc
> >> #define USB_DEVICE_ID_SONY_MOTION_CONTROLLER  0x03d5
> >> #define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER      0x042f
> >> #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER            0x0002
> >> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index
> >> c9916cc..3acdb68 100644 --- a/drivers/hid/hid-sony.c
> >> +++ b/drivers/hid/hid-sony.c
> >> @@ -2639,6 +2639,10 @@ static const struct hid_device_id sony_devices[] =
> >> {
> >> .driver_data = DUALSHOCK4_CONTROLLER_USB },
> >> { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
> >> USB_DEVICE_ID_SONY_PS4_CONTROLLER),
> >> .driver_data = DUALSHOCK4_CONTROLLER_BT },
> >> +     { HID_USB_DEVICE(USB_VENDOR_ID_SONY,
> >> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> >> +             .driver_data = DUALSHOCK4_CONTROLLER_USB },
> >> +     { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY,
> >> USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> >> +             .driver_data = DUALSHOCK4_CONTROLLER_BT },
> >> /* Nyko Core Controller for PS3 */
> >> { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE,
> >> USB_DEVICE_ID_SINO_LITE_CONTROLLER),
> >> .driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER },
> >
> > I think you also need to patch hid-core.c, like:
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-core.c?id=refs/tags/v4.8#n2057
> >
> > Great that these patches are coming... thanks.
> > Simon
> >
>
>
>
> --
> Roderick Colenbrander
> Senior Manager of Software Engineering
> Gaikai, a Sony Computer Entertainment Company
> roderick@gaikai.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-06 18:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-06  2:18 [PATCH 1/2] HID: sony: Adjust value range for motion sensors Roderick Colenbrander
2016-10-06  2:18 ` [PATCH 2/2] HID: sony: Update device ids Roderick Colenbrander
2016-10-06  4:09   ` Simon Wood
2016-10-06  4:59     ` Roderick Colenbrander
2016-10-06 18:53       ` Roderick Colenbrander

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).