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


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


	if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty && 
	if (rep &&
		(!L_ECHO(tty) && tty->driver->chars_in_buffer(tty))))) {
	    (!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
		 * Don't repeat a key if the input buffers are not empty and the
		 * characters get aren't echoed locally. This makes key repeat
		 * 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);
	type = KTYP(keysym);


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


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


static char kbd_name[] = "kbd";

/*
/*
 * When a keyboard (or other input device) is found, the kbd_connect
 * 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
 * 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;
	int i;


	for (i = KEY_RESERVED; i < BTN_MISC; 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;
		return NULL;


	if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
	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->dev = dev;
	handle->handler = handler;
	handle->handler = handler;
	handle->name = kbd_name;
	handle->name = "kbd";


	input_open_device(handle);
	input_open_device(handle);
	kbd_refresh_leds(handle);
	kbd_refresh_leds(handle);
+1 −1
Original line number Original line 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 (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL;
			if (get_user(v, ip + 1)) return -EFAULT;
			if (get_user(v, ip + 1)) return -EFAULT;
			if (v < 0 || v > KEY_MAX) return -EINVAL;
			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);
			u = SET_INPUT_KEYCODE(dev, t, v);
			clear_bit(u, dev->keybit);
			clear_bit(u, dev->keybit);
			set_bit(v, dev->keybit);
			set_bit(v, dev->keybit);
+7 −25
Original line number Original line 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)
int iforce_get_id_packet(struct iforce *iforce, char *packet)
{
{
	DECLARE_WAITQUEUE(wait, current);
	int timeout = HZ; /* 1 second */

	switch (iforce->bus) {
	switch (iforce->bus) {


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


		set_current_state(TASK_INTERRUPTIBLE);
		if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC))
		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);
			return -1;
			return -1;
		}


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


		set_current_state(TASK_RUNNING);
		if (iforce->ctrl->status != -EINPROGRESS) {
		remove_wait_queue(&iforce->wait, &wait);

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


		set_current_state(TASK_INTERRUPTIBLE);
		wait_event_interruptible_timeout(iforce->wait,
		add_wait_queue(&iforce->wait, &wait);
			!iforce->expect_packet, HZ);

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

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


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


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


Loading