From patchwork Mon Jun 13 00:19:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Snowhill X-Patchwork-Id: 873622 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5D0JT5v024689 for ; Mon, 13 Jun 2011 00:19:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754542Ab1FMAT2 (ORCPT ); Sun, 12 Jun 2011 20:19:28 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:32873 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253Ab1FMAT1 (ORCPT ); Sun, 12 Jun 2011 20:19:27 -0400 Received: by pzk9 with SMTP id 9so1903148pzk.19 for ; Sun, 12 Jun 2011 17:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:message-id:mime-version; bh=0u0tBxp4ACWxazSxZbuMCHkcV4Gj7qcLSEfzbNmzoQQ=; b=OdP73Z8Gt4hDrsZwjJqlKGaTQ0zGBR5BRrA0QN6MZnfTg0W48xu5z+i0xXMlrNgeGY NmICaDLxJV2ttuye7f+50f8EbqfjZasVJTKP1n2TLNC+avpdqhz7qhyiNax00dSN4QwI 34mPnWhBKY4nmA5Q9odN/3fpbH7nvbUQHU+Mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:message-id:mime-version; b=B75w36YLDlX4vk5m9/mC04HbVDugs3vhsKAo9Wxj294qVO0dq2WNQYUdsua4akrEqy 3QcpYHaD5DG2XQ/yj7cmo8iHnj8BlUjw+L/J/eyHgWLwMQFdVlmGB7a5+3EX2TWl0X0b 5GgezneQHnufnQ9lTvmmQNPFsYWUOiOcxkhr8= Received: by 10.68.63.36 with SMTP id d4mr520754pbs.223.1307924367329; Sun, 12 Jun 2011 17:19:27 -0700 (PDT) Received: from [192.168.11.6] (99-130-104-166.lightspeed.irvnca.sbcglobal.net [99.130.104.166]) by mx.google.com with ESMTPS id k9sm4155665pbc.70.2011.06.12.17.19.26 (version=SSLv3 cipher=OTHER); Sun, 12 Jun 2011 17:19:27 -0700 (PDT) Subject: [PATCH 2.6.38.7 2/3] xpad: wireless rumble support From: Chris Moeller To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org Date: Sun, 12 Jun 2011 17:19:26 -0700 X-Mailer: Evolution 3.0.2 (3.0.2-2.fc15) Message-ID: <1307924366.8254.11.camel@sabin.lan> Mime-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Jun 2011 00:19:29 +0000 (UTC) This patch implements rumble support for XBox360 Wireless Controllers. Signed-off-by: Chris Moeller --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux/drivers/input/joystick/xpad.c.orig 2011-06-11 19:49:56.964914370 -0700 +++ linux/drivers/input/joystick/xpad.c 2011-06-12 12:02:32.732131132 -0700 @@ -632,6 +632,23 @@ static int xpad_play_effect(struct input return usb_submit_urb(xpad->irq_out, GFP_ATOMIC); + case XTYPE_XBOX360W: + xpad->odata[0] = 0x00; + xpad->odata[1] = 0x01; + xpad->odata[2] = 0x0F; + xpad->odata[3] = 0xC0; + xpad->odata[4] = 0x00; + xpad->odata[5] = strong / 256; + xpad->odata[6] = weak / 256; + xpad->odata[7] = 0x00; + xpad->odata[8] = 0x00; + xpad->odata[9] = 0x00; + xpad->odata[10] = 0x00; + xpad->odata[11] = 0x00; + xpad->irq_out->transfer_buffer_length = 12; + + return usb_submit_urb(xpad->irq_out, GFP_ATOMIC); + default: dbg("%s - rumble command sent to unsupported xpad type: %d", __func__, xpad->xtype); @@ -644,7 +661,7 @@ static int xpad_play_effect(struct input static int xpad_init_ff(struct usb_xpad *xpad) { - if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX) + if (xpad->xtype == XTYPE_UNKNOWN) return 0; input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);