From patchwork Tue Oct 19 14:13:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 265841 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9JEDnoN025521 for ; Tue, 19 Oct 2010 14:13:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622Ab0JSONr (ORCPT ); Tue, 19 Oct 2010 10:13:47 -0400 Received: from smtp209.alice.it ([82.57.200.105]:45362 "EHLO smtp209.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586Ab0JSONq (ORCPT ); Tue, 19 Oct 2010 10:13:46 -0400 Received: from jcn (82.57.81.162) by smtp209.alice.it (8.5.124.08) id 4C1A27590806CE06; Tue, 19 Oct 2010 16:13:37 +0200 Received: from ao2 by jcn with local (Exim 4.72) (envelope-from ) id 1P8CwR-0002oz-4W; Tue, 19 Oct 2010 16:13:27 +0200 From: Antonio Ospite To: linux-input@vger.kernel.org Cc: Antonio Ospite , Alan Ott , Jiri Kosina , Jim Paris , Ranulf Doswell , falktx@gmail.com Subject: [PATCH] HID: hid-sony, override usbhid_output_raw_report for Sixaxis Date: Tue, 19 Oct 2010 16:13:10 +0200 Message-Id: <1287497590-10818-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4CB71D2D.90200@signal11.us> References: <4CB71D2D.90200@signal11.us> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Oct 2010 14:13:49 +0000 (UTC) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index d61f268..0c164b3 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -46,6 +46,25 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, } } +static int sixaxis_usb_output_raw_report(struct hid_device *hid, __u8 *buf, + size_t count, unsigned char report_type) +{ + struct usb_interface *intf = to_usb_interface(hid->dev.parent); + struct usb_device *dev = interface_to_usbdev(intf); + struct usb_host_interface *interface = intf->cur_altsetting; + int report_id = buf[0]; + int ret; + + ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), + HID_REQ_SET_REPORT, + USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + ((report_type + 1) << 8) | report_id, + interface->desc.bInterfaceNumber, buf, count, + USB_CTRL_SET_TIMEOUT); + + return ret; +} + /* * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller * to "operational". Without this, the ps3 controller will not report any @@ -110,8 +129,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) goto err_free; } - if (sc->quirks & SIXAXIS_CONTROLLER_USB) + if (sc->quirks & SIXAXIS_CONTROLLER_USB) { + hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; ret = sixaxis_set_operational_usb(hdev); + } else if (sc->quirks & SIXAXIS_CONTROLLER_BT) ret = sixaxis_set_operational_bt(hdev); else