linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hidraw, sixaxis and output reports.
@ 2010-10-02 15:59 Antonio Ospite
  2010-10-04 13:58 ` Alan Ott
  0 siblings, 1 reply; 13+ messages in thread
From: Antonio Ospite @ 2010-10-02 15:59 UTC (permalink / raw)
  To: linux-input
  Cc: Alan Ott, Jiri Kosina, Jim Paris, Ranulf Doswell,
	fMikko Virkkilä, alktx

[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]

Hi,

I am trying to set leds on sixaxis now, and the code I have works OK
with libusb, but the equivalent for hidraw does not.

The procedure to set leds is to send an output report 0x01 with the
correct data. After looking at drivers/usbhid/hid-core.c in
usbhid_output_raw_report() I see that output reports are sent over the
interrupt endpoint when hid->urbout is defined (that is when the device
has an interrupt out ep, right?), but it looks like this particular
device is accepting output reports only on the _control_ endpoint; this
is exactly what the working libusb version does btw.

Just for the record, this dumb hack makes setting leds work on sixaxis
with hidraw:

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index df80532..731c08c 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -841,7 +841,7 @@ static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t co
        struct usb_host_interface *interface = intf->cur_altsetting;
        int ret;

-       if (usbhid->urbout && report_type != HID_FEATURE_REPORT) {
+       if (0 && usbhid->urbout && report_type != HID_FEATURE_REPORT) {
                int actual_length;
                int skipped_report_id = 0;
                if (buf[0] == 0x0) {

If you are interested in the userspace programs, just ping me.

What can I do to handle this properly? Add another quirk? Something
like HID_QUIRK_NO_INTERRUPT_OUT_EP or HID_QUIRK_FORCE_CONTROL_OUT_EP?

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?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2010-10-20 14:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-02 15:59 hidraw, sixaxis and output reports Antonio Ospite
2010-10-04 13:58 ` Alan Ott
2010-10-13 20:57   ` [RFC, PATCH 0/2] Enable setting leds via hidraw on Sixaxis Antonio Ospite
2010-10-13 22:15     ` Alan Ott
2010-10-13 22:27       ` Antonio Ospite
2010-10-13 22:54       ` [RFC, PATCH] HID: hid-sony, override usbhid_output_raw_report for Sixaxis Antonio Ospite
2010-10-13 23:23         ` Alan Ott
2010-10-14  7:48           ` Antonio Ospite
2010-10-14 15:09             ` Alan Ott
2010-10-19 14:13               ` [PATCH] " Antonio Ospite
2010-10-20 14:51                 ` Jiri Kosina
2010-10-13 20:57   ` [RFC, PATCH 1/2] HID: usbhid, new quirk to force out reports on the control ep Antonio Ospite
2010-10-13 20:57   ` [RFC, PATCH 2/2] HID: hid-sony, use HID_QUIRK_FORCE_OUT_CONTROL_EP for Sixaxis Antonio Ospite

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