Re: [PATCH] HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad

Previous thread: [PATCH] staging/speakup: fix buildfailure by removing odd closing parenthesis by Peter Huewe on Wednesday, December 8, 2010 - 3:45 pm. (2 messages)

Next thread: [PATCH] avr32: Fix build failure conflicting types for 'sys_execve' by Peter Huewe on Wednesday, December 8, 2010 - 4:19 pm. (3 messages)
From: Chase Douglas
Date: Wednesday, December 8, 2010 - 4:08 pm

With the recent switch to having the hid layer handle standard axis
initialization, the Magic Trackpad now reports relative axes. This would
be fine in the normal mode, but the driver puts the device in multitouch
mode where no relative events are generated. Also, userspace software
depends on accurate axis information for device type detection. Thus,
ignoring the relative axes from the Magic Trackpad is best.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
---
 drivers/hid/hid-magicmouse.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index e6dc151..ed732b7 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -433,6 +433,11 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
 	if (!msc->input)
 		msc->input = hi->input;
 
+	/* Magic Trackpad does not give relative data after switching to MT */
+	if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
+	    field->flags & HID_MAIN_ITEM_RELATIVE)
+		return -1;
+
 	return 0;
 }
 
-- 
1.7.1

--

From: Jiri Kosina
Date: Thursday, December 9, 2010 - 6:41 am

Applied, thank you. I take it this should better go into .37 still, right?

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--

From: Chase Douglas
Date: Thursday, December 9, 2010 - 8:13 am

Yes, please.

Thanks,

-- Chase
--

From: Chase Douglas
Date: Monday, January 3, 2011 - 3:13 pm

Jiri,

It looks like this never got pushed to .37. Can you add "Cc:
stable@kernel.org" to the SOB area and push it?

Thanks,

-- Chase
--

From: Jiri Kosina
Date: Tuesday, January 4, 2011 - 3:25 am

Hi Chase,

I am not rebasing my tree, so it's not easy to add Cc: stable@kernel.org 
to the commit once it has been mirrored out.

But I have this commit in my list to send it to -stable once it goes to 
Linus, manually.

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--

Previous thread: [PATCH] staging/speakup: fix buildfailure by removing odd closing parenthesis by Peter Huewe on Wednesday, December 8, 2010 - 3:45 pm. (2 messages)

Next thread: [PATCH] avr32: Fix build failure conflicting types for 'sys_execve' by Peter Huewe on Wednesday, December 8, 2010 - 4:19 pm. (3 messages)