All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Added device to hid-ff
@ 2007-02-15 18:56 johann deneux
  2007-02-15 19:17 ` Dmitry Torokhov
  2007-02-15 19:40 ` STenyaK (Bruno Gonzalez)
  0 siblings, 2 replies; 13+ messages in thread
From: johann deneux @ 2007-02-15 18:56 UTC (permalink / raw)
  To: linux-input, dmitry; +Cc: Valentin Zagura

[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]

This patch (initially submitted by Valentin Zagura) adds the Logitech
Formula Force EX to the list of devices handled by hid-lgff.
Also updated the text of the Kconfig entry.

Signed-off-by: Johann Deneux <johann.deneux@gmail.com>

--- linux-2.6.20.orig/drivers/usb/input/Kconfig    2007-02-04 19:44:
54.000000000 +0100
+++ linux-2.6.20/drivers/usb/input/Kconfig    2007-02-15 12:27:42.000000000+0100
@@ -56,17 +56,21 @@ config HID_PID
       Say Y here if you have a PID-compliant device and wish to enable
force
       feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such
       devices.

 config LOGITECH_FF
-    bool "Logitech WingMan *3D support"
+    bool "Logitech devices support"
     depends on HID_FF
     select INPUT_FF_MEMLESS if USB_HID
     help
       Say Y here if you have one of these devices:
       - Logitech WingMan Cordless RumblePad
+      - Logitech WingMan Cordless RumblePad 2
       - Logitech WingMan Force 3D
+      - Logitech Formula Force EX
+      - Logitech MOMO Force wheel
+
       and if you want to enable force feedback for them.
       Note: if you say N here, this device will still be supported, but
without
       force feedback.

 config THRUSTMASTER_FF
--- linux-2.6.20.orig/drivers/usb/input/hid-ff.c    2007-02-04 19:44:
54.000000000 +0100
+++ linux-2.6.20/drivers/usb/input/hid-ff.c    2007-02-15
12:16:53.000000000+0100
@@ -53,10 +53,11 @@ struct hid_ff_initializer {
  */
 static struct hid_ff_initializer inits[] = {
 #ifdef CONFIG_LOGITECH_FF
     { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */
     { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */
+    { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */
     { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */
     { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */
 #endif
 #ifdef CONFIG_THRUSTMASTER_FF
     { 0x44f, 0xb304, hid_tmff_init },

[-- Attachment #2: Type: text/html, Size: 2841 bytes --]

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 18:56 [PATCH] Added device to hid-ff johann deneux
@ 2007-02-15 19:17 ` Dmitry Torokhov
  2007-02-15 19:40 ` STenyaK (Bruno Gonzalez)
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-15 19:17 UTC (permalink / raw)
  To: johann deneux; +Cc: linux-input, Valentin Zagura

On 2/15/07, johann deneux <johann.deneux@gmail.com> wrote:
>
>  config LOGITECH_FF
> -    bool "Logitech WingMan *3D support"
> +    bool "Logitech devices support"

I think I'll change this to "Logitech devices support (WingMan, etc)" and apply.

Thanks!

-- 
Dmitry

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 18:56 [PATCH] Added device to hid-ff johann deneux
  2007-02-15 19:17 ` Dmitry Torokhov
@ 2007-02-15 19:40 ` STenyaK (Bruno Gonzalez)
  2007-02-15 19:42   ` Dmitry Torokhov
  1 sibling, 1 reply; 13+ messages in thread
From: STenyaK (Bruno Gonzalez) @ 2007-02-15 19:40 UTC (permalink / raw)
  To: johann deneux, linux-input, dmitry; +Cc: Valentin Zagura

Sorry for not providing a proper patch, could you please also add
         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
to the list? I tested it here and that wheel is also working.

On Thu, 15 Feb 2007 19:56:18 +0100, johann deneux  
<johann.deneux@gmail.com> wrote:

> This patch (initially submitted by Valentin Zagura) adds the Logitech
> Formula Force EX to the list of devices handled by hid-lgff.
> Also updated the text of the Kconfig entry.
>
> Signed-off-by: Johann Deneux <johann.deneux@gmail.com>
>
> --- linux-2.6.20.orig/drivers/usb/input/Kconfig    2007-02-04 19:44:
> 54.000000000 +0100
> +++ linux-2.6.20/drivers/usb/input/Kconfig    2007-02-15  
> 12:27:42.000000000+0100
> @@ -56,17 +56,21 @@ config HID_PID
>        Say Y here if you have a PID-compliant device and wish to enable
> force
>        feedback for it. Microsoft Sidewinder Force Feedback 2 is one of  
> such
>        devices.
>
>  config LOGITECH_FF
> -    bool "Logitech WingMan *3D support"
> +    bool "Logitech devices support"
>      depends on HID_FF
>      select INPUT_FF_MEMLESS if USB_HID
>      help
>        Say Y here if you have one of these devices:
>        - Logitech WingMan Cordless RumblePad
> +      - Logitech WingMan Cordless RumblePad 2
>        - Logitech WingMan Force 3D
> +      - Logitech Formula Force EX
> +      - Logitech MOMO Force wheel
> +
>        and if you want to enable force feedback for them.
>        Note: if you say N here, this device will still be supported, but
> without
>        force feedback.
>
>  config THRUSTMASTER_FF
> --- linux-2.6.20.orig/drivers/usb/input/hid-ff.c    2007-02-04 19:44:
> 54.000000000 +0100
> +++ linux-2.6.20/drivers/usb/input/hid-ff.c    2007-02-15
> 12:16:53.000000000+0100
> @@ -53,10 +53,11 @@ struct hid_ff_initializer {
>   */
>  static struct hid_ff_initializer inits[] = {
>  #ifdef CONFIG_LOGITECH_FF
>      { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */
>      { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */
> +    { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */
>      { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */
>      { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2  
> */
>  #endif
>  #ifdef CONFIG_THRUSTMASTER_FF
>      { 0x44f, 0xb304, hid_tmff_init },



-- 
Saludos,
     STenyaK

_______________________________________________
Site:   http://1ksurvivor.homeip.net  <1kSurvivor>
         http://motorsport-sim.org     <Motorsport>
         http://kwh.iespana.es         <KuantikalWareHouse>
         http://emuletutorial.info     <EmuleTutorial>
ICQ:    153709484
Mail:   stenyak AT gmail DOT net

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:40 ` STenyaK (Bruno Gonzalez)
@ 2007-02-15 19:42   ` Dmitry Torokhov
  2007-02-15 19:46     ` Dmitry Torokhov
  2007-02-15 19:51     ` Anssi Hannula
  0 siblings, 2 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-15 19:42 UTC (permalink / raw)
  To: STenyaK (Bruno Gonzalez); +Cc: johann deneux, linux-input, Valentin Zagura

On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> Sorry for not providing a proper patch, could you please also add
>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> to the list? I tested it here and that wheel is also working.
>

OK.

-- 
Dmitry

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:42   ` Dmitry Torokhov
@ 2007-02-15 19:46     ` Dmitry Torokhov
  2007-02-15 19:53       ` STenyaK (Bruno Gonzalez)
  2007-02-16 10:05       ` Valentin Zagura
  2007-02-15 19:51     ` Anssi Hannula
  1 sibling, 2 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-15 19:46 UTC (permalink / raw)
  To: STenyaK (Bruno Gonzalez); +Cc: johann deneux, linux-input, Valentin Zagura

On 2/15/07, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> > Sorry for not providing a proper patch, could you please also add
> >         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> > to the list? I tested it here and that wheel is also working.
> >
>
> OK.

Wait, 0x46d:0xc294 is device being added by the original patch as
Formula Force EX... Confused.

-- 
Dmitry

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:42   ` Dmitry Torokhov
  2007-02-15 19:46     ` Dmitry Torokhov
@ 2007-02-15 19:51     ` Anssi Hannula
  2007-02-15 20:09       ` Dmitry Torokhov
  2007-02-16 15:43       ` johann deneux
  1 sibling, 2 replies; 13+ messages in thread
From: Anssi Hannula @ 2007-02-15 19:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: STenyaK (Bruno Gonzalez), johann deneux, linux-input, Valentin Zagura

Dmitry Torokhov wrote:
> On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
>> Sorry for not providing a proper patch, could you please also add
>>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
>> to the list? I tested it here and that wheel is also working.
>>
> 
> OK.
> 

Hmm.. Shouldn't an entry also be added to the devices[] list in
hid-lgff.c for these devices? (and it seems one device is already
missing from there in the current kernel).

I'm not able to check right now, but I think some earlier kernels may
have defaulted to ff_joystick if no entry is present in devices[], hence
these devices working for some without the entry.
(so the alternative is to restore that behaviour)

BTW, shouldn't the PID/VID check in hid_lgff_init() do endian conversion?

-- 
Anssi Hannula

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:46     ` Dmitry Torokhov
@ 2007-02-15 19:53       ` STenyaK (Bruno Gonzalez)
  2007-02-16 10:05       ` Valentin Zagura
  1 sibling, 0 replies; 13+ messages in thread
From: STenyaK (Bruno Gonzalez) @ 2007-02-15 19:53 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: johann deneux, linux-input, Valentin Zagura

I guess both steering wheels share the same model ID? I don't know, but I  
can tell the FFB didn't work until i added that line and recompiled my  
kernel. I got the ID using the "usbview" tool.

On Thu, 15 Feb 2007 20:46:38 +0100, Dmitry Torokhov  
<dmitry.torokhov@gmail.com> wrote:

> On 2/15/07, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>> On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
>> > Sorry for not providing a proper patch, could you please also add
>> >         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
>> > to the list? I tested it here and that wheel is also working.
>> >
>>
>> OK.
>
> Wait, 0x46d:0xc294 is device being added by the original patch as
> Formula Force EX... Confused.
>



-- 
Saludos,
     STenyaK

_______________________________________________
Site:   http://1ksurvivor.homeip.net  <1kSurvivor>
         http://motorsport-sim.org     <Motorsport>
         http://kwh.iespana.es         <KuantikalWareHouse>
         http://emuletutorial.info     <EmuleTutorial>
ICQ:    153709484
Mail:   stenyak AT gmail DOT net

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:51     ` Anssi Hannula
@ 2007-02-15 20:09       ` Dmitry Torokhov
  2007-02-16 15:43       ` johann deneux
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-15 20:09 UTC (permalink / raw)
  To: Anssi Hannula
  Cc: STenyaK (Bruno Gonzalez), johann deneux, linux-input, Valentin Zagura

On 2/15/07, Anssi Hannula <anssi.hannula@gmail.com> wrote:
> Dmitry Torokhov wrote:
> > On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> >> Sorry for not providing a proper patch, could you please also add
> >>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> >> to the list? I tested it here and that wheel is also working.
> >>
> >
> > OK.
> >
>
> Hmm.. Shouldn't an entry also be added to the devices[] list in
> hid-lgff.c for these devices? (and it seems one device is already
> missing from there in the current kernel).
>

Yep. It looks like they should be mapped to ff_joystick, right?

> I'm not able to check right now, but I think some earlier kernels may
> have defaulted to ff_joystick if no entry is present in devices[], hence
> these devices working for some without the entry.
> (so the alternative is to restore that behaviour)
>
> BTW, shouldn't the PID/VID check in hid_lgff_init() do endian conversion?
>

No, because input_id keeps this data in host format. See usb_to_input_id().

-- 
Dmitry

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:46     ` Dmitry Torokhov
  2007-02-15 19:53       ` STenyaK (Bruno Gonzalez)
@ 2007-02-16 10:05       ` Valentin Zagura
  2007-02-16 15:20         ` STenyaK (Bruno Gonzalez)
  1 sibling, 1 reply; 13+ messages in thread
From: Valentin Zagura @ 2007-02-16 10:05 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: STenyaK (Bruno Gonzalez), johann deneux, linux-input

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

>
>
>
> Wait, 0x46d:0xc294 is device being added by the original patch as
> Formula Force EX... Confused.
>

Here is what I found on the net, maybe it will clear things out:
http://siv.mysite.wanadoo-members.co.uk/downloads/usbdevs.txt

046D:C294=Logitech Driving Force USB (HID)
046D:C294:2000=Logitech Driving Force EX USB (HID)
046D:C294:2100=Logitech Formula Force RX USB (HID)
046D:C294:2200=Logitech Driving Force RX USB (HID)


I have the EX model.

Valentin Zagura

[-- Attachment #2: Type: text/html, Size: 746 bytes --]

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

* Re: [PATCH] Added device to hid-ff
  2007-02-16 10:05       ` Valentin Zagura
@ 2007-02-16 15:20         ` STenyaK (Bruno Gonzalez)
  0 siblings, 0 replies; 13+ messages in thread
From: STenyaK (Bruno Gonzalez) @ 2007-02-16 15:20 UTC (permalink / raw)
  To: Valentin Zagura, Dmitry Torokhov; +Cc: johann deneux, linux-input

On Fri, 16 Feb 2007 11:05:41 +0100, Valentin Zagura <puthre@gmail.com>  
wrote:
> Here is what I found on the net, maybe it will clear things out:
> http://siv.mysite.wanadoo-members.co.uk/downloads/usbdevs.txt
>
> 046D:C294=Logitech Driving Force USB (HID)
> 046D:C294:2000=Logitech Driving Force EX USB (HID)
> 046D:C294:2100=Logitech Formula Force RX USB (HID)
> 046D:C294:2200=Logitech Driving Force RX USB (HID)

My wheel doesn't appear there. It's a new model (just a few months old).
This is the whole usbview output:

---------------------------------------------------------------------
G25 Racing Wheel
Speed: 12Mb/s (full)
USB Version:  2.00
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 16
Number of Configurations: 1
Vendor Id: 046d
Product Id: c294
Revision Number: 12.22

Config Number: 1
	Number of Interfaces: 1
	Attributes: 80
	MaxPower Needed:  80mA

	Interface Number: 0
		Name: usbhid
		Alternate Number: 0
		Class: 03(HID  )
		Sub Class: 0
		Protocol: 0
		Number of Endpoints: 2

			Endpoint Address: 81
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 8
			Interval: 10ms

			Endpoint Address: 01
			Direction: out
			Attribute: 3
			Type: Int.
			Max Packet Size: 8
			Interval: 10ms
---------------------------------------------------------------------


-- 
Saludos,
     STenyaK

_______________________________________________
Site:   http://1ksurvivor.homeip.net  <1kSurvivor>
         http://motorsport-sim.org     <Motorsport>
         http://kwh.iespana.es         <KuantikalWareHouse>
         http://emuletutorial.info     <EmuleTutorial>
ICQ:    153709484
Mail:   stenyak AT gmail DOT net

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

* Re: [PATCH] Added device to hid-ff
  2007-02-15 19:51     ` Anssi Hannula
  2007-02-15 20:09       ` Dmitry Torokhov
@ 2007-02-16 15:43       ` johann deneux
  2007-02-16 16:03         ` Dmitry Torokhov
  1 sibling, 1 reply; 13+ messages in thread
From: johann deneux @ 2007-02-16 15:43 UTC (permalink / raw)
  To: Anssi Hannula
  Cc: Dmitry Torokhov, STenyaK (Bruno Gonzalez), linux-input, Valentin Zagura

[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]

On 2/15/07, Anssi Hannula <anssi.hannula@gmail.com> wrote:
>
> Dmitry Torokhov wrote:
> > On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> >> Sorry for not providing a proper patch, could you please also add
> >>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> >> to the list? I tested it here and that wheel is also working.
> >>
> >
> > OK.
> >
>
> Hmm.. Shouldn't an entry also be added to the devices[] list in
> hid-lgff.c for these devices? (and it seems one device is already
> missing from there in the current kernel).
>
> I'm not able to check right now, but I think some earlier kernels may
> have defaulted to ff_joystick if no entry is present in devices[], hence
> these devices working for some without the entry.
> (so the alternative is to restore that behaviour)


Yes, defaulting to joystick was the way it was when I wrote hid-lgff.c, and
I guess Valentin made his original patch on a kernel where defaulting was
still there.
I'll send a separate mail with the patch adding the devices there too, but I
personally think defaulting was nice. Was there a reason behind the removal?

-- 
Johann

[-- Attachment #2: Type: text/html, Size: 1598 bytes --]

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

* Re: [PATCH] Added device to hid-ff
  2007-02-16 15:43       ` johann deneux
@ 2007-02-16 16:03         ` Dmitry Torokhov
  2007-02-16 17:28           ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-16 16:03 UTC (permalink / raw)
  To: johann deneux
  Cc: Anssi Hannula, STenyaK (Bruno Gonzalez), linux-input, Valentin Zagura

On 2/16/07, johann deneux <johann.deneux@gmail.com> wrote:
> On 2/15/07, Anssi Hannula <anssi.hannula@gmail.com> wrote:
> > Dmitry Torokhov wrote:
> > > On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> > >> Sorry for not providing a proper patch, could you please also add
> > >>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> > >> to the list? I tested it here and that wheel is also working.
> > >>
> > >
> > > OK.
> > >
> >
> > Hmm.. Shouldn't an entry also be added to the devices[] list in
> > hid-lgff.c for these devices? (and it seems one device is already
> > missing from there in the current kernel).
> >
> > I'm not able to check right now, but I think some earlier kernels may
> > have defaulted to ff_joystick if no entry is present in devices[], hence
> > these devices working for some without the entry.
> > (so the alternative is to restore that behaviour)
>
> Yes, defaulting to joystick was the way it was when I wrote hid-lgff.c, and
> I guess Valentin made his original patch on a kernel where defaulting was
> still there.
> I'll send a separate mail with the patch adding the devices there too, but I
> personally think defaulting was nice. Was there a reason behind the removal?
>

Simple oversight. I think we should restore defaulting.

-- 
Dmitry

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

* Re: [PATCH] Added device to hid-ff
  2007-02-16 16:03         ` Dmitry Torokhov
@ 2007-02-16 17:28           ` Dmitry Torokhov
  0 siblings, 0 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2007-02-16 17:28 UTC (permalink / raw)
  To: johann deneux
  Cc: Anssi Hannula, STenyaK (Bruno Gonzalez), linux-input, Valentin Zagura

[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]

On 2/16/07, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 2/16/07, johann deneux <johann.deneux@gmail.com> wrote:
> > On 2/15/07, Anssi Hannula <anssi.hannula@gmail.com> wrote:
> > > Dmitry Torokhov wrote:
> > > > On 2/15/07, STenyaK (Bruno Gonzalez) <stenyak@gmail.com> wrote:
> > > >> Sorry for not providing a proper patch, could you please also add
> > > >>         {0x46d, 0xc294, hid_lgff_init}, // Logitech G25 wheel
> > > >> to the list? I tested it here and that wheel is also working.
> > > >>
> > > >
> > > > OK.
> > > >
> > >
> > > Hmm.. Shouldn't an entry also be added to the devices[] list in
> > > hid-lgff.c for these devices? (and it seems one device is already
> > > missing from there in the current kernel).
> > >
> > > I'm not able to check right now, but I think some earlier kernels may
> > > have defaulted to ff_joystick if no entry is present in devices[], hence
> > > these devices working for some without the entry.
> > > (so the alternative is to restore that behaviour)
> >
> > Yes, defaulting to joystick was the way it was when I wrote hid-lgff.c, and
> > I guess Valentin made his original patch on a kernel where defaulting was
> > still there.
> > I'll send a separate mail with the patch adding the devices there too, but I
> > personally think defaulting was nice. Was there a reason behind the removal?
> >
>
> Simple oversight. I think we should restore defaulting.
>

Something like the attached should do I think...

-- 
Dmitry

[-- Attachment #2: hid-lgff-default-to-joystick.patch --]
[-- Type: text/plain, Size: 1593 bytes --]

Input: hid-lgff - treat devices as joysticks unless told otherwise

By default threat devices as joysticks with constant force-feedback
effect.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/usb/input/hid-lgff.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux/drivers/usb/input/hid-lgff.c
===================================================================
--- linux.orig/drivers/usb/input/hid-lgff.c
+++ linux/drivers/usb/input/hid-lgff.c
@@ -55,7 +55,6 @@ static const struct dev_type devices[] =
 	{ 0x046d, 0xc294, ff_joystick },
 	{ 0x046d, 0xc295, ff_joystick },
 	{ 0x046d, 0xca03, ff_joystick },
-	{ 0x0000, 0x0000, ff_joystick }
 };
 
 static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
@@ -107,8 +106,9 @@ int hid_lgff_init(struct hid_device* hid
 	struct input_dev *dev = hidinput->input;
 	struct hid_report *report;
 	struct hid_field *field;
+	const signed short *ff_bits = ff_joystick;
 	int error;
-	int i, j;
+	int i;
 
 	/* Find the report to use */
 	if (list_empty(report_list)) {
@@ -132,12 +132,14 @@ int hid_lgff_init(struct hid_device* hid
 	for (i = 0; i < ARRAY_SIZE(devices); i++) {
 		if (dev->id.vendor == devices[i].idVendor &&
 		    dev->id.product == devices[i].idProduct) {
-			for (j = 0; devices[i].ff[j] >= 0; j++)
-				set_bit(devices[i].ff[j], dev->ffbit);
+			ff_bits = devices[i].ff;
 			break;
 		}
 	}
 
+	for (i = 0; ff_bits[i] >= 0; i++)
+		set_bit(ff_bits[i], dev->ffbit);
+
 	error = input_ff_create_memless(dev, NULL, hid_lgff_play);
 	if (error)
 		return error;

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

end of thread, other threads:[~2007-02-16 17:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-15 18:56 [PATCH] Added device to hid-ff johann deneux
2007-02-15 19:17 ` Dmitry Torokhov
2007-02-15 19:40 ` STenyaK (Bruno Gonzalez)
2007-02-15 19:42   ` Dmitry Torokhov
2007-02-15 19:46     ` Dmitry Torokhov
2007-02-15 19:53       ` STenyaK (Bruno Gonzalez)
2007-02-16 10:05       ` Valentin Zagura
2007-02-16 15:20         ` STenyaK (Bruno Gonzalez)
2007-02-15 19:51     ` Anssi Hannula
2007-02-15 20:09       ` Dmitry Torokhov
2007-02-16 15:43       ` johann deneux
2007-02-16 16:03         ` Dmitry Torokhov
2007-02-16 17:28           ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.