Commit 9846f350ef4d4108c1154acfc125fe8d8630ef84
Committed by
Jiri Kosina
1 parent
ef566d30a7
Exists in
master
and in
7 other branches
HID: magicmouse: disable and add module param for scroll acceleration
Scroll acceleration is unique to the magicmouse driver, and is unintuitive to a user who is unaware of the functionality. Thus, disable it by default, but add a module parameter to enable it for power users who want it. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Michael Poole <mdpoole@troilus.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff
drivers/hid/hid-magicmouse.c
... | ... | @@ -30,6 +30,10 @@ |
30 | 30 | module_param(emulate_scroll_wheel, bool, 0644); |
31 | 31 | MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel"); |
32 | 32 | |
33 | +static bool scroll_acceleration = false; | |
34 | +module_param(scroll_acceleration, bool, 0644); | |
35 | +MODULE_PARM_DESC(scroll_acceleration, "Accelerate sequential scroll events"); | |
36 | + | |
33 | 37 | static bool report_touches = true; |
34 | 38 | module_param(report_touches, bool, 0644); |
35 | 39 | MODULE_PARM_DESC(report_touches, "Emit touch records (otherwise, only use them for emulation)"); |
... | ... | @@ -177,7 +181,9 @@ |
177 | 181 | switch (tdata[7] & TOUCH_STATE_MASK) { |
178 | 182 | case TOUCH_STATE_START: |
179 | 183 | msc->touches[id].scroll_y = y; |
180 | - msc->scroll_accel = min_t(int, msc->scroll_accel + 1, | |
184 | + if (scroll_acceleration) | |
185 | + msc->scroll_accel = min_t(int, | |
186 | + msc->scroll_accel + 1, | |
181 | 187 | ARRAY_SIZE(accel_profile) - 1); |
182 | 188 | break; |
183 | 189 | case TOUCH_STATE_DRAG: |