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

Commit 18751e2e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input fixes from Dmitry Torokhov.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: vmmouse - remove port reservation
  Input: elantech - add more IC body types to the list
  Input: wacom_w8001 - ignore invalid pen data packets
  Input: wacom_w8001 - w8001_MAX_LENGTH should be 13
  Input: xpad - fix oops when attaching an unknown Xbox One gamepad
  MAINTAINERS: add Pali Rohár as reviewer of ALPS PS/2 touchpad driver
  Input: add HDMI CEC specific keycodes
  Input: add BUS_CEC type
  Input: xpad - fix rumble on Xbox One controllers with 2015 firmware
parents 3992a272 60842ef8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -595,6 +595,10 @@ S: Odd Fixes
L:	linux-alpha@vger.kernel.org
F:	arch/alpha/

ALPS PS/2 TOUCHPAD DRIVER
R:	Pali Rohár <pali.rohar@gmail.com>
F:	drivers/input/mouse/alps.*

ALTERA MAILBOX DRIVER
M:	Ley Foon Tan <lftan@altera.com>
L:	nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
+21 −18
Original line number Diff line number Diff line
@@ -1031,17 +1031,17 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect

	case XTYPE_XBOXONE:
		packet->data[0] = 0x09; /* activate rumble */
		packet->data[1] = 0x08;
		packet->data[1] = 0x00;
		packet->data[2] = xpad->odata_serial++;
		packet->data[3] = 0x08; /* continuous effect */
		packet->data[4] = 0x00; /* simple rumble mode */
		packet->data[5] = 0x03; /* L and R actuator only */
		packet->data[6] = 0x00; /* TODO: LT actuator */
		packet->data[7] = 0x00; /* TODO: RT actuator */
		packet->data[3] = 0x09;
		packet->data[4] = 0x00;
		packet->data[5] = 0x0F;
		packet->data[6] = 0x00;
		packet->data[7] = 0x00;
		packet->data[8] = strong / 512;	/* left actuator */
		packet->data[9] = weak / 512;	/* right actuator */
		packet->data[10] = 0x80;	/* length of pulse */
		packet->data[11] = 0x00;	/* stop period of pulse */
		packet->data[10] = 0xFF;
		packet->data[11] = 0x00;
		packet->data[12] = 0x00;
		packet->len = 13;
		packet->pending = true;
@@ -1437,16 +1437,6 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
			break;
	}

	if (xpad_device[i].xtype == XTYPE_XBOXONE &&
	    intf->cur_altsetting->desc.bInterfaceNumber != 0) {
		/*
		 * The Xbox One controller lists three interfaces all with the
		 * same interface class, subclass and protocol. Differentiate by
		 * interface number.
		 */
		return -ENODEV;
	}

	xpad = kzalloc(sizeof(struct usb_xpad), GFP_KERNEL);
	if (!xpad)
		return -ENOMEM;
@@ -1478,6 +1468,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
		if (intf->cur_altsetting->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
			if (intf->cur_altsetting->desc.bInterfaceProtocol == 129)
				xpad->xtype = XTYPE_XBOX360W;
			else if (intf->cur_altsetting->desc.bInterfaceProtocol == 208)
				xpad->xtype = XTYPE_XBOXONE;
			else
				xpad->xtype = XTYPE_XBOX360;
		} else {
@@ -1492,6 +1484,17 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
			xpad->mapping |= MAP_STICKS_TO_NULL;
	}

	if (xpad->xtype == XTYPE_XBOXONE &&
	    intf->cur_altsetting->desc.bInterfaceNumber != 0) {
		/*
		 * The Xbox One controller lists three interfaces all with the
		 * same interface class, subclass and protocol. Differentiate by
		 * interface number.
		 */
		error = -ENODEV;
		goto err_free_in_urb;
	}

	error = xpad_init_output(intf, xpad);
	if (error)
		goto err_free_in_urb;
+1 −7
Original line number Diff line number Diff line
@@ -1568,13 +1568,7 @@ static int elantech_set_properties(struct elantech_data *etd)
		case 5:
			etd->hw_version = 3;
			break;
		case 6:
		case 7:
		case 8:
		case 9:
		case 10:
		case 13:
		case 14:
		case 6 ... 14:
			etd->hw_version = 4;
			break;
		default:
+2 −20
Original line number Diff line number Diff line
@@ -355,18 +355,11 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties)
		return -ENXIO;
	}

	if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) {
		psmouse_dbg(psmouse, "VMMouse port in use.\n");
		return -EBUSY;
	}

	/* Check if the device is present */
	response = ~VMMOUSE_PROTO_MAGIC;
	VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2);
	if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU) {
		release_region(VMMOUSE_PROTO_PORT, 4);
	if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU)
		return -ENXIO;
	}

	if (set_properties) {
		psmouse->vendor = VMMOUSE_VENDOR;
@@ -374,8 +367,6 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties)
		psmouse->model = version;
	}

	release_region(VMMOUSE_PROTO_PORT, 4);

	return 0;
}

@@ -394,7 +385,6 @@ static void vmmouse_disconnect(struct psmouse *psmouse)
	psmouse_reset(psmouse);
	input_unregister_device(priv->abs_dev);
	kfree(priv);
	release_region(VMMOUSE_PROTO_PORT, 4);
}

/**
@@ -438,15 +428,10 @@ int vmmouse_init(struct psmouse *psmouse)
	struct input_dev *rel_dev = psmouse->dev, *abs_dev;
	int error;

	if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) {
		psmouse_dbg(psmouse, "VMMouse port in use.\n");
		return -EBUSY;
	}

	psmouse_reset(psmouse);
	error = vmmouse_enable(psmouse);
	if (error)
		goto release_region;
		return error;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	abs_dev = input_allocate_device();
@@ -502,8 +487,5 @@ int vmmouse_init(struct psmouse *psmouse)
	kfree(priv);
	psmouse->private = NULL;

release_region:
	release_region(VMMOUSE_PROTO_PORT, 4);

	return error;
}
+10 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <jayakumar.lkml@gmail.com>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");

#define W8001_MAX_LENGTH	11
#define W8001_MAX_LENGTH	13
#define W8001_LEAD_MASK		0x80
#define W8001_LEAD_BYTE		0x80
#define W8001_TAB_MASK		0x40
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
		w8001->idx = 0;
		parse_multi_touch(w8001);
		break;

	default:
		/*
		 * ThinkPad X60 Tablet PC (pen only device) sometimes
		 * sends invalid data packets that are larger than
		 * W8001_PKTLEN_TPCPEN. Let's start over again.
		 */
		if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
			w8001->idx = 0;
	}

	return IRQ_HANDLED;
Loading