hid-magicmouse.c (ef434a0c2ce765ad33026375db7d23aebd5e9532) | hid-magicmouse.c (e4dca7b7aa08b22893c45485d222b5807c1375ae) |
---|---|
1/* 2 * Apple "Magic" Wireless Mouse driver 3 * 4 * Copyright (c) 2010 Michael Poole <mdpoole@troilus.org> 5 * Copyright (c) 2010 Chase Douglas <chase.douglas@canonical.com> 6 */ 7 8/* --- 20 unchanged lines hidden (view full) --- 29static int middle_button_start = -350; 30static int middle_button_stop = +350; 31 32static bool emulate_scroll_wheel = true; 33module_param(emulate_scroll_wheel, bool, 0644); 34MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel"); 35 36static unsigned int scroll_speed = 32; | 1/* 2 * Apple "Magic" Wireless Mouse driver 3 * 4 * Copyright (c) 2010 Michael Poole <mdpoole@troilus.org> 5 * Copyright (c) 2010 Chase Douglas <chase.douglas@canonical.com> 6 */ 7 8/* --- 20 unchanged lines hidden (view full) --- 29static int middle_button_start = -350; 30static int middle_button_stop = +350; 31 32static bool emulate_scroll_wheel = true; 33module_param(emulate_scroll_wheel, bool, 0644); 34MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel"); 35 36static unsigned int scroll_speed = 32; |
37static int param_set_scroll_speed(const char *val, struct kernel_param *kp) { | 37static int param_set_scroll_speed(const char *val, 38 const struct kernel_param *kp) { |
38 unsigned long speed; 39 if (!val || kstrtoul(val, 0, &speed) || speed > 63) 40 return -EINVAL; 41 scroll_speed = speed; 42 return 0; 43} 44module_param_call(scroll_speed, param_set_scroll_speed, param_get_uint, &scroll_speed, 0644); 45MODULE_PARM_DESC(scroll_speed, "Scroll speed, value from 0 (slow) to 63 (fast)"); --- 550 unchanged lines hidden --- | 39 unsigned long speed; 40 if (!val || kstrtoul(val, 0, &speed) || speed > 63) 41 return -EINVAL; 42 scroll_speed = speed; 43 return 0; 44} 45module_param_call(scroll_speed, param_set_scroll_speed, param_get_uint, &scroll_speed, 0644); 46MODULE_PARM_DESC(scroll_speed, "Scroll speed, value from 0 (slow) to 63 (fast)"); --- 550 unchanged lines hidden --- |