Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - fix device removal on unload
  Input: bcm5974 - adjust major/minor to scale
  Input: MT - initialize slots to unused
  Input: use PIT_TICK_RATE in vt beep ioctl
  Input: wacom - fix mousewheel handling for old wacom tablets
  • Loading branch information
Linus Torvalds committed Sep 8, 2010
2 parents 2c20130 + af045b8 commit cc491e2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
16 changes: 8 additions & 8 deletions drivers/char/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
case KIOCSOUND:
if (!perm)
goto eperm;
/* FIXME: This is an old broken API but we need to keep it
supported and somehow separate the historic advertised
tick rate from any real one */
/*
* The use of PIT_TICK_RATE is historic, it used to be
* the platform-dependent CLOCK_TICK_RATE between 2.6.12
* and 2.6.36, which was a minor but unfortunate ABI
* change.
*/
if (arg)
arg = CLOCK_TICK_RATE / arg;
arg = PIT_TICK_RATE / arg;
kd_mksound(arg, 0);
break;

Expand All @@ -553,11 +556,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
*/
ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
count = ticks ? (arg & 0xffff) : 0;
/* FIXME: This is an old broken API but we need to keep it
supported and somehow separate the historic advertised
tick rate from any real one */
if (count)
count = CLOCK_TICK_RATE / count;
count = PIT_TICK_RATE / count;
kd_mksound(count, ticks);
break;
}
Expand Down
11 changes: 9 additions & 2 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,11 +1599,14 @@ EXPORT_SYMBOL(input_free_device);
* @dev: input device supporting MT events and finger tracking
* @num_slots: number of slots used by the device
*
* This function allocates all necessary memory for MT slot handling
* in the input device, and adds ABS_MT_SLOT to the device capabilities.
* This function allocates all necessary memory for MT slot handling in the
* input device, and adds ABS_MT_SLOT to the device capabilities. All slots
* are initially marked as unused iby setting ABS_MT_TRACKING_ID to -1.
*/
int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots)
{
int i;

if (!num_slots)
return 0;

Expand All @@ -1614,6 +1617,10 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots)
dev->mtsize = num_slots;
input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0);

/* Mark slots as 'unused' */
for (i = 0; i < num_slots; i++)
dev->mt[i].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1;

return 0;
}
EXPORT_SYMBOL(input_mt_create_slots);
Expand Down
12 changes: 8 additions & 4 deletions drivers/input/mouse/bcm5974.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,14 @@ static void report_finger_data(struct input_dev *input,
const struct bcm5974_config *cfg,
const struct tp_finger *f)
{
input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major));
input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor));
input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major));
input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor));
input_report_abs(input, ABS_MT_TOUCH_MAJOR,
raw2int(f->force_major) << 1);
input_report_abs(input, ABS_MT_TOUCH_MINOR,
raw2int(f->force_minor) << 1);
input_report_abs(input, ABS_MT_WIDTH_MAJOR,
raw2int(f->size_major) << 1);
input_report_abs(input, ABS_MT_WIDTH_MINOR,
raw2int(f->size_minor) << 1);
input_report_abs(input, ABS_MT_ORIENTATION,
MAX_FINGER_ORIENTATION - raw2int(f->orientation));
input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x));
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,8 @@ static int __init i8042_init(void)

static void __exit i8042_exit(void)
{
platform_driver_unregister(&i8042_driver);
platform_device_unregister(i8042_platform_device);
platform_driver_unregister(&i8042_driver);
i8042_platform_exit();

panic_blink = NULL;
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
if (features->type == WACOM_G4 ||
features->type == WACOM_MO) {
input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f);
rw = (signed)(data[7] & 0x04) - (data[7] & 0x03);
rw = (data[7] & 0x04) - (data[7] & 0x03);
} else {
input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f);
rw = -(signed)data[6];
rw = -(signed char)data[6];
}
input_report_rel(input, REL_WHEEL, rw);
}
Expand Down

0 comments on commit cc491e2

Please sign in to comment.