From: "Simon Wood" <simon@mungewell.org>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: RFC: Backport HID-logitech to 3.10?
Date: Wed, 31 Aug 2016 18:56:20 -0600 [thread overview]
Message-ID: <8d56b91cd89e3da158940e53db67b993.squirrel@mungewell.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
Hi all,
I received a question regarding back-porting the support for the G29
racing wheel to 3.10 (Android in particular), and after some collaborative
work we determined that changes between 3.10 and 4.7 are actually pretty
minimal and self contained.
After copying the HEAD 'hid-lg.[ch]' and 'hid-lg4ff.[ch]' from 4.7, there
is a minimal patch (example attached) required to get the build working.
My question to the list would be how this would/could be implemented, and
how the process works as 3.10 moves through the mainline patches to reach
current HEAD.
Any hints that anyone has would be appreciated.
Simon.
[-- Attachment #2: 0002-HID-hid-logitech-backported-from-v4.7-to-v3.10.102.patch --]
[-- Type: application/octet-stream, Size: 4665 bytes --]
From c787af2beed23b38f80deb87e9d8b9ea37b326b0 Mon Sep 17 00:00:00 2001
From: Simon Wood <simon@mungewell.org>
Date: Mon, 29 Aug 2016 22:10:53 -0600
Subject: [PATCH 2/2] HID: hid-logitech backported from v4.7 to v3.10.102
Fix build after grabbing HEAD from v4.7. MD5Sums of 'imported' files:
--
047a99a2273916fc997b1e35cee4201b drivers/hid/hid-lg4ff.h
8095fd840a2716a4cbc97b5015e28c66 drivers/hid/hid-lg.c
7d84dd914a0c7dabf714eb6c668ca974 drivers/hid/hid-lgff.c
3349257e93faac304de8202844f14972 drivers/hid/hid-lg.h
--
---
drivers/hid/hid-core.c | 2 ++
drivers/hid/hid-ids.h | 2 ++
drivers/hid/hid-lg.c | 11 +++++++++++
drivers/hid/hid-lg4ff.c | 6 ++++++
4 files changed, 21 insertions(+)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c1a8cf2..78f4481 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1705,10 +1705,12 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DUAL_ACTION) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD_CORD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G29_WHEEL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_F3D) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 45c593d..ac4a081 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -537,8 +537,10 @@
#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD_CORD 0xc20a
#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD 0xc211
#define USB_DEVICE_ID_LOGITECH_EXTREME_3D 0xc215
+#define USB_DEVICE_ID_LOGITECH_DUAL_ACTION 0xc216
#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2 0xc218
#define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2 0xc219
+#define USB_DEVICE_ID_LOGITECH_G29_WHEEL 0xc24f
#define USB_DEVICE_ID_LOGITECH_WINGMAN_F3D 0xc283
#define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
#define USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940 0xc287
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index feb2be7..9c4bbd4 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -23,6 +23,7 @@
#include <linux/sched.h>
#include <linux/usb.h>
#include <linux/wait.h>
+#include <linux/version.h>
#include "usbhid/usbhid.h"
#include "hid-ids.h"
@@ -703,8 +704,13 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) {
unsigned char buf[] = { 0x00, 0xAF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+/* backport from v4.7 - locally revert b0dd72aafd785785bedbb6db932955807e454a65 */
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,14,0)
+ ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
+#else
ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+#endif
if (ret >= 0) {
/* insert a little delay of 10 jiffies ~ 40ms */
@@ -717,8 +723,13 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
buf[1] = 0xB2;
get_random_bytes(&buf[2], 2);
+/* backport from v4.7 - locally revert b0dd72aafd785785bedbb6db932955807e454a65 */
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,14,0)
+ ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
+#else
ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+#endif
}
}
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index af3a8ec..4122646 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -33,6 +33,12 @@
#include "hid-lg4ff.h"
#include "hid-ids.h"
+/* Backport from v4.7 - locally revert d8ce9bf5551bfea431893bdd0a943f24a5170828 */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,0)
+#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev)
+#endif
+
#define LG4FF_MMODE_IS_MULTIMODE 0
#define LG4FF_MMODE_SWITCHED 1
#define LG4FF_MMODE_NOT_MULTIMODE 2
--
2.7.4
next reply other threads:[~2016-09-01 1:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 0:56 Simon Wood [this message]
2016-09-02 9:32 ` Benjamin Tissoires
2016-09-02 14:59 ` Simon Wood
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=8d56b91cd89e3da158940e53db67b993.squirrel@mungewell.org \
--to=simon@mungewell.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®