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

Commit 026f8f61 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input updates from Dmitry Torokhov:
 "A bit later than I would want, but the changes are very minor - a few
  new device IDs for new hardware in existing drivers, fix for battery
  in Wacom devices not be considered system battery and cause emergency
  hibernations, and a couple of other bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ALPS - add support for model found on Dell XT2
  Input: wacom - add support for ISDv4 0x10E sensor
  Input: wacom - add support for ISDv4 0x10F sensor
  Input: wacom - export battery scope
  Input: cm109 - convert high volume dev_err() to dev_err_ratelimited()
  Input: move name/timer init to input_alloc_dev()
  Input: i8042 - i8042_flush fix for a full 8042 buffer
  Input: pxa27x_keypad - fix NULL pointer dereference
parents e7647027 5beea882
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1734,6 +1734,7 @@ EXPORT_SYMBOL_GPL(input_class);
 */
struct input_dev *input_allocate_device(void)
{
	static atomic_t input_no = ATOMIC_INIT(0);
	struct input_dev *dev;

	dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
@@ -1743,9 +1744,13 @@ struct input_dev *input_allocate_device(void)
		device_initialize(&dev->dev);
		mutex_init(&dev->mutex);
		spin_lock_init(&dev->event_lock);
		init_timer(&dev->timer);
		INIT_LIST_HEAD(&dev->h_list);
		INIT_LIST_HEAD(&dev->node);

		dev_set_name(&dev->dev, "input%ld",
			     (unsigned long) atomic_inc_return(&input_no) - 1);

		__module_get(THIS_MODULE);
	}

@@ -2019,7 +2024,6 @@ static void devm_input_device_unregister(struct device *dev, void *res)
 */
int input_register_device(struct input_dev *dev)
{
	static atomic_t input_no = ATOMIC_INIT(0);
	struct input_devres *devres = NULL;
	struct input_handler *handler;
	unsigned int packet_size;
@@ -2059,7 +2063,6 @@ int input_register_device(struct input_dev *dev)
	 * If delay and period are pre-set by the driver, then autorepeating
	 * is handled by the driver itself and we don't do it in input.c.
	 */
	init_timer(&dev->timer);
	if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD]) {
		dev->timer.data = (long) dev;
		dev->timer.function = input_repeat_key;
@@ -2073,9 +2076,6 @@ int input_register_device(struct input_dev *dev)
	if (!dev->setkeycode)
		dev->setkeycode = input_default_setkeycode;

	dev_set_name(&dev->dev, "input%ld",
		     (unsigned long) atomic_inc_return(&input_no) - 1);

	error = device_add(&dev->dev);
	if (error)
		goto err_free_vals;
+9 −2
Original line number Diff line number Diff line
@@ -786,10 +786,17 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
	input_set_capability(input_dev, EV_MSC, MSC_SCAN);

	if (pdata)
	if (pdata) {
		error = pxa27x_keypad_build_keycode(keypad);
	else
	} else {
		error = pxa27x_keypad_build_keycode_from_dt(keypad);
		/*
		 * Data that we get from DT resides in dynamically
		 * allocated memory so we need to update our pdata
		 * pointer.
		 */
		pdata = keypad->pdata;
	}
	if (error) {
		dev_err(&pdev->dev, "failed to build keycode\n");
		goto failed_put_clk;
+10 −4
Original line number Diff line number Diff line
@@ -351,7 +351,9 @@ static void cm109_urb_irq_callback(struct urb *urb)
	if (status) {
		if (status == -ESHUTDOWN)
			return;
		dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
		dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n",
				    __func__, status);
		goto out;
	}

	/* Special keys */
@@ -418,8 +420,12 @@ static void cm109_urb_ctl_callback(struct urb *urb)
	     dev->ctl_data->byte[2],
	     dev->ctl_data->byte[3]);

	if (status)
		dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
	if (status) {
		if (status == -ESHUTDOWN)
			return;
		dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n",
				    __func__, status);
	}

	spin_lock(&dev->ctl_submit_lock);

@@ -427,7 +433,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)

	if (likely(!dev->shutdown)) {

		if (dev->buzzer_pending) {
		if (dev->buzzer_pending || status) {
			dev->buzzer_pending = 0;
			dev->ctl_urb_pending = 1;
			cm109_submit_buzz_toggle(dev);
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ static const struct alps_model_info alps_model_data[] = {
	/* Dell Latitude E5500, E6400, E6500, Precision M4400 */
	{ { 0x62, 0x02, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf,
		ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
	{ { 0x73, 0x00, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_DUALPOINT },		/* Dell XT2 */
	{ { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS },		/* Dell Vostro 1400 */
	{ { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff,
		ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },				/* Toshiba Tecra A11-11L */
+14 −9
Original line number Diff line number Diff line
@@ -223,21 +223,26 @@ static int i8042_flush(void)
{
	unsigned long flags;
	unsigned char data, str;
	int i = 0;
	int count = 0;
	int retval = 0;

	spin_lock_irqsave(&i8042_lock, flags);

	while (((str = i8042_read_status()) & I8042_STR_OBF) && (i < I8042_BUFFER_SIZE)) {
	while ((str = i8042_read_status()) & I8042_STR_OBF) {
		if (count++ < I8042_BUFFER_SIZE) {
			udelay(50);
			data = i8042_read_data();
		i++;
			dbg("%02x <- i8042 (flush, %s)\n",
			    data, str & I8042_STR_AUXDATA ? "aux" : "kbd");
		} else {
			retval = -EIO;
			break;
		}
	}

	spin_unlock_irqrestore(&i8042_lock, flags);

	return i;
	return retval;
}

/*
@@ -849,7 +854,7 @@ static int __init i8042_check_aux(void)

static int i8042_controller_check(void)
{
	if (i8042_flush() == I8042_BUFFER_SIZE) {
	if (i8042_flush()) {
		pr_err("No controller found\n");
		return -ENODEV;
	}
Loading