[PATCH 1/2] Input: cyttsp - Fix check after pointer dereferencing

From: Javier Martinez Canillas <martinez.javier <at> dowhile0.org>

In the cyttsp_probe() function the struct device *dev pointer was
dereferenced before checking if it was NULL.

Now dev is never NULL since both I2C and SPI bus drivers pass a pointer to a
member of an previously allocated structure. But others bus drivers can do
it differently so is better to sanity check instead of trust in the callers.

Reported-by: Dan Carpenter <dan.carpenter <at> oracle.com>
Signed-off-by: Javier Martinez Canillas <javier <at> dowhile0.org>
---
 drivers/input/touchscreen/cyttsp_core.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 8be2247..071e5ae8 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -518,12 +518,19 @@ static void cyttsp_close(struct input_dev *dev)
 struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
 			    struct device *dev, int irq, size_t xfer_buf_size)
 {
-	const struct cyttsp_platform_data *pdata = dev->platform_data;
+	const struct cyttsp_platform_data *pdata;
 	struct cyttsp *ts;
 	struct input_dev *input_dev;
 	int error;

-	if (!dev || !bus_ops || !pdata || !pdata->name || irq <= 0) {
(Continue reading)

Andres Salomon | 9 Feb 07:57

[PATCH 1/2] input: psmouse: allow drivers to use psmouse_{de,}activate

Other drivers duplicate this code; no sense in having it be private
to psmouse-base.

Signed-off-by: Andres Salomon <dilinger <at> queued.net>
---
 drivers/input/mouse/psmouse-base.c |   15 ++++++++++-----
 drivers/input/mouse/psmouse.h      |    2 ++
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index e6c9931..22fe254 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1092,28 +1092,33 @@ static void psmouse_initialize(struct psmouse *psmouse)
  * psmouse_activate() enables the mouse so that we get motion reports from it.
  */

-static void psmouse_activate(struct psmouse *psmouse)
+int psmouse_activate(struct psmouse *psmouse)
 {
-	if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE))
+	if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
 		psmouse_warn(psmouse, "Failed to enable mouse on %s\n",
 			     psmouse->ps2dev.serio->phys);
+		return -1;
+	}

 	psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+	return 0;
 }
(Continue reading)

Nikolai Kondrashov | 6 Feb 21:54
Picon
Gravatar

[PATCH 1/1] HID: waltop: Add support for Waltop Q Pad

Add support for Waltop Q Pad by fixing its report descriptor.

This tablet is also sold as Aiptek HyperPen Mini. Other possible names
include: NGS Flexi Style, VisTablet PenPad, iVistaTablet Q Flex Pad, Bravod
Q-PD65-S.

Signed-off-by: Nikolai Kondrashov <spbnick <at> gmail.com>
---
 drivers/hid/hid-core.c   |    1 +
 drivers/hid/hid-ids.h    |    1 +
 drivers/hid/hid-waltop.c |  192 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 90346cf..68049c0 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1559,6 +1559,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index c207f40..40e7982 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -706,6 +706,7 @@
(Continue reading)

Tobias Klauser | 6 Feb 18:30
Picon
Favicon
Gravatar

[PATCH] Input: gpio_keys - Remove useless reinitialization of pdata->nbuttons

pdata is zeroed using memset just a few lines before, so there is no
need to set the nbuttons member to 0 again.

Signed-off-by: Tobias Klauser <tklauser <at> distanz.ch>
---
 drivers/input/keyboard/gpio_keys.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index ed1ed46..eb57690 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -472,7 +472,6 @@ static int gpio_keys_get_devtree_pdata(struct device *dev,
 	pdata->rep = !!of_get_property(node, "autorepeat", NULL);

 	/* First count the subnodes */
-	pdata->nbuttons = 0;
 	pp = NULL;
 	while ((pp = of_get_next_child(node, pp)))
 		pdata->nbuttons++;
--

-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Henrik Rydberg | 6 Feb 09:05
Picon

[PATCH v4] Input: Add EVIOC mechanism for MT slots

This patch adds the ability to extract MT slot data via a new ioctl,
EVIOCGMTSLOTS. The function returns an array of slot values for the
specified ABS_MT event type.

Example of user space usage:

struct { unsigned code; int values[64]; } req;
req.code = ABS_MT_POSITION_X;
if (ioctl(fd, EVIOCGMTSLOTS(sizeof(req)), &req) < 0)
	return -1;
for (i = 0; i < 64; i++)
	printf("slot %d: %d\n", i, req.values[i]);

Signed-off-by: Henrik Rydberg <rydberg <at> euromail.se>
---
Here is the fourth version of the patch.

Rather than over-specifying the ioctl binary format by introducing a
struct object that does not fit everyone, this version simply leaves
all object definitions to userland.

Thanks,
Henrik

 drivers/input/evdev.c |   27 ++++++++++++++++++++++++++-
 include/linux/input.h |   25 +++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 76457d5..e4cad16 100644
(Continue reading)

Przemo Firszt | 5 Feb 23:35
Picon
Favicon
Gravatar

[PATCH] HID: wacom: Fix invalid power_supply_powers calls

power_supply_powers calls added in 35b4c01e29bdd9632dabf9784ed3486333f00427
have to be called after power device is created. This patch also fixes the
second call - it has to be "ac" instead of "battery"

Signed-off-by: Przemo Firszt <przemo <at> firszt.eu>
Signed-off-by: Chris Bagwell <chris <at> cnpbagwell.com>
---
 drivers/hid/hid-wacom.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index b47e58b..acab74c 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -531,7 +531,6 @@ static int wacom_probe(struct hid_device *hdev,
 	wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
 	wdata->battery.use_for_apm = 0;

-	power_supply_powers(&wdata->battery, &hdev->dev);

 	ret = power_supply_register(&hdev->dev, &wdata->battery);
 	if (ret) {
@@ -540,6 +539,8 @@ static int wacom_probe(struct hid_device *hdev,
 		goto err_battery;
 	}

+	power_supply_powers(&wdata->battery, &hdev->dev);
+
 	wdata->ac.properties = wacom_ac_props;
 	wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props);
(Continue reading)

chris | 6 Feb 03:46

[PATCH 0/5] Wacom Bamboo Wireless Support

From: Chris Bagwell <chris <at> cnpbagwell.com>

The 3rd gen Bamboo Pen & Touch tabletse support an optional
wireless module.  This patch set adds support for it.

The only feature missing; compared to Windows driver; is
a sysfs interface to allow setting time period before tablet
goes to sleep.  This may come in a future patch.

Chris Bagwell (5):
  Input: wacom - isolate input registration
  Input: wacom - Bamboo wireless monitor framework
  Input: wacom - create inputs when wireless connect
  Input: wacom - wireless Bamboo battery status
  Input: wacom : Add missing LEDS_CLASS to Kconfig

 drivers/input/tablet/Kconfig     |    2 +
 drivers/input/tablet/wacom.h     |    9 ++
 drivers/input/tablet/wacom_sys.c |  228 ++++++++++++++++++++++++++++++++-----
 drivers/input/tablet/wacom_wac.c |   49 ++++++++-
 drivers/input/tablet/wacom_wac.h |    6 +
 5 files changed, 262 insertions(+), 32 deletions(-)

--

-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Alban Browaeys | 5 Feb 23:54
Picon
Favicon

hid-input behing restrictive about the accepted value leads to issues for multimedia LX710 keyboard (resent)

Since commit 6da7066906e977d42104a859c490f5f9a300488c  my multimedia
keys behaves as stuck (ie no release events seen by evdev).

046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser reports a minimum
logical of 1 not 0. This leads to multimedia key press behing
 seen as stuck (as 0 is the returned value for release which is below
minimum reported in rdesc for Consumer).

Enabling hid debug via echo 2 > /sys/module/hid/parameters/debug showed
while pressing the mulitmedia keys:
 drivers/hid/hid-input.c: Ignoring out-of-range 
after the press event (I had also evbug loaded). Then the key will
behave as stuck from evdev point of view (only hidraw and hiddev device
files showing activity, no more from event file).

Just a wild guess, egalaxy also suffers from the same issue and was
hardcoded minimum logical value 0. Could it be that this minimal logical
value is for press events (as here release events all have the value
zero). Or is this a bug in the keyboard reporting its limits.

From  /sys/kernel/debug/hid/0003\:046D
\:C517.0002/rdesc . The offending input is input3 (ie Consumer.0001) which has logical min 1.

Note this is particularly annoying with regards to the volume up
behaving as stuck .
I also saw a french twitter user reporting the issue but without any
hint on what his keyboard was . Thus the wild guess above that it could
affect all multimedia keyboards.

Best regards
(Continue reading)

Mark Brown | 4 Feb 17:23
Favicon
Gravatar

[PATCH] Input: gpio_mouse - Use linux/gpio.h rather than asm/gpio.h

Direct usage of the asm include has long been deprecated by the
introduction of gpiolib.

Signed-off-by: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
---
 drivers/input/mouse/gpio_mouse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index a9ad8e1..39fe9b7 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -12,9 +12,9 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/input-polldev.h>
+#include <linux/gpio.h>
 #include <linux/gpio_mouse.h>

-#include <asm/gpio.h>

 /*
  * Timer function which is run every scan_ms ms when the device is opened.
--

-- 
1.7.9.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

benjamin.tissoires | 4 Feb 17:08
Picon

[patch v3 0/3] Support of Perixx Peripad 701 for hid-multitouch

Hi Guys,

This is the v3 of the support of Perixx Peripad 701.

I included the changes asked by Henrik & Dmitry:
-           code = ((usage->hid - 1) & HID_USAGE) + BTN_MOUSE;
+           code =  BTN_MOUSE + ((usage->hid - 1) & HID_USAGE);
use of min;
remove remove the call to input_mt_report_finger_count;
remove debug information;
some cosmetic changes (parenthesis, typos)

Cheers,
Benjamin

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Chris | 3 Feb 16:27

[PATCH 1/1] input: kxtj9: who_am_i check value and initial data rate fixes

From: Chris Hudson <chudson <at> kionix.com>

Several fixes based on customer feedback:
- WHO_AM_I value has changed since preliminary parts used for initial testing
- Output of le16_to_cpu must be saved to memory before shifting to preserve sign
- Initial data rate was not extracted from data control register init.  This was
  causing the initial data rate to be set to maximum until it was changed.  To
  fix this problem, it made more sense to specify an initial data rate and
  extract the register mask from that.

Signed-off-by: Chris Hudson <chudson <at> kionix.com>
---
 drivers/input/misc/kxtj9.c  |   25 ++++++++++++++++++++-----
 include/linux/input/kxtj9.h |   11 +----------
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index 783597a..7c4b955 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -41,6 +41,14 @@
 #define PC1_ON			(1 << 7)
 /* Data ready funtion enable bit: set during probe if using irq mode */
 #define DRDYE			(1 << 5)
+/* DATA CONTROL REGISTER BITS */
+#define ODR12_5F		0
+#define ODR25F			1
+#define ODR50F			2
+#define ODR100F			3
+#define ODR200F			4
(Continue reading)


Gmane