All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Ott <alan@signal11.us>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: linux-input@vger.kernel.org, "Jiri Kosina" <trivial@kernel.org>,
	"Jim Paris" <jim@jtan.com>, "Ranulf Doswell" <ralf@ranulf.net>,
	"fMikko Virkkilä" <mvirkkil@cc.hut.fi>,
	alktx@gmail.com
Subject: Re: hidraw, sixaxis and output reports.
Date: Mon, 04 Oct 2010 09:58:33 -0400	[thread overview]
Message-ID: <4CA9DD89.2010106@signal11.us> (raw)
In-Reply-To: <20101002175958.fbb1aca4.ospite@studenti.unina.it>

On 10/02/2010 11:59 AM, Antonio Ospite wrote:
> 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?
>    

Sounds right to me. If there's an OUT endpoint, the device SHOULD handle 
output reports on it. Anything else is non-compliant, and I think a 
quirk makes sense.

That SixAxis is quite a pain....

Alan.




  reply	other threads:[~2010-10-04 13:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02 15:59 hidraw, sixaxis and output reports Antonio Ospite
2010-10-04 13:58 ` Alan Ott [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA9DD89.2010106@signal11.us \
    --to=alan@signal11.us \
    --cc=alktx@gmail.com \
    --cc=jim@jtan.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mvirkkil@cc.hut.fi \
    --cc=ospite@studenti.unina.it \
    --cc=ralf@ranulf.net \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.