Commit d5d359b0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input fixes from Dmitry Torokhov:

 - add sanity checks to USB endpoints in various dirvers

 - max77650-onkey was missing an OF table which was preventing module
   autoloading

 - a revert and a different fix for F54 handling in Synaptics dirver

 - a fixup for handling register in pm8xxx vibrator driver

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: pm8xxx-vib - fix handling of separate enable register
  Input: keyspan-remote - fix control-message timeouts
  Input: max77650-onkey - add of_match table
  Input: rmi_f54 - read from FIFO in 32 byte blocks
  Revert "Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers"
  Input: sur40 - fix interface sanity checks
  Input: gtco - drop redundant variable reinit
  Input: gtco - fix extra-descriptor debug message
  Input: gtco - fix endpoint sanity check
  Input: aiptek - use descriptors of current altsetting
  Input: aiptek - fix endpoint sanity check
  Input: pegasus_notetaker - fix endpoint sanity check
  Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
  Input: evdev - convert kzalloc()/vzalloc() to kvzalloc()
parents 6381b442 996d5d5f
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -484,10 +484,7 @@ static int evdev_open(struct inode *inode, struct file *file)
	struct evdev_client *client;
	int error;

	client = kzalloc(struct_size(client, buffer, bufsize),
			 GFP_KERNEL | __GFP_NOWARN);
	if (!client)
		client = vzalloc(struct_size(client, buffer, bufsize));
	client = kvzalloc(struct_size(client, buffer, bufsize), GFP_KERNEL);
	if (!client)
		return -ENOMEM;

+6 −3
Original line number Diff line number Diff line
@@ -336,7 +336,8 @@ static int keyspan_setup(struct usb_device* dev)
	int retval = 0;

	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
				 0x11, 0x40, 0x5601, 0x0, NULL, 0, 0);
				 0x11, 0x40, 0x5601, 0x0, NULL, 0,
				 USB_CTRL_SET_TIMEOUT);
	if (retval) {
		dev_dbg(&dev->dev, "%s - failed to set bit rate due to error: %d\n",
			__func__, retval);
@@ -344,7 +345,8 @@ static int keyspan_setup(struct usb_device* dev)
	}

	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
				 0x44, 0x40, 0x0, 0x0, NULL, 0, 0);
				 0x44, 0x40, 0x0, 0x0, NULL, 0,
				 USB_CTRL_SET_TIMEOUT);
	if (retval) {
		dev_dbg(&dev->dev, "%s - failed to set resume sensitivity due to error: %d\n",
			__func__, retval);
@@ -352,7 +354,8 @@ static int keyspan_setup(struct usb_device* dev)
	}

	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
				 0x22, 0x40, 0x0, 0x0, NULL, 0, 0);
				 0x22, 0x40, 0x0, 0x0, NULL, 0,
				 USB_CTRL_SET_TIMEOUT);
	if (retval) {
		dev_dbg(&dev->dev, "%s - failed to turn receive on due to error: %d\n",
			__func__, retval);
+7 −0
Original line number Diff line number Diff line
@@ -108,9 +108,16 @@ static int max77650_onkey_probe(struct platform_device *pdev)
	return input_register_device(onkey->input);
}

static const struct of_device_id max77650_onkey_of_match[] = {
	{ .compatible = "maxim,max77650-onkey" },
	{ }
};
MODULE_DEVICE_TABLE(of, max77650_onkey_of_match);

static struct platform_driver max77650_onkey_driver = {
	.driver = {
		.name = "max77650-onkey",
		.of_match_table = max77650_onkey_of_match,
	},
	.probe = max77650_onkey_probe,
};
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static int pm8xxx_vib_set(struct pm8xxx_vib *vib, bool on)

	if (regs->enable_mask)
		rc = regmap_update_bits(vib->regmap, regs->enable_addr,
					on ? regs->enable_mask : 0, val);
					regs->enable_mask, on ? ~0 : 0);

	return rc;
}
+27 −16
Original line number Diff line number Diff line
@@ -24,6 +24,12 @@
#define F54_NUM_TX_OFFSET       1
#define F54_NUM_RX_OFFSET       0

/*
 * The smbus protocol can read only 32 bytes max at a time.
 * But this should be fine for i2c/spi as well.
 */
#define F54_REPORT_DATA_SIZE	32

/* F54 commands */
#define F54_GET_REPORT          1
#define F54_FORCE_CAL           2
@@ -526,6 +532,7 @@ static void rmi_f54_work(struct work_struct *work)
	int report_size;
	u8 command;
	int error;
	int i;

	report_size = rmi_f54_get_report_size(f54);
	if (report_size == 0) {
@@ -558,8 +565,11 @@ static void rmi_f54_work(struct work_struct *work)

	rmi_dbg(RMI_DEBUG_FN, &fn->dev, "Get report command completed, reading data\n");

	fifo[0] = 0;
	fifo[1] = 0;
	for (i = 0; i < report_size; i += F54_REPORT_DATA_SIZE) {
		int size = min(F54_REPORT_DATA_SIZE, report_size - i);

		fifo[0] = i & 0xff;
		fifo[1] = i >> 8;
		error = rmi_write_block(fn->rmi_dev,
					fn->fd.data_base_addr + F54_FIFO_OFFSET,
					fifo, sizeof(fifo));
@@ -569,13 +579,14 @@ static void rmi_f54_work(struct work_struct *work)
		}

		error = rmi_read_block(fn->rmi_dev, fn->fd.data_base_addr +
			       F54_REPORT_DATA_OFFSET, f54->report_data,
			       report_size);
				       F54_REPORT_DATA_OFFSET,
				       f54->report_data + i, size);
		if (error) {
			dev_err(&fn->dev, "%s: read [%d bytes] returned %d\n",
			__func__, report_size, error);
				__func__, size, error);
			goto abort;
		}
	}

abort:
	f54->report_size = error ? 0 : report_size;
Loading