Re: Sony DualShock3 - Detected but no events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 10 Nov 2011 00:16:54 +0200
Alon Bar-Lev <alon.barlev@xxxxxxxxx> wrote:

> Got real sony device.
> USB is working!
> Thanks for your help.

Ah, so it was a (not so much) compatible controller, wasn't it?

Can you test the attached patch to see it it makes the non-Sony device
work too? Some other user reported a compatible controller not sending
events, and it turned out that to be made operational it was expecting
the interrupt endpoint to be queried at least once. I don't see this
behavior in USB dumps of communication with PS3 tho.

> Is there anywhere organized I can fetch the bluez patches?
> 

I will send them to you off-list.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 5cd25bd..95355e0 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -131,6 +131,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
 	__u16 ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
 	int ret;
 	char *buf = kmalloc(18, GFP_KERNEL);
+	unsigned char buf2[] = { 0x00 };
+	int transfered;
 
 	if (!buf)
 		return -ENOMEM;
@@ -142,7 +144,15 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
 				 (3 << 8) | 0xf2, ifnum, buf, 17,
 				 USB_CTRL_GET_TIMEOUT);
 	if (ret < 0)
-		hid_err(hdev, "can't set operational mode\n");
+		hid_err(hdev, "can't set operational mode on the Control EP\n");
+
+	/* Some compatible controllers like the Speedlink Strike FX need a
+	 * write tothe Interrupt EP to get opertional */
+	ret = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x02),
+	                         buf2, sizeof(buf2),
+				 &transfered, USB_CTRL_SET_TIMEOUT);
+	if (ret < 0)
+		dev_err(&hdev->dev, "can't set operational mode on the Interrupt EP\n");
 
 	kfree(buf);
 

Attachment: pgpuu9Jre1YSW.pgp
Description: PGP signature


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux