From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Cameron Gutman <aicommander@gmail.com>
Cc: linux-input@vger.kernel.org, rojtberg@gmail.com
Subject: Re: [PATCH] Input: xpad - fix rumble on Xbox One controllers with 2015 firmware
Date: Tue, 31 May 2016 15:32:05 -0700 [thread overview]
Message-ID: <20160531223205.GA28457@dtor-ws> (raw)
In-Reply-To: <574E0E07.9090303@gmail.com>
Hi Cameron,
On Tue, May 31, 2016 at 05:19:51PM -0500, Cameron Gutman wrote:
> Xbox One controllers that shipped with or were upgraded to the 2015
> firmware discard the current rumble packets we send. This patch changes
> the Xbox One rumble packet to a form that the newer firmware will accept.
But what do we do with the older devices?
Thanks.
>
> It is based on changes made to support newer Xbox One controllers in
> the SteamOS brewmaster-4.1 kernel branch.
>
> Signed-off-by: Cameron Gutman <aicommander@gmail.com>
> ---
> drivers/input/joystick/xpad.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 804dbcc..923c572 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -1031,17 +1031,17 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
>
> case XTYPE_XBOXONE:
> packet->data[0] = 0x09; /* activate rumble */
> - packet->data[1] = 0x08;
> + packet->data[1] = 0x00;
> packet->data[2] = xpad->odata_serial++;
> - packet->data[3] = 0x08; /* continuous effect */
> - packet->data[4] = 0x00; /* simple rumble mode */
> - packet->data[5] = 0x03; /* L and R actuator only */
> - packet->data[6] = 0x00; /* TODO: LT actuator */
> - packet->data[7] = 0x00; /* TODO: RT actuator */
> + packet->data[3] = 0x09;
> + packet->data[4] = 0x00;
> + packet->data[5] = 0x0F;
> + packet->data[6] = 0x00;
> + packet->data[7] = 0x00;
> packet->data[8] = strong / 512; /* left actuator */
> packet->data[9] = weak / 512; /* right actuator */
> - packet->data[10] = 0x80; /* length of pulse */
> - packet->data[11] = 0x00; /* stop period of pulse */
> + packet->data[10] = 0xFF;
> + packet->data[11] = 0x00;
> packet->data[12] = 0x00;
> packet->len = 13;
> packet->pending = true;
> --
> 2.7.4
--
Dmitry
next prev parent reply other threads:[~2016-05-31 22:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 22:19 [PATCH] Input: xpad - fix rumble on Xbox One controllers with 2015 firmware Cameron Gutman
2016-05-31 22:32 ` Dmitry Torokhov [this message]
2016-05-31 22:49 ` Cameron Gutman
2016-05-31 23:04 ` Cameron Gutman
2016-06-01 18:34 ` Dmitry Torokhov
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=20160531223205.GA28457@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aicommander@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=rojtberg@gmail.com \
/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