linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lauri Kasanen <cand@gmx.com>
To: Antonio Ospite <ao2@ao2.it>
Cc: linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	AndrewD207@aol.com, benjamin.tissoires@gmail.com
Subject: Re: [PATCH] HID: sony: Enable Gasia third-party PS3 controllers
Date: Sat, 7 Feb 2015 23:48:01 +0200	[thread overview]
Message-ID: <20150207234801.262dbe4f.cand@gmx.com> (raw)
In-Reply-To: <20150207173133.0eda1917cbb26834f1885aa9@ao2.it>

Hi,

On Sat, 7 Feb 2015 17:31:33 +0100
Antonio Ospite <ao2@ao2.it> wrote:
> > > +#include <linux/usb/input.h>
> > 
> > Please don't.
> > HID should be transport agnostic, so please refrain from directly call usb.
> >
> 
> I agree with Benjamin here.
> 
> > > +
> > > +       ret = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x02),
> > > +                               buf2, sizeof(buf2),
> > > +                               &transfered, USB_CTRL_SET_TIMEOUT);
> > 
> > Can't you simply use a hid_hw_output_report request instead of hard
> > coding the device specific endpoint?
> > And I'd also prefer it to be guarded against your specific controller.
> > 
> 
> usb_interrupt_msg() is called in usbhid_output_report() indeed, so it
> should be possible to use the generic HID interface.

Regarding the USB. This is a comment from Andrew's patch:

// doesn't work. gets sent as a SET_REPORT Request intstead of a
// URB_INTERRUPT out. I guess usbhid->urbout is null
//if ( hdev->hid_output_raw_report(hdev, buf2, sizeof(buf2),

I took his word for it, and did not attempt it. Do you think it would
work with the current kernel? If so, I can test later. Had quite an
enjoyable evening playing some FF7 once I had the controller working ;)

Antonio, others, can you test with official Sony controllers that the
current patch did not break them? I only have the Gasia.

> > > +       if (ret < 0)
> > > +               hid_err(hdev, "can't set operational mode on the interrupt EP\n");
> 
> And adjust this message accordingly. Call it "step 3" perhaps?

Sure, will edit the error messages.

- Lauri

  reply	other threads:[~2015-02-07 21:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07 13:48 [PATCH] HID: sony: Enable Gasia third-party PS3 controllers Lauri Kasanen
2015-02-07 15:56 ` Benjamin Tissoires
2015-02-07 16:31   ` Antonio Ospite
2015-02-07 21:48     ` Lauri Kasanen [this message]
2015-03-19 10:26       ` David Herrmann
2015-02-09 10:08 ` Oliver Neukum
2015-02-09 18:44   ` Lauri Kasanen
2015-02-10  8:14     ` Oliver Neukum
2015-03-16 21:10       ` Pavel Machek
2015-03-16 21:37         ` Jiri Kosina
2015-03-19  9:14           ` Oliver Neukum
2015-03-19  9:38             ` Pavel Machek
2015-03-19  9:54               ` Oliver Neukum
2015-03-19 10:12                 ` Pavel Machek
2015-03-19 10:29                   ` Oliver Neukum

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=20150207234801.262dbe4f.cand@gmx.com \
    --to=cand@gmx.com \
    --cc=AndrewD207@aol.com \
    --cc=ao2@ao2.it \
    --cc=benjamin.tissoires@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.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 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).