Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f93220b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input

parents 2b8dfec8 d39969de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -549,6 +549,7 @@ running once the system is up.
			     keyboard and can not control its state
			     (Don't attempt to blink the leds)
	i8042.noaux	[HW] Don't check for auxiliary (== mouse) port
	i8042.nokbd	[HW] Don't check/create keyboard port
	i8042.nomux	[HW] Don't check presence of an active multiplexing
			     controller
	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
+56 −55
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
		return -EINVAL;
	if (keycode < 0 || keycode > KEY_MAX)
		return -EINVAL;
	if (keycode >> (dev->keycodesize * 8))
	if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8)))
		return -EINVAL;

	oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode);
@@ -1104,8 +1104,9 @@ static void kbd_keycode(unsigned int keycode, int down,
	else
		clear_bit(keycode, key_down);

	if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty && 
		(!L_ECHO(tty) && tty->driver->chars_in_buffer(tty))))) {
	if (rep &&
	    (!vc_kbd_mode(kbd, VC_REPEAT) ||
	     (tty && !L_ECHO(tty) && tty->driver->chars_in_buffer(tty)))) {
		/*
		 * Don't repeat a key if the input buffers are not empty and the
		 * characters get aren't echoed locally. This makes key repeat
@@ -1130,7 +1131,8 @@ static void kbd_keycode(unsigned int keycode, int down,
	type = KTYP(keysym);

	if (type < 0xf0) {
		if (down && !raw_mode) to_utf8(vc, keysym);
		if (down && !raw_mode)
			to_utf8(vc, keysym);
		return;
	}

@@ -1166,8 +1168,6 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
	schedule_console_callback();
}

static char kbd_name[] = "kbd";

/*
 * When a keyboard (or other input device) is found, the kbd_connect
 * function is called. The function then looks at the device, and if it
@@ -1182,9 +1182,10 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
	int i;

	for (i = KEY_RESERVED; i < BTN_MISC; i++)
		if (test_bit(i, dev->keybit)) break;
		if (test_bit(i, dev->keybit))
			break;

	if ((i == BTN_MISC) && !test_bit(EV_SND, dev->evbit)) 
	if (i == BTN_MISC && !test_bit(EV_SND, dev->evbit))
		return NULL;

	if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
@@ -1193,7 +1194,7 @@ static struct input_handle *kbd_connect(struct input_handler *handler,

	handle->dev = dev;
	handle->handler = handler;
	handle->name = kbd_name;
	handle->name = "kbd";

	input_open_device(handle);
	kbd_refresh_leds(handle);
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
			if (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL;
			if (get_user(v, ip + 1)) return -EFAULT;
			if (v < 0 || v > KEY_MAX) return -EINVAL;
			if (v >> (dev->keycodesize * 8)) return -EINVAL;
			if (dev->keycodesize < sizeof(v) && (v >> (dev->keycodesize * 8))) return -EINVAL;
			u = SET_INPUT_KEYCODE(dev, t, v);
			clear_bit(u, dev->keybit);
			set_bit(v, dev->keybit);
+7 −25
Original line number Diff line number Diff line
@@ -249,9 +249,6 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data,

int iforce_get_id_packet(struct iforce *iforce, char *packet)
{
	DECLARE_WAITQUEUE(wait, current);
	int timeout = HZ; /* 1 second */

	switch (iforce->bus) {

	case IFORCE_USB:
@@ -260,22 +257,13 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
		iforce->cr.bRequest = packet[0];
		iforce->ctrl->dev = iforce->usbdev;

		set_current_state(TASK_INTERRUPTIBLE);
		add_wait_queue(&iforce->wait, &wait);

		if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) {
			set_current_state(TASK_RUNNING);
			remove_wait_queue(&iforce->wait, &wait);
		if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC))
			return -1;
		}

		while (timeout && iforce->ctrl->status == -EINPROGRESS)
			timeout = schedule_timeout(timeout);
		wait_event_interruptible_timeout(iforce->wait,
			iforce->ctrl->status != -EINPROGRESS, HZ);

		set_current_state(TASK_RUNNING);
		remove_wait_queue(&iforce->wait, &wait);

		if (!timeout) {
		if (iforce->ctrl->status != -EINPROGRESS) {
			usb_unlink_urb(iforce->ctrl);
			return -1;
		}
@@ -290,16 +278,10 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
		iforce->expect_packet = FF_CMD_QUERY;
		iforce_send_packet(iforce, FF_CMD_QUERY, packet);

		set_current_state(TASK_INTERRUPTIBLE);
		add_wait_queue(&iforce->wait, &wait);

		while (timeout && iforce->expect_packet)
			timeout = schedule_timeout(timeout);

		set_current_state(TASK_RUNNING);
		remove_wait_queue(&iforce->wait, &wait);
		wait_event_interruptible_timeout(iforce->wait,
			!iforce->expect_packet, HZ);

		if (!timeout) {
		if (iforce->expect_packet) {
			iforce->expect_packet = 0;
			return -1;
		}
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ static void iforce_usb_irq(struct urb *urb, struct pt_regs *regs)
		goto exit;
	}

	wake_up(&iforce->wait);
	iforce_process_packet(iforce,
		(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);

Loading