Răsfoiți Sursa

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:
 "Just small driver fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: colibri-vf50-ts - add missing #include <linux/of.h>
  Input: adp5589 - fix row 5 handling for adp5589
  Input: edt-ft5x06 - fix setting gain, offset, and threshold via device tree
  Input: vmmouse - fix absolute device registration
  Input: serio - drop warnings in case of EPROBE_DEFER from serio_find_driver()
  Input: cap11xx - add missing of_node_put
  Input: sirfsoc-onkey - allow modular build
  Input: xpad - remove unused function
Linus Torvalds 9 ani în urmă
părinte
comite
74c7b2af37

+ 0 - 1
drivers/input/joystick/xpad.c

@@ -1207,7 +1207,6 @@ static void xpad_led_disconnect(struct usb_xpad *xpad)
 #else
 #else
 static int xpad_led_probe(struct usb_xpad *xpad) { return 0; }
 static int xpad_led_probe(struct usb_xpad *xpad) { return 0; }
 static void xpad_led_disconnect(struct usb_xpad *xpad) { }
 static void xpad_led_disconnect(struct usb_xpad *xpad) { }
-static void xpad_identify_controller(struct usb_xpad *xpad) { }
 #endif
 #endif
 
 
 static int xpad_start_input(struct usb_xpad *xpad)
 static int xpad_start_input(struct usb_xpad *xpad)

+ 4 - 3
drivers/input/keyboard/adp5589-keys.c

@@ -235,7 +235,7 @@ struct adp5589_kpad {
 	unsigned short gpimapsize;
 	unsigned short gpimapsize;
 	unsigned extend_cfg;
 	unsigned extend_cfg;
 	bool is_adp5585;
 	bool is_adp5585;
-	bool adp5585_support_row5;
+	bool support_row5;
 #ifdef CONFIG_GPIOLIB
 #ifdef CONFIG_GPIOLIB
 	unsigned char gpiomap[ADP5589_MAXGPIO];
 	unsigned char gpiomap[ADP5589_MAXGPIO];
 	bool export_gpio;
 	bool export_gpio;
@@ -485,7 +485,7 @@ static int adp5589_build_gpiomap(struct adp5589_kpad *kpad,
 	if (kpad->extend_cfg & C4_EXTEND_CFG)
 	if (kpad->extend_cfg & C4_EXTEND_CFG)
 		pin_used[kpad->var->c4_extend_cfg] = true;
 		pin_used[kpad->var->c4_extend_cfg] = true;
 
 
-	if (!kpad->adp5585_support_row5)
+	if (!kpad->support_row5)
 		pin_used[5] = true;
 		pin_used[5] = true;
 
 
 	for (i = 0; i < kpad->var->maxgpio; i++)
 	for (i = 0; i < kpad->var->maxgpio; i++)
@@ -884,12 +884,13 @@ static int adp5589_probe(struct i2c_client *client,
 
 
 	switch (id->driver_data) {
 	switch (id->driver_data) {
 	case ADP5585_02:
 	case ADP5585_02:
-		kpad->adp5585_support_row5 = true;
+		kpad->support_row5 = true;
 	case ADP5585_01:
 	case ADP5585_01:
 		kpad->is_adp5585 = true;
 		kpad->is_adp5585 = true;
 		kpad->var = &const_adp5585;
 		kpad->var = &const_adp5585;
 		break;
 		break;
 	case ADP5589:
 	case ADP5589:
+		kpad->support_row5 = true;
 		kpad->var = &const_adp5589;
 		kpad->var = &const_adp5589;
 		break;
 		break;
 	}
 	}

+ 6 - 2
drivers/input/keyboard/cap11xx.c

@@ -304,8 +304,10 @@ static int cap11xx_init_leds(struct device *dev,
 		led->cdev.brightness = LED_OFF;
 		led->cdev.brightness = LED_OFF;
 
 
 		error = of_property_read_u32(child, "reg", &reg);
 		error = of_property_read_u32(child, "reg", &reg);
-		if (error != 0 || reg >= num_leds)
+		if (error != 0 || reg >= num_leds) {
+			of_node_put(child);
 			return -EINVAL;
 			return -EINVAL;
+		}
 
 
 		led->reg = reg;
 		led->reg = reg;
 		led->priv = priv;
 		led->priv = priv;
@@ -313,8 +315,10 @@ static int cap11xx_init_leds(struct device *dev,
 		INIT_WORK(&led->work, cap11xx_led_work);
 		INIT_WORK(&led->work, cap11xx_led_work);
 
 
 		error = devm_led_classdev_register(dev, &led->cdev);
 		error = devm_led_classdev_register(dev, &led->cdev);
-		if (error)
+		if (error) {
+			of_node_put(child);
 			return error;
 			return error;
+		}
 
 
 		priv->num_leds++;
 		priv->num_leds++;
 		led++;
 		led++;

+ 1 - 1
drivers/input/misc/Kconfig

@@ -733,7 +733,7 @@ config INPUT_XEN_KBDDEV_FRONTEND
 	  module will be called xen-kbdfront.
 	  module will be called xen-kbdfront.
 
 
 config INPUT_SIRFSOC_ONKEY
 config INPUT_SIRFSOC_ONKEY
-	bool "CSR SiRFSoC power on/off/suspend key support"
+	tristate "CSR SiRFSoC power on/off/suspend key support"
 	depends on ARCH_SIRF && OF
 	depends on ARCH_SIRF && OF
 	default y
 	default y
 	help
 	help

+ 1 - 1
drivers/input/misc/sirfsoc-onkey.c

@@ -101,7 +101,7 @@ static void sirfsoc_pwrc_close(struct input_dev *input)
 static const struct of_device_id sirfsoc_pwrc_of_match[] = {
 static const struct of_device_id sirfsoc_pwrc_of_match[] = {
 	{ .compatible = "sirf,prima2-pwrc" },
 	{ .compatible = "sirf,prima2-pwrc" },
 	{},
 	{},
-}
+};
 MODULE_DEVICE_TABLE(of, sirfsoc_pwrc_of_match);
 MODULE_DEVICE_TABLE(of, sirfsoc_pwrc_of_match);
 
 
 static int sirfsoc_pwrc_probe(struct platform_device *pdev)
 static int sirfsoc_pwrc_probe(struct platform_device *pdev)

+ 7 - 6
drivers/input/mouse/vmmouse.c

@@ -458,8 +458,6 @@ int vmmouse_init(struct psmouse *psmouse)
 	priv->abs_dev = abs_dev;
 	priv->abs_dev = abs_dev;
 	psmouse->private = priv;
 	psmouse->private = priv;
 
 
-	input_set_capability(rel_dev, EV_REL, REL_WHEEL);
-
 	/* Set up and register absolute device */
 	/* Set up and register absolute device */
 	snprintf(priv->phys, sizeof(priv->phys), "%s/input1",
 	snprintf(priv->phys, sizeof(priv->phys), "%s/input1",
 		 psmouse->ps2dev.serio->phys);
 		 psmouse->ps2dev.serio->phys);
@@ -475,10 +473,6 @@ int vmmouse_init(struct psmouse *psmouse)
 	abs_dev->id.version = psmouse->model;
 	abs_dev->id.version = psmouse->model;
 	abs_dev->dev.parent = &psmouse->ps2dev.serio->dev;
 	abs_dev->dev.parent = &psmouse->ps2dev.serio->dev;
 
 
-	error = input_register_device(priv->abs_dev);
-	if (error)
-		goto init_fail;
-
 	/* Set absolute device capabilities */
 	/* Set absolute device capabilities */
 	input_set_capability(abs_dev, EV_KEY, BTN_LEFT);
 	input_set_capability(abs_dev, EV_KEY, BTN_LEFT);
 	input_set_capability(abs_dev, EV_KEY, BTN_RIGHT);
 	input_set_capability(abs_dev, EV_KEY, BTN_RIGHT);
@@ -488,6 +482,13 @@ int vmmouse_init(struct psmouse *psmouse)
 	input_set_abs_params(abs_dev, ABS_X, 0, VMMOUSE_MAX_X, 0, 0);
 	input_set_abs_params(abs_dev, ABS_X, 0, VMMOUSE_MAX_X, 0, 0);
 	input_set_abs_params(abs_dev, ABS_Y, 0, VMMOUSE_MAX_Y, 0, 0);
 	input_set_abs_params(abs_dev, ABS_Y, 0, VMMOUSE_MAX_Y, 0, 0);
 
 
+	error = input_register_device(priv->abs_dev);
+	if (error)
+		goto init_fail;
+
+	/* Add wheel capability to the relative device */
+	input_set_capability(rel_dev, EV_REL, REL_WHEEL);
+
 	psmouse->protocol_handler = vmmouse_process_byte;
 	psmouse->protocol_handler = vmmouse_process_byte;
 	psmouse->disconnect = vmmouse_disconnect;
 	psmouse->disconnect = vmmouse_disconnect;
 	psmouse->reconnect = vmmouse_reconnect;
 	psmouse->reconnect = vmmouse_reconnect;

+ 1 - 1
drivers/input/serio/serio.c

@@ -134,7 +134,7 @@ static void serio_find_driver(struct serio *serio)
 	int error;
 	int error;
 
 
 	error = device_attach(&serio->dev);
 	error = device_attach(&serio->dev);
-	if (error < 0)
+	if (error < 0 && error != -EPROBE_DEFER)
 		dev_warn(&serio->dev,
 		dev_warn(&serio->dev,
 			 "device_attach() failed for %s (%s), error: %d\n",
 			 "device_attach() failed for %s (%s), error: %d\n",
 			 serio->phys, serio->name, error);
 			 serio->phys, serio->name, error);

+ 1 - 0
drivers/input/touchscreen/colibri-vf50-ts.c

@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/slab.h>

+ 12 - 6
drivers/input/touchscreen/edt-ft5x06.c

@@ -822,16 +822,22 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
 	int error;
 	int error;
 
 
 	error = device_property_read_u32(dev, "threshold", &val);
 	error = device_property_read_u32(dev, "threshold", &val);
-	if (!error)
-		reg_addr->reg_threshold = val;
+	if (!error) {
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold, val);
+		tsdata->threshold = val;
+	}
 
 
 	error = device_property_read_u32(dev, "gain", &val);
 	error = device_property_read_u32(dev, "gain", &val);
-	if (!error)
-		reg_addr->reg_gain = val;
+	if (!error) {
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_gain, val);
+		tsdata->gain = val;
+	}
 
 
 	error = device_property_read_u32(dev, "offset", &val);
 	error = device_property_read_u32(dev, "offset", &val);
-	if (!error)
-		reg_addr->reg_offset = val;
+	if (!error) {
+		edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
+		tsdata->offset = val;
+	}
 }
 }
 
 
 static void
 static void