From: "Сергей Беляшов" <sergey.belyashov@gmail.com>
To: linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Subject: [PATCH] autocentering support for Logitech Force 3D Pro
Date: Fri, 8 May 2009 23:44:59 +0400 [thread overview]
Message-ID: <bb829a0b0905081244j36d069bfre73eba5d170494b3@mail.gmail.com> (raw)
Hello
Few days ago I sent email to the list with this text:
> Hello
> I look code of ff-utils (fftest.c) and found that this program
> checks axis information for FF effects. For example, if kernel
> provides an ABS_X (also supported ABS_Y and ABS_WHEEL) via
> EVIOCGBIT(EV_FF, ...), then fftest shows "Axes query: Axis X". But I
> cannot found this feature in any existing driver. Moreover,
> documentation does not contain any information about it. So, is it
> really neccessary feature (I think yes)?
> I am ready to create autocenter support patch for Logitech Force 3D
> Pro (046d:c286). But all tested by me Logitech Joysticks with FF has
> support for autocentering in same way. May be it is good idea to add
> this feature for all joysticks in hid-lgff.c? If some joystick do not
> support it (users reported), then it is possible to exclude
> autocentering for this joystick later.
> Best regards,
> Sergey Belyashov
But no answer I recieve. So I write 3 incompatible patches:
1. adds autocentering support for Logitech force 3D Pro
2. adds autocentering support for all Logitech Joysticks and wheels
3. same as 2, but also adds information about applicable axes to the
EVIOCGBIT(EV_FF, ...) result and to FF documentation (discussion
required).
Only one patch may be applied.
Best regards,
Sergey Belyashov
PATCH N1 ---------------------------------------------------------
--- orig/drivers/hid/hid-lgff.c 2009-05-08 22:20:37.000000000 +0400
+++ new/drivers/hid/hid-lgff.c 2009-05-08 22:20:26.000000000 +0400
@@ -50,6 +50,12 @@
-1
};
+static const signed short ff_joystick_ac[] = {
+ FF_CONSTANT,
+ FF_AUTOCENTER,
+ -1
+};
+
static const signed short ff_wheel[] = {
FF_CONSTANT,
FF_AUTOCENTER,
@@ -60,7 +66,7 @@
{ 0x046d, 0xc211, ff_rumble },
{ 0x046d, 0xc219, ff_rumble },
{ 0x046d, 0xc283, ff_joystick },
- { 0x046d, 0xc286, ff_joystick },
+ { 0x046d, 0xc286, ff_joystick_ac },
{ 0x046d, 0xc294, ff_wheel },
{ 0x046d, 0xc295, ff_joystick },
{ 0x046d, 0xca03, ff_wheel },
PATCH N2 ---------------------------------------------------------
--- orig/drivers/hid/hid-lgff.c 2009-05-08 22:20:37.000000000 +0400
+++ new/drivers/hid/hid-lgff.c 2009-05-08 22:22:15.000000000 +0400
@@ -47,11 +47,6 @@
static const signed short ff_joystick[] = {
FF_CONSTANT,
- -1
-};
-
-static const signed short ff_wheel[] = {
- FF_CONSTANT,
FF_AUTOCENTER,
-1
};
@@ -61,9 +56,9 @@
{ 0x046d, 0xc219, ff_rumble },
{ 0x046d, 0xc283, ff_joystick },
{ 0x046d, 0xc286, ff_joystick },
- { 0x046d, 0xc294, ff_wheel },
+ { 0x046d, 0xc294, ff_joystick },
{ 0x046d, 0xc295, ff_joystick },
- { 0x046d, 0xca03, ff_wheel },
+ { 0x046d, 0xca03, ff_joystick },
};
static int hid_lgff_play(struct input_dev *dev, void *data, struct
ff_effect *effect)
PATCH N3 ---------------------------------------------------------
--- orig/Documentation/input/ff.txt 2009-05-08 23:06:05.000000000 +0400
+++ new/Documentation/input/ff.txt 2009-05-08 23:09:29.000000000 +0400
@@ -72,6 +72,9 @@
- FF_INERTIA can simulate inertia
- FF_GAIN gain is adjustable
- FF_AUTOCENTER autocenter is adjustable
+- ABS_X effects applicable for axis X
+- ABS_Y effects applicable for axis Y
+- ABS_WHEEL effects applicable for wheel
Note: In most cases you should use FF_PERIODIC instead of FF_RUMBLE. All
devices that support FF_RUMBLE support FF_PERIODIC (square, triangle,
--- orig/drivers/hid/hid-lgff.c 2009-05-08 22:20:37.000000000 +0400
+++ new/drivers/hid/hid-lgff.c 2009-05-08 22:55:56.000000000 +0400
@@ -47,12 +47,16 @@
static const signed short ff_joystick[] = {
FF_CONSTANT,
+ FF_AUTOCENTER,
+ ABS_X,
+ ABS_Y,
-1
};
static const signed short ff_wheel[] = {
FF_CONSTANT,
FF_AUTOCENTER,
+ ABS_X,
-1
};
========================================================================================
Signed-off-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
--
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
next reply other threads:[~2009-05-08 19:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 19:44 Сергей Беляшов [this message]
2009-05-11 15:08 ` [PATCH] autocentering support for Logitech Force 3D Pro Jiri Kosina
2009-05-11 16:13 ` Сергей Беляшов
2009-05-15 14:08 ` Jiri Kosina
2009-05-16 0:50 ` Dmitry Torokhov
2009-05-20 17:32 ` Anssi Hannula
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=bb829a0b0905081244j36d069bfre73eba5d170494b3@mail.gmail.com \
--to=sergey.belyashov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@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).