Skip to contentSkip to conversation

HID: Force feedback support for the Logitech G920 Wheel

PATCH Superseded Edwin Velds 4 participants 6 messages Nov 21, 2015 – Nov 28, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover HID: Force feedback support for the Logitech G920 Wheel

This patch implements force feedback support for the Logitech G920 Driving Force Racing Wheel.

This patch is based on the basic G920 support patch by Simon Wood:
http://www.spinics.net/lists/linux-input/msg42174.html

The first patch splits and renames the HID++ driver (hid-logitech-hidpp.c) into a basic header and implementation in order to allow building additional features from multiple sources. Since this only satisfies the needs for the FF driver, any comments or suggestions are welcome.

The second patch implements all supported force feedback effects. The force feedback implementation was not made optional because the G920 (like all Logitech wheels) can't function without it due to very stiff to default springs.

Edwin Velds (1):
HID: Create header for Logitech HID++ driver
HID: Force feedback support for the Logitech G920

 drivers/hid/Makefile                  |    2 +
 drivers/hid/hid-logitech-hidpp-base.c | 1725 ++++++++++++++++++++++++++++++
 drivers/hid/hid-logitech-hidpp-base.h |   81 ++
 drivers/hid/hid-logitech-hidpp-ff.c   |  540 ++++++++++
 drivers/hid/hid-logitech-hidpp-ff.h   |    9 +
 drivers/hid/hid-logitech-hidpp.c      | 1900 ---------------------------------
 6 files changed, 2357 insertions(+), 1900 deletions(-)
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.h
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.h
 delete mode 100644 drivers/hid/hid-logitech-hidpp.c
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/2 HID: Create header for Logitech HID++ driver

Renamed the hid-logitech-hidpp.c file and created a header. This prepares for building the driver from multiple sources.

---
 drivers/hid/Makefile                  |    2 +
 drivers/hid/hid-logitech-hidpp-base.c | 1831 +++++++++++++++++++++++++++++++
 drivers/hid/hid-logitech-hidpp-base.h |   81 ++
 drivers/hid/hid-logitech-hidpp.c      | 1900 ---------------------------------
 4 files changed, 1914 insertions(+), 1900 deletions(-)
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.h
 delete mode 100644 drivers/hid/hid-logitech-hidpp.c
drivers/hid/Makefile +2 -0
index 00011fe..a01c448 100644
@@ -17,6 +17,8 @@ hid-logitech-$(CONFIG_LOGIRUMBLEPAD2_FF)	+= hid-lg2ff.o
 hid-logitech-$(CONFIG_LOGIG940_FF)	+= hid-lg3ff.o
 hid-logitech-$(CONFIG_LOGIWHEELS_FF)	+= hid-lg4ff.o
 
+hid-logitech-hidpp-y	:= hid-logitech-hidpp-base.o
+
 hid-wiimote-y		:= hid-wiimote-core.o hid-wiimote-modules.o
 hid-wiimote-$(CONFIG_DEBUG_FS)	+= hid-wiimote-debug.o
 
drivers/hid/hid-logitech-hidpp-base.c new file +1831 -0

1,831 lines not on this page · raw message

drivers/hid/hid-logitech-hidpp-base.h new file +81 -0

81 lines not on this page · raw message

drivers/hid/hid-logitech-hidpp.c deleted +0 -1900

1,080 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/2 HID: Force feedback support for the Logitech G920

In reply to Edwin Velds

This patch implements force feedback support for the Logitech G920 Driving Force Racing Wheel. It is a generic implementation of feature 0x8123 of the Logitech HID++ protocol and should be usable for any future devices that implement this feature.

The driving supports everything that is supported by the G920 firmware:
FF_CONSTANT
FF_PERIODIC
FF_SINE
FF_SQUARE
FF_SAW_UP
FF_SAW_DOWN
FF_TRIANGLE
FF_SPRING
FF_DAMPER
FF_AUTOCENTER
FF_GAIN

Both envelopes and replay values are supported as well.

Note that the G920 (like previous Logitech wheels) starts with a heavy default spring enabled. Unlike previous wheels, there is no command to disable this spring and it will only release when other forces are downloaded into the device.

---
 drivers/hid/Makefile                  |   2 +-
 drivers/hid/hid-logitech-hidpp-base.c | 114 +------
 drivers/hid/hid-logitech-hidpp-ff.c   | 540 ++++++++++++++++++++++++++++++++++
 drivers/hid/hid-logitech-hidpp-ff.h   |   9 +
 4 files changed, 554 insertions(+), 111 deletions(-)
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.h
drivers/hid/Makefile +1 -1
index a01c448..fd49428 100644
@@ -17,7 +17,7 @@ hid-logitech-$(CONFIG_LOGIRUMBLEPAD2_FF)	+= hid-lg2ff.o
 hid-logitech-$(CONFIG_LOGIG940_FF)	+= hid-lg3ff.o
 hid-logitech-$(CONFIG_LOGIWHEELS_FF)	+= hid-lg4ff.o
 
-hid-logitech-hidpp-y	:= hid-logitech-hidpp-base.o
+hid-logitech-hidpp-y	:= hid-logitech-hidpp-base.o hid-logitech-hidpp-ff.o
 
 hid-wiimote-y		:= hid-wiimote-core.o hid-wiimote-modules.o
 hid-wiimote-$(CONFIG_DEBUG_FS)	+= hid-wiimote-debug.o
drivers/hid/hid-logitech-hidpp-base.c +4 -110

157 lines not on this page · raw message

drivers/hid/hid-logitech-hidpp-ff.c new file +540 -0

540 lines not on this page · raw message

drivers/hid/hid-logitech-hidpp-ff.h new file +9 -0
new file mode 100644
index 0000000..e153019
@@ -0,0 +1,9 @@
+#ifndef __HID_LOGITECH_HIDPP_FF_H
+#define __HID_LOGITECH_HIDPP_FF_H
+
+#include "hid-logitech-hidpp-base.h"
+
+int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index);
+int hidpp_ff_deinit(struct hid_device *hid);
+
+#endif
Signature · 1 line
2.5.0
#4 lore raw
Quoted 11 lines · Jiri Kosina
Quoted 5 lines · Edwin Velds

This patch implements force feedback support for the Logitech G920 Driving Force Racing Wheel.

This patch is based on the basic G920 support patch by Simon Wood:
http://www.spinics.net/lists/linux-input/msg42174.html

Simon, it'd be nice if I could get your Tested-by: / Reviewed-by: for this.

Talking about it, I am not a big fan of renaming hid-logitech-hidpp.c into hid-logitech-hidpp-base.c. This will just break history for no reasons.
We could keep it named like that and just add the ff module later.

The other question is why do we need to have the ff module in a separate file? We generally try to keep the number of file to a small number, and I am not sure we need to split this for ff only. I am open to any position in favor of splitting, I am just asking.

Cheers,
Benjamin

Tested-by on the v1 series
#5 lore raw
In reply to Edwin Velds
Quoted 32 lines · Edwin Velds

This patch implements force feedback support for the Logitech G920 Driving Force Racing Wheel.

This patch is based on the basic G920 support patch by Simon Wood:
http://www.spinics.net/lists/linux-input/msg42174.html

The first patch splits and renames the HID++ driver (hid-logitech-hidpp.c) into a basic header and implementation in order to allow building additional features from multiple sources. Since this only satisfies the needs for the FF driver, any comments or suggestions are welcome.

The second patch implements all supported force feedback effects. The force feedback implementation was not made optional because the G920 (like all Logitech wheels) can't function without it due to very stiff to default springs.

Edwin Velds (1):
HID: Create header for Logitech HID++ driver
HID: Force feedback support for the Logitech G920

 drivers/hid/Makefile                  |    2 +
 drivers/hid/hid-logitech-hidpp-base.c | 1725 ++++++++++++++++++++++++++++++
 drivers/hid/hid-logitech-hidpp-base.h |   81 ++
 drivers/hid/hid-logitech-hidpp-ff.c   |  540 ++++++++++
 drivers/hid/hid-logitech-hidpp-ff.h   |    9 +
 drivers/hid/hid-logitech-hidpp.c      | 1900 ---------------------------------
 6 files changed, 2357 insertions(+), 1900 deletions(-)
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-base.h
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.c
 create mode 100644 drivers/hid/hid-logitech-hidpp-ff.h
 delete mode 100644 drivers/hid/hid-logitech-hidpp.c
Quoted 3 lines

--
2.5.0

You have my:

Note however that at least a V2 can be expected:
I did a review off-list just before this patchset made it to this mailing list, and not all changes are applied yet.

Thanks,
Elias