aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-11-03 02:20:45 -0700
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-11-05 11:48:40 -0800
commit24b8fe914b6fcaca063292aaf7df4822892f37be (patch)
treea802ef35c4e8fe55f1b3a3f52f1166aed066e606
parent711a4b2a329a7f22b3e8338bdc94550b958fe07c (diff)
In newer kernel we now have the input_configured callback, which is executed at the same time as used to be input_register. Let's switch to upstream's version. This mostly repeats the following patch, except that I'm not adding anything, but accommodating the code for newer kernels: commit 420359667ce49da1f5d6b081abf5cb6db0d7b700 Author: Jaikumar Ganesh <jaikumarg@android.com> Date: Tue Sep 20 16:47:43 2011 -0700 HID: magicmouse: Add input_register callback. The magicmouse driver needs to setup the input mapping after reports are parsed but before device is registered. Change-Id: Ic3a0ff4fc056f5d374bb7ea1bd831a175c690b0b Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com> I don't know the background for the patch, though. The initial description isn't very helpful to understand the root cause for the change. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
-rw-r--r--drivers/hid/hid-magicmouse.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 5078168c248d..106c875ef2bb 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -351,8 +351,9 @@ static int magicmouse_raw_event(struct hid_device *hdev,
return 1;
}
-static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hdev)
+static int magicmouse_setup_input(struct hid_device *hdev, struct hid_input *hi)
{
+ struct input_dev *input = hi->input;
int error;
__set_bit(EV_KEY, input->evbit);
@@ -493,17 +494,6 @@ static int magicmouse_probe(struct hid_device *hdev,
goto err_free;
}
- /* We do this after hid-input is done parsing reports so that
- * hid-input uses the most natural button and axis IDs.
- */
- if (msc->input) {
- ret = magicmouse_setup_input(msc->input, hdev);
- if (ret) {
- hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
- goto err_stop_hw;
- }
- }
-
if (id->product == USB_DEVICE_ID_APPLE_MAGICMOUSE)
report = hid_register_report(hdev, HID_INPUT_REPORT,
MOUSE_REPORT_ID);
@@ -568,7 +558,7 @@ static struct hid_driver magicmouse_driver = {
.remove = magicmouse_remove,
.raw_event = magicmouse_raw_event,
.input_mapping = magicmouse_input_mapping,
- .input_register = magicmouse_setup_input,
+ .input_configured = magicmouse_setup_input,
};
static int __init magicmouse_init(void)