Commit 6264307e authored by Yufeng Shen's avatar Yufeng Shen Committed by Jiri Kosina

HID: magicmouse: Removing report_touches switch

Remove the report_touches switch as it is not so useful to turn
off reporting touch events for a touch device. Let the userspace
to do the filtering if the turning off is needed.

V2: Remove report_touches as suggeted by Chase Douglas
Signed-off-by: default avatarYufeng Shen <miletus@chromium.org>
Reviewed-and-tested-by: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 60d2c252
...@@ -48,10 +48,6 @@ static bool scroll_acceleration = false; ...@@ -48,10 +48,6 @@ static bool scroll_acceleration = false;
module_param(scroll_acceleration, bool, 0644); module_param(scroll_acceleration, bool, 0644);
MODULE_PARM_DESC(scroll_acceleration, "Accelerate sequential scroll events"); MODULE_PARM_DESC(scroll_acceleration, "Accelerate sequential scroll events");
static bool report_touches = true;
module_param(report_touches, bool, 0644);
MODULE_PARM_DESC(report_touches, "Emit touch records (otherwise, only use them for emulation)");
static bool report_undeciphered; static bool report_undeciphered;
module_param(report_undeciphered, bool, 0644); module_param(report_undeciphered, bool, 0644);
MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state field using a MSC_RAW event"); MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state field using a MSC_RAW event");
...@@ -276,7 +272,7 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda ...@@ -276,7 +272,7 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
msc->single_touch_id = SINGLE_TOUCH_UP; msc->single_touch_id = SINGLE_TOUCH_UP;
/* Generate the input events for this touch. */ /* Generate the input events for this touch. */
if (report_touches && down) { if (down) {
input_report_abs(input, ABS_MT_TRACKING_ID, id); input_report_abs(input, ABS_MT_TRACKING_ID, id);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major << 2); input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major << 2);
input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor << 2); input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor << 2);
...@@ -335,7 +331,7 @@ static int magicmouse_raw_event(struct hid_device *hdev, ...@@ -335,7 +331,7 @@ static int magicmouse_raw_event(struct hid_device *hdev,
for (ii = 0; ii < npoints; ii++) for (ii = 0; ii < npoints; ii++)
magicmouse_emit_touch(msc, ii, data + ii * 8 + 6); magicmouse_emit_touch(msc, ii, data + ii * 8 + 6);
if (report_touches && msc->ntouches == 0) if (msc->ntouches == 0)
input_mt_sync(input); input_mt_sync(input);
/* When emulating three-button mode, it is important /* When emulating three-button mode, it is important
...@@ -422,7 +418,7 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h ...@@ -422,7 +418,7 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit); __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
} }
if (report_touches) {
__set_bit(EV_ABS, input->evbit); __set_bit(EV_ABS, input->evbit);
input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0); input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
...@@ -467,7 +463,6 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h ...@@ -467,7 +463,6 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
} }
input_set_events_per_packet(input, 60); input_set_events_per_packet(input, 60);
}
if (report_undeciphered) { if (report_undeciphered) {
__set_bit(EV_MSC, input->evbit); __set_bit(EV_MSC, input->evbit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment