linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autocentering support for Logitech Force 3D Pro
@ 2009-05-08 19:44 Сергей Беляшов
  2009-05-11 15:08 ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Сергей Беляшов @ 2009-05-08 19:44 UTC (permalink / raw)
  To: linux-input, Jiri Kosina

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] autocentering support for Logitech Force 3D Pro
  2009-05-08 19:44 [PATCH] autocentering support for Logitech Force 3D Pro Сергей Беляшов
@ 2009-05-11 15:08 ` Jiri Kosina
  2009-05-11 16:13   ` Сергей Беляшов
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2009-05-11 15:08 UTC (permalink / raw)
  To: Сергей Беляшов
  Cc: linux-input

[-- Attachment #1: Type: TEXT/PLAIN, Size: 825 bytes --]

On Fri, 8 May 2009, ?????? ??????? wrote:

> >   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.

The standard doesn't mandate anything, as far as I know. Also, we know how 
creative HID vendors are when braking all kinds of 
specifications/reasonable expectations.

So I'd propose to go with enabling the feature only for those joysticks 
for which it is verified to work.

Therefore, I would propose merging your patch no. 1, if you agree.

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] autocentering support for Logitech Force 3D Pro
  2009-05-11 15:08 ` Jiri Kosina
@ 2009-05-11 16:13   ` Сергей Беляшов
  2009-05-15 14:08     ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Сергей Беляшов @ 2009-05-11 16:13 UTC (permalink / raw)
  To: Jiri Kosina, linux-input

   Of course I agree.
   How about axes information in EVIOCGBIT(EV_FF,...)?

Best regards,
Sergey Belyashov

2009/5/11 Jiri Kosina <jkosina@suse.cz>:
> On Fri, 8 May 2009, ?????? ??????? wrote:
>
> Therefore, I would propose merging your patch no. 1, if you agree.
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] autocentering support for Logitech Force 3D Pro
  2009-05-11 16:13   ` Сергей Беляшов
@ 2009-05-15 14:08     ` Jiri Kosina
  2009-05-16  0:50       ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2009-05-15 14:08 UTC (permalink / raw)
  To: Сергей Беляшов
  Cc: linux-input, Anssi Hannula, Dmitry Torokhov

On Mon, 11 May 2009, ?????? ??????? wrote:

>    Of course I agree.

I have applied the autocentering support patch for 0x286, thanks.

>    How about axes information in EVIOCGBIT(EV_FF,...)?

Anssi, Dmitry, what do you think?

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] autocentering support for Logitech Force 3D Pro
  2009-05-15 14:08     ` Jiri Kosina
@ 2009-05-16  0:50       ` Dmitry Torokhov
  2009-05-20 17:32         ` Anssi Hannula
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2009-05-16  0:50 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Сергей Беляшов,
	linux-input, Anssi Hannula

On Fri, May 15, 2009 at 04:08:52PM +0200, Jiri Kosina wrote:
> On Mon, 11 May 2009, ?????? ??????? wrote:
> 
> >    Of course I agree.
> 
> I have applied the autocentering support patch for 0x286, thanks.
> 
> >    How about axes information in EVIOCGBIT(EV_FF,...)?
> 
> Anssi, Dmitry, what do you think?
> 

I'd say no... Can we guarantee that all stated FF effects would be
always applicable to every one of the ABS events types returned by
EVIOCGBIT(EV_FF,...)?

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] autocentering support for Logitech Force 3D Pro
  2009-05-16  0:50       ` Dmitry Torokhov
@ 2009-05-20 17:32         ` Anssi Hannula
  0 siblings, 0 replies; 6+ messages in thread
From: Anssi Hannula @ 2009-05-20 17:32 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Jiri Kosina,
	Сергей Беляшов,
	linux-input

Dmitry Torokhov wrote:
> On Fri, May 15, 2009 at 04:08:52PM +0200, Jiri Kosina wrote:
>> On Mon, 11 May 2009, ?????? ??????? wrote:
>>
>>>    Of course I agree.
>> I have applied the autocentering support patch for 0x286, thanks.
>>
>>>    How about axes information in EVIOCGBIT(EV_FF,...)?
>> Anssi, Dmitry, what do you think?
>>
> 
> I'd say no... Can we guarantee that all stated FF effects would be
> always applicable to every one of the ABS events types returned by
> EVIOCGBIT(EV_FF,...)?

I agree with no.

-- 
Anssi Hannula

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-20 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-08 19:44 [PATCH] autocentering support for Logitech Force 3D Pro Сергей Беляшов
2009-05-11 15:08 ` 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

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).