Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
From: Mark Rutland @ 2013-11-15 15:55 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Sebastian Andrzej Siewior, dmitry.torokhov@gmail.com,
	rob.herring@calxeda.com, Pawel Moll, swarren@wwwdotorg.org,
	ijc+devicetree@hellion.org.uk, rob@landley.net,
	bcousson@baylibre.com, Tony Lindgren, devicetree@vger.kernel.org,
	Linux OMAP Mailing List, linux-input@vger.kernel.org
In-Reply-To: <20131114155404.GE15835@saruman.home>

On Thu, Nov 14, 2013 at 03:54:04PM +0000, Felipe Balbi wrote:
> HI,
> 
> On Thu, Nov 14, 2013 at 11:19:59AM +0000, Mark Rutland wrote:
> > > On Tue, Oct 22, 2013 at 10:42:00AM +0200, Sebastian Andrzej Siewior wrote:
> > > > On 10/21/2013 10:13 PM, Felipe Balbi wrote:
> > > > > diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > index e1c5300..b61df9d 100644
> > > > > --- a/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > @@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,
> > > > >  	if (err < 0)
> > > > >  		return err;
> > > > >  
> > > > > -	err = of_property_read_u32(node, "ti,coordiante-readouts",
> > > > > +	/*
> > > > > +	 * try with new binding first. If it fails, still try with
> > > > > +	 * bogus, miss-spelled version.
> > > > > +	 */
> > > > > +	err = of_property_read_u32(node, "ti,coordinate-readouts",
> > > > >  			&ts_dev->coordinate_readouts);
> > > > >  	if (err < 0)
> > > > > +		err = of_property_read_u32(node, "ti,coordiante-readouts",
> > > > > +				&ts_dev->coordinate_readouts);
> > > > > +	if (err < 0)
> > > > >  		return err;
> > > > 
> > > > Thanks, very good. Do we keep this fallback for ever or just for a year
> > > > or two?
> > > 
> > > That's for DT maintainers to decide but considering DT is an ABI, I
> > > guess we need to keep for 30 years or so :-p
> > 
> > We keep it as long as we have to. If no-one's relying on the typo by the
> > next merge window, I see no reason we'd have to keep support for the
> 
> and how could you know that ? considering it's an ABI, how could you
> ever know that ?

If you know that the only user of a binding is a dts for a particular
product that you're in charge of, then you'd know the set of kernel +
dtb combinations out there, and can judge.

If a bug is found in a driver such that it hasn't worked for a number of
releases, and no-one's complained, the binding is clearly not in use and
thus support for it can be removed.

If maintaining compatibility becomes too hard, and all users are happy
to migrate to a newer dtb, then it's not necessary to maintain
compatiblity for the old binding.

While we can't always remove existing bindings, there are cases where
it's possible and appropriate. However, we should strive for
compatibility for as long a term as possible.

Thanks,
Mark.

^ permalink raw reply

* Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
From: Felipe Balbi @ 2013-11-15 17:53 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Felipe Balbi, Sebastian Andrzej Siewior,
	dmitry.torokhov@gmail.com, rob.herring@calxeda.com, Pawel Moll,
	swarren@wwwdotorg.org, ijc+devicetree@hellion.org.uk,
	rob@landley.net, bcousson@baylibre.com, Tony Lindgren,
	devicetree@vger.kernel.org, Linux OMAP Mailing List,
	linux-input@vger.kernel.org
In-Reply-To: <20131115155540.GF24831@e106331-lin.cambridge.arm.com>

[-- Attachment #1: Type: text/plain, Size: 2156 bytes --]

Hi,

On Fri, Nov 15, 2013 at 03:55:40PM +0000, Mark Rutland wrote:
> > > > > > diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > > index e1c5300..b61df9d 100644
> > > > > > --- a/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > > +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
> > > > > > @@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,
> > > > > >  	if (err < 0)
> > > > > >  		return err;
> > > > > >  
> > > > > > -	err = of_property_read_u32(node, "ti,coordiante-readouts",
> > > > > > +	/*
> > > > > > +	 * try with new binding first. If it fails, still try with
> > > > > > +	 * bogus, miss-spelled version.
> > > > > > +	 */
> > > > > > +	err = of_property_read_u32(node, "ti,coordinate-readouts",
> > > > > >  			&ts_dev->coordinate_readouts);
> > > > > >  	if (err < 0)
> > > > > > +		err = of_property_read_u32(node, "ti,coordiante-readouts",
> > > > > > +				&ts_dev->coordinate_readouts);
> > > > > > +	if (err < 0)
> > > > > >  		return err;
> > > > > 
> > > > > Thanks, very good. Do we keep this fallback for ever or just for a year
> > > > > or two?
> > > > 
> > > > That's for DT maintainers to decide but considering DT is an ABI, I
> > > > guess we need to keep for 30 years or so :-p
> > > 
> > > We keep it as long as we have to. If no-one's relying on the typo by the
> > > next merge window, I see no reason we'd have to keep support for the
> > 
> > and how could you know that ? considering it's an ABI, how could you
> > ever know that ?
> 
> If you know that the only user of a binding is a dts for a particular
> product that you're in charge of, then you'd know the set of kernel +
> dtb combinations out there, and can judge.

once the binding has made into mainline, it's next to impossible to
figure out who has downloaded a tarball containing that driver and made
a product out of it.

Besides keeping that check in the driver won't hurt at all in the long
run. I would give it at least until 4.0 before thinking about removing,
and that might still not be enough time.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH 0/4 v3] input: wacom - Add support for new Intuos devices
From: Ping Cheng @ 2013-11-15 19:57 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, killertofu, chris, peter.hutterer, Ping Cheng

This patchset includes 4 outstanding Wacom patches posted in
the last two months. They are based on Dmitry's next branch.

Intuos series support is is its 3rd version. The patchset
has been tested by users at linuxwacom.sf.net. Change history
is listed below.

v2: Change SW_TOUCH_ENABLED to SW_TOUCH and clear BTN_TOUCH bit
for button only interfaces as suggested by Peter Hutterer.

v3: Make "touch hardware switch" into a new patch as suggested
by Chris Bagwell. Change INTUOS_HT to INTUOSHT as Peter suggested.

Added: Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
and    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
for relevant patches.

Jason's patch is included to avoid missing patch in mailling list.

Jason Gerecke (1):
  input: wacom - Scale up touch width and height values for Intuos Pro

Ping Cheng (3):
  input: wacom - make sure touch_max is set for touch devices
  Input: wacom - add support for three new Intuos devices
  Input: wacom - add SW_TOUCH to include/uapi/linux/input.h

 drivers/input/tablet/wacom_sys.c | 23 ++++++++--
 drivers/input/tablet/wacom_wac.c | 94 ++++++++++++++++++++++++++++++++--------
 drivers/input/tablet/wacom_wac.h |  7 +++
 include/uapi/linux/input.h       |  1 +
 4 files changed, 102 insertions(+), 23 deletions(-)

-- 
1.8.3.2


^ permalink raw reply

* [PATCH 1/4 v3] input: wacom - Scale up touch width and height values for Intuos Pro
From: Ping Cheng @ 2013-11-15 19:58 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, killertofu, chris, peter.hutterer

From: Signed-off-by: Jason Gerecke <killertofu@gmail.com>

The width and height values reported by the Intuos Pro are not in
surface units as required by the MT protocol. A simple multiplier
of 100x corrects it.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_wac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 9c8eded..3f75f1d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1151,8 +1151,8 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
 		int width, height;
 
 		if (features->type >= INTUOSPS && features->type <= INTUOSPL) {
-			width  = data[5];
-			height = data[6];
+			width  = data[5] * 100;
+			height = data[6] * 100;
 		} else {
 			/*
 			 * "a" is a scaled-down area which we assume is
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 2/4 v3] input: wacom - make sure touch_max is set for touch devices
From: Ping Cheng @ 2013-11-15 19:59 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, killertofu, chris, peter.hutterer, Ping Cheng

Old single touch Tablet PCs do not have touch_max set at
wacom_features. Since touch device at lease supports one
finger, assign touch_max to 1 when touch usage is defined
in its HID Descriptor and touch_max is not pre-defined.

Tested-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_sys.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 8a90da1..3d71b60 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
 	struct usb_device *dev = interface_to_usbdev(intf);
 	char limit = 0;
 	/* result has to be defined as int for some devices */
-	int result = 0;
+	int result = 0, touch_max = 0;
 	int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
 	unsigned char *report;
 
@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
 				if (usage == WCM_DESKTOP) {
 					if (finger) {
 						features->device_type = BTN_TOOL_FINGER;
-
+						/* touch device at least supports one touch point */
+						touch_max = 1;
 						switch (features->type) {
 						case TABLETPC2FG:
 							features->pktlen = WACOM_PKGLEN_TPC2FG;
@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
 	}
 
  out:
+	if (!features->touch_max && touch_max)
+		features->touch_max = touch_max;
 	result = 0;
 	kfree(report);
 	return result;
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 3/4 v3] Input: wacom - add support for three new Intuos devices
From: Ping Cheng @ 2013-11-15 19:59 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, killertofu, chris, peter.hutterer, Ping Cheng

Two tablets in this series support both pen and touch. One (Intuos S)
only supports pen. This patch also updates the driver to process wireless
devices that do not support touch interface.

Tested-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_sys.c |  6 ++--
 drivers/input/tablet/wacom_wac.c | 62 ++++++++++++++++++++++++++++++----------
 drivers/input/tablet/wacom_wac.h |  2 ++
 3 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 3d71b60..3a7d99c 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1198,7 +1198,8 @@ static void wacom_wireless_work(struct work_struct *work)
 			goto fail;
 
 		/* Touch interface */
-		if (wacom_wac1->features.touch_max) {
+		if (wacom_wac1->features.touch_max ||
+		    wacom_wac1->features.type == INTUOSHT) {
 			wacom_wac2->features =
 				*((struct wacom_features *)id->driver_info);
 			wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3;
@@ -1321,7 +1322,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 	 * HID descriptor. If this is the touch interface (wMaxPacketSize
 	 * of WACOM_PKGLEN_BBTOUCH3), override the table values.
 	 */
-	if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
+	if (features->type >= INTUOS5S && features->type <= INTUOSHT) {
 		if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
 			features->device_type = BTN_TOOL_FINGER;
 			features->pktlen = WACOM_PKGLEN_BBTOUCH3;
@@ -1391,7 +1392,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 			goto fail5;
 		}
 	}
-
 	return 0;
 
  fail5: wacom_destroy_leds(wacom);
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 3f75f1d..c0cd85d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1176,10 +1176,17 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
 static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
 {
 	struct input_dev *input = wacom->input;
+	struct wacom_features *features = &wacom->features;
 
-	input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
+	if (features->type == INTUOSHT) {
+		input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0);
+		input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0);
+	} else {
+
+		input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
+		input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
+	}
 	input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
-	input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
 	input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
 }
 
@@ -1217,7 +1224,7 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
 	unsigned char *data = wacom->data;
 	int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
 
-	if (data[0] != 0x02)
+	if (data[0] != WACOM_REPORT_PENABLED)
 	    return 0;
 
 	prox = (data[1] & 0x20) == 0x20;
@@ -1297,7 +1304,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
 	unsigned char *data = wacom->data;
 	int connected;
 
-	if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80)
+	if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL)
 		return 0;
 
 	connected = data[1] & 0x01;
@@ -1391,6 +1398,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 		break;
 
 	case BAMBOO_PT:
+	case INTUOSHT:
 		sync = wacom_bpt_irq(wacom_wac, len);
 		break;
 
@@ -1459,7 +1467,7 @@ void wacom_setup_device_quirks(struct wacom_features *features)
 
 	/* these device have multiple inputs */
 	if (features->type >= WIRELESS ||
-	    (features->type >= INTUOS5S && features->type <= INTUOSPL) ||
+	    (features->type >= INTUOS5S && features->type <= INTUOSHT) ||
 	    (features->oVid && features->oPid))
 		features->quirks |= WACOM_QUIRK_MULTI_INPUT;
 
@@ -1771,33 +1779,43 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
 		__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
 		break;
 
+	case INTUOSHT:
 	case BAMBOO_PT:
 		__clear_bit(ABS_MISC, input_dev->absbit);
 
-		__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
-
 		if (features->device_type == BTN_TOOL_FINGER) {
-			unsigned int flags = INPUT_MT_POINTER;
 
 			__set_bit(BTN_LEFT, input_dev->keybit);
 			__set_bit(BTN_FORWARD, input_dev->keybit);
 			__set_bit(BTN_BACK, input_dev->keybit);
 			__set_bit(BTN_RIGHT, input_dev->keybit);
 
-			if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
-				input_set_abs_params(input_dev,
+			if (features->touch_max) {
+				/* touch interface */
+				unsigned int flags = INPUT_MT_POINTER;
+
+				__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
+				if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
+					input_set_abs_params(input_dev,
 						     ABS_MT_TOUCH_MAJOR,
 						     0, features->x_max, 0, 0);
-				input_set_abs_params(input_dev,
+					input_set_abs_params(input_dev,
 						     ABS_MT_TOUCH_MINOR,
 						     0, features->y_max, 0, 0);
+				} else {
+					__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+					__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+					flags = 0;
+				}
+				input_mt_init_slots(input_dev, features->touch_max, flags);
 			} else {
-				__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
-				__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
-				flags = 0;
+				/* buttons/keys only interface */
+				__clear_bit(ABS_X, input_dev->absbit);
+				__clear_bit(ABS_Y, input_dev->absbit);
+				__clear_bit(BTN_TOUCH, input_dev->keybit);
 			}
-			input_mt_init_slots(input_dev, features->touch_max, flags);
 		} else if (features->device_type == BTN_TOOL_PEN) {
+			__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
 			__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
 			__set_bit(BTN_TOOL_PEN, input_dev->keybit);
 			__set_bit(BTN_STYLUS, input_dev->keybit);
@@ -2194,6 +2212,17 @@ static const struct wacom_features wacom_features_0x300 =
 static const struct wacom_features wacom_features_0x301 =
 	{ "Wacom Bamboo One M",    WACOM_PKGLEN_BBPEN,    21648, 13530, 1023,
 	  31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x302 =
+	{ "Wacom Intuos PT S",     WACOM_PKGLEN_BBPEN,    15200,  9500, 1023,
+	  31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+	  .touch_max = 16 };
+static const struct wacom_features wacom_features_0x303 =
+	{ "Wacom Intuos PT M",     WACOM_PKGLEN_BBPEN,    21600, 13500, 1023,
+	  31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+	  .touch_max = 16 };
+static const struct wacom_features wacom_features_0x30E =
+	{ "Wacom Intuos S",        WACOM_PKGLEN_BBPEN,    15200,  9500, 1023,
+	  31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 static const struct wacom_features wacom_features_0x6004 =
 	{ "ISD-V4",               WACOM_PKGLEN_GRAPHIRE,  12800,  8000,  255,
 	  0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2329,6 +2358,9 @@ const struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE_WACOM(0x10D) },
 	{ USB_DEVICE_WACOM(0x300) },
 	{ USB_DEVICE_WACOM(0x301) },
+	{ USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
+	{ USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) },
+	{ USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_WACOM(0x304) },
 	{ USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index fd23a37..854cceb 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -54,6 +54,7 @@
 #define WACOM_REPORT_TPCST		16
 #define WACOM_REPORT_TPC1FGE		18
 #define WACOM_REPORT_24HDT		1
+#define WACOM_REPORT_WL			128
 
 /* device quirks */
 #define WACOM_QUIRK_MULTI_INPUT		0x0001
@@ -81,6 +82,7 @@ enum {
 	INTUOSPS,
 	INTUOSPM,
 	INTUOSPL,
+	INTUOSHT,
 	WACOM_21UX2,
 	WACOM_22HD,
 	DTK,
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Ping Cheng @ 2013-11-15 20:00 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, killertofu, chris, peter.hutterer, Ping Cheng

New Intuos series models added a hardware switch to turn touch
data on/off. To report the state of the switch, SW_TOUCH
is added in include/uapi/linux/input.h.

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_sys.c | 12 ++++++++++++
 drivers/input/tablet/wacom_wac.c | 30 +++++++++++++++++++++++++++---
 drivers/input/tablet/wacom_wac.h |  5 +++++
 include/uapi/linux/input.h       |  1 +
 4 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 3a7d99c..bb72fa3 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1193,6 +1193,8 @@ static void wacom_wireless_work(struct work_struct *work)
 		wacom_wac1->features.device_type = BTN_TOOL_PEN;
 		snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen",
 			 wacom_wac1->features.name);
+		wacom_wac1->shared->touch_max = wacom_wac1->features.touch_max;
+		wacom_wac1->shared->type = wacom_wac1->features.type;
 		error = wacom_register_input(wacom1);
 		if (error)
 			goto fail;
@@ -1214,6 +1216,10 @@ static void wacom_wireless_work(struct work_struct *work)
 			error = wacom_register_input(wacom2);
 			if (error)
 				goto fail;
+
+			if (wacom_wac1->features.type == INTUOSHT &&
+			    wacom_wac1->features.touch_max)
+				wacom_wac->shared->touch_input = wacom_wac2->input;
 		}
 
 		error = wacom_initialize_battery(wacom);
@@ -1392,6 +1398,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 			goto fail5;
 		}
 	}
+
+	if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) {
+		if (wacom_wac->features.device_type == BTN_TOOL_FINGER)
+			wacom_wac->shared->touch_input = wacom_wac->input;
+	}
+
 	return 0;
 
  fail5: wacom_destroy_leds(wacom);
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index c0cd85d..70beca8 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1220,13 +1220,23 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
 
 static int wacom_bpt_pen(struct wacom_wac *wacom)
 {
+	struct wacom_features *features = &wacom->features;
 	struct input_dev *input = wacom->input;
 	unsigned char *data = wacom->data;
 	int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
 
-	if (data[0] != WACOM_REPORT_PENABLED)
+	if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
 	    return 0;
 
+	if (data[0] == WACOM_REPORT_USB) {
+		if ((features->type == INTUOSHT) && features->touch_max) {
+			input_report_switch(wacom->shared->touch_input,
+					    SW_TOUCH, data[8] & 0x40);
+			input_sync(wacom->shared->touch_input);
+		}
+		return 0;
+	}
+
 	prox = (data[1] & 0x20) == 0x20;
 
 	/*
@@ -1259,8 +1269,8 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
 		 * touching and applying pressure; do not report negative
 		 * distance.
 		 */
-		if (data[8] <= wacom->features.distance_max)
-			d = wacom->features.distance_max - data[8];
+		if (data[8] <= features->distance_max)
+			d = features->distance_max - data[8];
 
 		pen = data[1] & 0x01;
 		btn1 = data[1] & 0x02;
@@ -1311,6 +1321,13 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
 	if (connected) {
 		int pid, battery;
 
+		if ((wacom->shared->type == INTUOSHT) &&
+				wacom->shared->touch_max) {
+			input_report_switch(wacom->shared->touch_input,
+					SW_TOUCH, data[5] & 0x40);
+			input_sync(wacom->shared->touch_input);
+		}
+
 		pid = get_unaligned_be16(&data[6]);
 		battery = data[5] & 0x3f;
 		if (wacom->pid != pid) {
@@ -1780,6 +1797,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
 		break;
 
 	case INTUOSHT:
+		if (features->touch_max &&
+		    (features->device_type == BTN_TOOL_FINGER)) {
+			input_dev->evbit[0] |= BIT_MASK(EV_SW);
+			__set_bit(SW_TOUCH, input_dev->swbit);
+		}
+		/* fall through */
+
 	case BAMBOO_PT:
 		__clear_bit(ABS_MISC, input_dev->absbit);
 
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 854cceb..3600cf7 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -55,6 +55,7 @@
 #define WACOM_REPORT_TPC1FGE		18
 #define WACOM_REPORT_24HDT		1
 #define WACOM_REPORT_WL			128
+#define WACOM_REPORT_USB		192
 
 /* device quirks */
 #define WACOM_QUIRK_MULTI_INPUT		0x0001
@@ -131,6 +132,10 @@ struct wacom_features {
 struct wacom_shared {
 	bool stylus_in_proximity;
 	bool touch_down;
+	/* for wireless device to access USB interfaces */
+	unsigned touch_max;
+	int type;
+	struct input_dev *touch_input;
 };
 
 struct wacom_wac {
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index a372627..fcddcb1 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -856,6 +856,7 @@ struct input_keymap_entry {
 #define SW_FRONT_PROXIMITY	0x0b  /* set = front proximity sensor active */
 #define SW_ROTATE_LOCK		0x0c  /* set = rotate locked/disabled */
 #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
+#define SW_TOUCH		0x0e  /* set = touch switch turned on (touch events off) */
 #define SW_MAX			0x0f
 #define SW_CNT			(SW_MAX+1)
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
From: Stephen Warren @ 2013-11-15 20:53 UTC (permalink / raw)
  To: swarren
  Cc: Mark Rutland, alsa-devel, linux-usb, Wolfram Sang, David Airlie,
	linux-pci, dri-devel, Marc Dietrich, linux-tegra, linux-i2c,
	ac100, devel, Stephen Warren, Alan Stern, linux-serial,
	linux-input, Terje Bergström, devicetree, Pawel Moll,
	Ian Campbell, Julian Andres Klode, Rob Herring, Mark Brown,
	Bjorn Helgaas, Mike Turquette

From: Stephen Warren <swarren@nvidia.com>

This series implements a common reset framework driver for Tegra, and
updates all relevant Tegra drivers to use it. It also removes the custom
DMA bindings and replaced them with the standard DMA DT bindings.

Historically, the Tegra clock driver has exported a custom API for module
reset. This series removes that API, and transitions DT and drivers to
the new reset framework.

The custom API used a "struct clk" to identify which module to reset, and
consequently some DT bindings and drivers required clocks to be provided
where they really needed just a reset identifier instead. Due to this
known deficiency, I have always considered most Tegra bindings to be
unstable. This series removes this excuse for instability, although I
still consider some Tegra bindings unstable due to the need to convert to
the common DMA bindings.

Historically, Tegra DMA channels have been represented in DT using a
custom nvidia,dma-request-selector property. Now that standard DMA DT
bindings exist, convert all Tegra bindings, DTs, and drivers to use the
standard instead.

This series makes a DT-ABI-incompatible change to:
- Require reset specifiers in DT where relevant.
- Require standard DMA specifiers.
- Remove clock specifiers from DT where they were only needed for reset.
- Remove legacy DMA specifier properties.

I anticipate merging this whole series into the Tegra and arm-soc trees
as its own branch, due to internal dependencies. This branch will be
stable and can then be merged into any other subsystem trees should any
conflicts arise.

This series depends on Peter's Tegra clock driver rework, available at
git://nv-tegra.nvidia.com/user/pdeschrijver/linux tegra-clk-tegra124-0
(or whatever version of that gets included in 3.14)

Cc: ac100@lists.launchpad.net
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: alsa-devel@alsa-project.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: devel@driverdev.osuosl.org
Cc: devicetree@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: dri-devel@lists.freedesktop.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Julian Andres Klode <jak@jak-linux.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: linux-spi@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: Marc Dietrich <marvin24@gmx.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: pdeschrijver@nvidia.com
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Terje Bergström <tbergstrom@nvidia.com>
Cc: treding@nvidia.com
Cc: Wolfram Sang <wsa@the-dreams.de>

Stephen Warren (31):
  ARM: tegra: add missing clock documentation to DT bindings
  ARM: tegra: document reset properties in DT bindings
  ARM: tegra: document use of standard DMA DT bindings
  ARM: tegra: update DT files to add reset properties
  ARM: tegra: update DT files to add DMA properties
  ARM: tegra: select the reset framework
  clk: tegra: implement a reset driver
  pci: tegra: use reset framework
  drm/tegra: use reset framework
  ARM: tegra: pass reset to tegra_powergate_sequence_power_up()
  dma: add channel request API that supports deferred probe
  dma: tegra: use reset framework
  dma: tegra: register as an OF DMA controller
  ASoC: dmaengine: support deferred probe for DMA channels
  ASoC: dmaengine: add custom DMA config to snd_dmaengine_pcm_config
  ASoC: tegra: use reset framework
  ASoC: tegra: call pm_runtime APIs around register accesses
  ASoC: tegra: allocate AHUB FIFO during probe() not startup()
  ASoC: tegra: convert to standard DMA DT bindings
  i2c: tegra: use reset framework
  staging: nvec: use reset framework
  spi: tegra: use reset framework
  spi: tegra: convert to standard DMA DT bindings
  serial: tegra: use reset framework
  serial: tegra: convert to standard DMA DT bindings
  Input: tegra-kbc - use reset framework
  USB: EHCI: tegra: use reset framework
  ARM: tegra: remove legacy clock entries from DT
  ARM: tegra: remove legacy DMA entries from DT
  clk: tegra: remove legacy reset APIs
  clk: tegra: remove bogus PCIE_XCLK

 .../bindings/arm/tegra/nvidia,tegra20-pmc.txt      |   1 +
 .../bindings/clock/nvidia,tegra114-car.txt         |   4 +
 .../bindings/clock/nvidia,tegra124-car.txt         |   4 +
 .../bindings/clock/nvidia,tegra20-car.txt          |   4 +
 .../bindings/clock/nvidia,tegra30-car.txt          |   4 +
 .../devicetree/bindings/dma/tegra20-apbdma.txt     |   9 ++
 .../bindings/gpu/nvidia,tegra20-host1x.txt         | 124 +++++++++++++++
 .../devicetree/bindings/i2c/nvidia,tegra20-i2c.txt |  27 +++-
 .../bindings/input/nvidia,tegra20-kbc.txt          |   9 ++
 .../bindings/mmc/nvidia,tegra20-sdhci.txt          |   9 ++
 .../devicetree/bindings/nvec/nvidia,nvec.txt       |  12 ++
 .../bindings/pci/nvidia,tegra20-pcie.txt           |  28 ++--
 .../devicetree/bindings/pwm/nvidia,tegra20-pwm.txt |   9 ++
 .../devicetree/bindings/rtc/nvidia,tegra20-rtc.txt |   3 +
 .../bindings/serial/nvidia,tegra20-hsuart.txt      |  19 ++-
 .../bindings/sound/nvidia,tegra-audio-alc5632.txt  |   7 +-
 .../bindings/sound/nvidia,tegra-audio-rt5640.txt   |   7 +-
 .../bindings/sound/nvidia,tegra-audio-wm8753.txt   |   7 +-
 .../bindings/sound/nvidia,tegra-audio-wm8903.txt   |   7 +-
 .../bindings/sound/nvidia,tegra-audio-wm9712.txt   |   7 +-
 .../bindings/sound/nvidia,tegra20-ac97.txt         |  20 ++-
 .../bindings/sound/nvidia,tegra20-i2s.txt          |  19 ++-
 .../bindings/sound/nvidia,tegra30-ahub.txt         |  54 +++++--
 .../bindings/sound/nvidia,tegra30-i2s.txt          |  11 +-
 .../bindings/spi/nvidia,tegra114-spi.txt           |  24 ++-
 .../bindings/spi/nvidia,tegra20-sflash.txt         |  20 ++-
 .../bindings/spi/nvidia,tegra20-slink.txt          |  20 ++-
 .../bindings/timer/nvidia,tegra20-timer.txt        |   3 +
 .../bindings/timer/nvidia,tegra30-timer.txt        |   3 +
 .../bindings/usb/nvidia,tegra20-ehci.txt           |   7 +-
 arch/arm/boot/dts/tegra114.dtsi                    | 142 ++++++++++++++---
 arch/arm/boot/dts/tegra20-paz00.dts                |   2 +
 arch/arm/boot/dts/tegra20.dtsi                     | 132 ++++++++++++++--
 arch/arm/boot/dts/tegra30.dtsi                     | 171 +++++++++++++++++----
 arch/arm/mach-tegra/Kconfig                        |   2 +
 arch/arm/mach-tegra/powergate.c                    |   8 +-
 drivers/clk/tegra/clk-periph-gate.c                |  22 ---
 drivers/clk/tegra/clk-periph.c                     |  40 -----
 drivers/clk/tegra/clk-tegra114.c                   |   3 +-
 drivers/clk/tegra/clk-tegra124.c                   |   2 +-
 drivers/clk/tegra/clk-tegra20.c                    |   9 +-
 drivers/clk/tegra/clk-tegra30.c                    |  10 +-
 drivers/clk/tegra/clk.c                            |  55 ++++++-
 drivers/clk/tegra/clk.h                            |   3 +-
 drivers/dma/acpi-dma.c                             |  12 +-
 drivers/dma/dmaengine.c                            |  44 +++++-
 drivers/dma/of-dma.c                               |  12 +-
 drivers/dma/tegra20-apb-dma.c                      |  49 +++++-
 drivers/gpu/drm/tegra/Kconfig                      |   1 +
 drivers/gpu/drm/tegra/dc.c                         |   9 +-
 drivers/gpu/drm/tegra/drm.h                        |   3 +
 drivers/gpu/drm/tegra/gr3d.c                       |  22 ++-
 drivers/gpu/drm/tegra/hdmi.c                       |  14 +-
 drivers/i2c/busses/i2c-tegra.c                     |  13 +-
 drivers/input/keyboard/tegra-kbc.c                 |  13 +-
 drivers/pci/host/pci-tegra.c                       |  52 +++++--
 drivers/spi/Kconfig                                |   3 +
 drivers/spi/spi-tegra114.c                         |  66 ++++----
 drivers/spi/spi-tegra20-sflash.c                   |  18 ++-
 drivers/spi/spi-tegra20-slink.c                    |  66 ++++----
 drivers/staging/nvec/nvec.c                        |  11 +-
 drivers/staging/nvec/nvec.h                        |   5 +-
 drivers/tty/serial/serial-tegra.c                  |  86 +++++------
 drivers/usb/host/ehci-tegra.c                      |  14 +-
 include/dt-bindings/clock/tegra20-car.h            |   2 +-
 include/dt-bindings/clock/tegra30-car.h            |   2 +-
 include/linux/clk/tegra.h                          |   7 -
 include/linux/dmaengine.h                          |   7 +
 include/linux/of_dma.h                             |   9 +-
 include/linux/tegra-powergate.h                    |   4 +-
 include/sound/dmaengine_pcm.h                      |   6 +
 sound/soc/soc-generic-dmaengine-pcm.c              |  82 +++++++---
 sound/soc/tegra/Kconfig                            |   2 +
 sound/soc/tegra/tegra20_ac97.c                     |  11 --
 sound/soc/tegra/tegra20_i2s.c                      |  20 +--
 sound/soc/tegra/tegra30_ahub.c                     | 125 +++++++++------
 sound/soc/tegra/tegra30_ahub.h                     |  11 +-
 sound/soc/tegra/tegra30_i2s.c                      |  97 ++++++------
 sound/soc/tegra/tegra30_i2s.h                      |   3 +
 sound/soc/tegra/tegra_pcm.c                        |  17 +-
 sound/soc/tegra/tegra_pcm.h                        |   5 +
 81 files changed, 1448 insertions(+), 558 deletions(-)

-- 
1.8.1.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [PATCH 26/31] Input: tegra-kbc - use reset framework
From: Stephen Warren @ 2013-11-15 20:54 UTC (permalink / raw)
  To: swarren
  Cc: Stephen Warren, treding, pdeschrijver, linux-tegra,
	linux-arm-kernel, Dmitry Torokhov, Dmitry Torokhov, linux-input
In-Reply-To: <1384548866-13141-1-git-send-email-swarren@wwwdotorg.org>

From: Stephen Warren <swarren@nvidia.com>

Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.

Cc: treding@nvidia.com
Cc: pdeschrijver@nvidia.com
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: linux-input@vger.kernel.org
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
This patch is part of a series with strong internal depdendencies. I'm
looking for an ack so that I can take the entire series through the Tegra
and arm-soc trees. The series will be part of a stable branch that can be
merged into other subsystems if needed to avoid/resolve dependencies.
---
 drivers/input/keyboard/tegra-kbc.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 8508879f6faf..9757a58bc897 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -31,7 +31,7 @@
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/input/matrix_keypad.h>
-#include <linux/clk/tegra.h>
+#include <linux/reset.h>
 #include <linux/err.h>
 
 #define KBC_MAX_KPENT	8
@@ -116,6 +116,7 @@ struct tegra_kbc {
 	u32 wakeup_key;
 	struct timer_list timer;
 	struct clk *clk;
+	struct reset_control *rst;
 	const struct tegra_kbc_hw_support *hw_support;
 	int max_keys;
 	int num_rows_and_columns;
@@ -373,9 +374,9 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
 	clk_prepare_enable(kbc->clk);
 
 	/* Reset the KBC controller to clear all previous status.*/
-	tegra_periph_reset_assert(kbc->clk);
+	reset_control_assert(kbc->rst);
 	udelay(100);
-	tegra_periph_reset_deassert(kbc->clk);
+	reset_control_assert(kbc->rst);
 	udelay(100);
 
 	tegra_kbc_config_pins(kbc);
@@ -663,6 +664,12 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 		return PTR_ERR(kbc->clk);
 	}
 
+	kbc->rst = devm_reset_control_get(&pdev->dev, "kbc");
+	if (IS_ERR(kbc->rst)) {
+		dev_err(&pdev->dev, "failed to get keyboard reset\n");
+		return PTR_ERR(kbc->rst);
+	}
+
 	/*
 	 * The time delay between two consecutive reads of the FIFO is
 	 * the sum of the repeat time and the time taken for scanning
-- 
1.8.1.5


^ permalink raw reply related

* Re: [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Chris Bagwell @ 2013-11-15 21:28 UTC (permalink / raw)
  To: Ping Cheng
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <1384545602-15549-1-git-send-email-pingc@wacom.com>

Thanks for breaking out... Its easier to review now as well.

Small question below.

On Fri, Nov 15, 2013 at 2:00 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> New Intuos series models added a hardware switch to turn touch
> data on/off. To report the state of the switch, SW_TOUCH
> is added in include/uapi/linux/input.h.
>
> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
> Tested-by: Jason Gerecke <killertofu@gmail.com>
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> ---
>  drivers/input/tablet/wacom_sys.c | 12 ++++++++++++
>  drivers/input/tablet/wacom_wac.c | 30 +++++++++++++++++++++++++++---
>  drivers/input/tablet/wacom_wac.h |  5 +++++
>  include/uapi/linux/input.h       |  1 +
>  4 files changed, 45 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 3a7d99c..bb72fa3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -1193,6 +1193,8 @@ static void wacom_wireless_work(struct work_struct *work)
>                 wacom_wac1->features.device_type = BTN_TOOL_PEN;
>                 snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen",
>                          wacom_wac1->features.name);
> +               wacom_wac1->shared->touch_max = wacom_wac1->features.touch_max;
> +               wacom_wac1->shared->type = wacom_wac1->features.type;
>                 error = wacom_register_input(wacom1);
>                 if (error)
>                         goto fail;
> @@ -1214,6 +1216,10 @@ static void wacom_wireless_work(struct work_struct *work)
>                         error = wacom_register_input(wacom2);
>                         if (error)
>                                 goto fail;
> +
> +                       if (wacom_wac1->features.type == INTUOSHT &&
> +                           wacom_wac1->features.touch_max)
> +                               wacom_wac->shared->touch_input = wacom_wac2->input;
>                 }
>
>                 error = wacom_initialize_battery(wacom);
> @@ -1392,6 +1398,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>                         goto fail5;
>                 }
>         }
> +
> +       if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) {
> +               if (wacom_wac->features.device_type == BTN_TOOL_FINGER)
> +                       wacom_wac->shared->touch_input = wacom_wac->input;
> +       }
> +
>         return 0;
>
>   fail5: wacom_destroy_leds(wacom);
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index c0cd85d..70beca8 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -1220,13 +1220,23 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
>
>  static int wacom_bpt_pen(struct wacom_wac *wacom)
>  {
> +       struct wacom_features *features = &wacom->features;
>         struct input_dev *input = wacom->input;
>         unsigned char *data = wacom->data;
>         int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
>
> -       if (data[0] != WACOM_REPORT_PENABLED)
> +       if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
>             return 0;
>
> +       if (data[0] == WACOM_REPORT_USB) {
> +               if ((features->type == INTUOSHT) && features->touch_max) {
> +                       input_report_switch(wacom->shared->touch_input,
> +                                           SW_TOUCH, data[8] & 0x40);
> +                       input_sync(wacom->shared->touch_input);
> +               }
> +               return 0;
> +       }
> +
>         prox = (data[1] & 0x20) == 0x20;
>
>         /*
> @@ -1259,8 +1269,8 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
>                  * touching and applying pressure; do not report negative
>                  * distance.
>                  */
> -               if (data[8] <= wacom->features.distance_max)
> -                       d = wacom->features.distance_max - data[8];
> +               if (data[8] <= features->distance_max)
> +                       d = features->distance_max - data[8];
>
>                 pen = data[1] & 0x01;
>                 btn1 = data[1] & 0x02;
> @@ -1311,6 +1321,13 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>         if (connected) {
>                 int pid, battery;
>
> +               if ((wacom->shared->type == INTUOSHT) &&
> +                               wacom->shared->touch_max) {
> +                       input_report_switch(wacom->shared->touch_input,
> +                                       SW_TOUCH, data[5] & 0x40);
> +                       input_sync(wacom->shared->touch_input);
> +               }

Earlier in patch, SW_TOUCH is read from pen interface and this time
its read from wireless interface.  Is this to handle a HW model
difference or wired/wireless difference?

I assume for wired case, it has to come from pen interface... no
telling what wireless mode does different.

Anyways, maybe a small comment is worthwhile to let people know why
its needed twice?

I see now that its next to impossible to get rid of
shared->touch_input... which means my old comments were invalid. So:

Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>

> +
>                 pid = get_unaligned_be16(&data[6]);
>                 battery = data[5] & 0x3f;
>                 if (wacom->pid != pid) {
> @@ -1780,6 +1797,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
>                 break;
>
>         case INTUOSHT:
> +               if (features->touch_max &&
> +                   (features->device_type == BTN_TOOL_FINGER)) {
> +                       input_dev->evbit[0] |= BIT_MASK(EV_SW);
> +                       __set_bit(SW_TOUCH, input_dev->swbit);
> +               }
> +               /* fall through */
> +
>         case BAMBOO_PT:
>                 __clear_bit(ABS_MISC, input_dev->absbit);
>
> diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
> index 854cceb..3600cf7 100644
> --- a/drivers/input/tablet/wacom_wac.h
> +++ b/drivers/input/tablet/wacom_wac.h
> @@ -55,6 +55,7 @@
>  #define WACOM_REPORT_TPC1FGE           18
>  #define WACOM_REPORT_24HDT             1
>  #define WACOM_REPORT_WL                        128
> +#define WACOM_REPORT_USB               192
>
>  /* device quirks */
>  #define WACOM_QUIRK_MULTI_INPUT                0x0001
> @@ -131,6 +132,10 @@ struct wacom_features {
>  struct wacom_shared {
>         bool stylus_in_proximity;
>         bool touch_down;
> +       /* for wireless device to access USB interfaces */
> +       unsigned touch_max;
> +       int type;
> +       struct input_dev *touch_input;
>  };
>
>  struct wacom_wac {
> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
> index a372627..fcddcb1 100644
> --- a/include/uapi/linux/input.h
> +++ b/include/uapi/linux/input.h
> @@ -856,6 +856,7 @@ struct input_keymap_entry {
>  #define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
>  #define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
>  #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
> +#define SW_TOUCH               0x0e  /* set = touch switch turned on (touch events off) */
>  #define SW_MAX                 0x0f
>  #define SW_CNT                 (SW_MAX+1)
>
> --
> 1.8.3.2
>

^ permalink raw reply

* Re: [PATCH 2/4 v3] input: wacom - make sure touch_max is set for touch devices
From: Chris Bagwell @ 2013-11-15 21:31 UTC (permalink / raw)
  To: Ping Cheng
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <1384545554-15472-1-git-send-email-pingc@wacom.com>

On Fri, Nov 15, 2013 at 1:59 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> Old single touch Tablet PCs do not have touch_max set at
> wacom_features. Since touch device at lease supports one
> finger, assign touch_max to 1 when touch usage is defined
> in its HID Descriptor and touch_max is not pre-defined.

Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>

>
> Tested-by: Jason Gerecke <killertofu@gmail.com>
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> ---
>  drivers/input/tablet/wacom_sys.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 8a90da1..3d71b60 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
>         struct usb_device *dev = interface_to_usbdev(intf);
>         char limit = 0;
>         /* result has to be defined as int for some devices */
> -       int result = 0;
> +       int result = 0, touch_max = 0;
>         int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
>         unsigned char *report;
>
> @@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
>                                 if (usage == WCM_DESKTOP) {
>                                         if (finger) {
>                                                 features->device_type = BTN_TOOL_FINGER;
> -
> +                                               /* touch device at least supports one touch point */
> +                                               touch_max = 1;
>                                                 switch (features->type) {
>                                                 case TABLETPC2FG:
>                                                         features->pktlen = WACOM_PKGLEN_TPC2FG;
> @@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
>         }
>
>   out:
> +       if (!features->touch_max && touch_max)
> +               features->touch_max = touch_max;
>         result = 0;
>         kfree(report);
>         return result;
> --
> 1.8.3.2
>

^ permalink raw reply

* Re: [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Chris Bagwell @ 2013-11-15 21:33 UTC (permalink / raw)
  To: Ping Cheng
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <1384545602-15549-1-git-send-email-pingc@wacom.com>

On Fri, Nov 15, 2013 at 2:00 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> New Intuos series models added a hardware switch to turn touch
> data on/off. To report the state of the switch, SW_TOUCH
> is added in include/uapi/linux/input.h.
>

Any status on your patch to add SW_TOUCH event?  Maybe you should
resend since its been a while and this patch depends on it.

Chris

^ permalink raw reply

* Re: [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Ping Cheng @ 2013-11-15 21:38 UTC (permalink / raw)
  To: Chris Bagwell
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <CAGzDe_ZsthR-QVHmut9eZue5ybOCKLRqh8-0V0y=rCRR=_pgeQ@mail.gmail.com>

On Fri, Nov 15, 2013 at 1:33 PM, Chris Bagwell <chris@cnpbagwell.com> wrote:
> On Fri, Nov 15, 2013 at 2:00 PM, Ping Cheng <pinglinux@gmail.com> wrote:
>> New Intuos series models added a hardware switch to turn touch
>> data on/off. To report the state of the switch, SW_TOUCH
>> is added in include/uapi/linux/input.h.
>>
>
> Any status on your patch to add SW_TOUCH event?  Maybe you should
> resend since its been a while and this patch depends on it.

Which patch do we still need? Isn't this the one? Without the below
change, the driver would not compile.

> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
> index a372627..fcddcb1 100644
> --- a/include/uapi/linux/input.h
> +++ b/include/uapi/linux/input.h
> @@ -856,6 +856,7 @@ struct input_keymap_entry {
>  #define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
>  #define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
>  #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
> +#define SW_TOUCH               0x0e  /* set = touch switch turned on (touch events off) */
>  #define SW_MAX                 0x0f
>  #define SW_CNT                 (SW_MAX+1)

Ping

^ permalink raw reply

* Re: [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Chris Bagwell @ 2013-11-15 21:45 UTC (permalink / raw)
  To: Ping Cheng
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <CAF8JNhLk-ZH+w-EZi4yMpWqmG+ZeuSXhe9tQ_FOF5a0wE0A+-w@mail.gmail.com>

On Fri, Nov 15, 2013 at 3:38 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> On Fri, Nov 15, 2013 at 1:33 PM, Chris Bagwell <chris@cnpbagwell.com> wrote:
>> On Fri, Nov 15, 2013 at 2:00 PM, Ping Cheng <pinglinux@gmail.com> wrote:
>>> New Intuos series models added a hardware switch to turn touch
>>> data on/off. To report the state of the switch, SW_TOUCH
>>> is added in include/uapi/linux/input.h.
>>>
>>
>> Any status on your patch to add SW_TOUCH event?  Maybe you should
>> resend since its been a while and this patch depends on it.
>
> Which patch do we still need? Isn't this the one? Without the below
> change, the driver would not compile.

Opps, overlooked that part of patch... Also, I was thinking originally
you sent this as its own patch and I didn't expect it here.

Never mind then.

Chris

>
>> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
>> index a372627..fcddcb1 100644
>> --- a/include/uapi/linux/input.h
>> +++ b/include/uapi/linux/input.h
>> @@ -856,6 +856,7 @@ struct input_keymap_entry {
>>  #define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
>>  #define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
>>  #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
>> +#define SW_TOUCH               0x0e  /* set = touch switch turned on (touch events off) */
>>  #define SW_MAX                 0x0f
>>  #define SW_CNT                 (SW_MAX+1)
>
> Ping

^ permalink raw reply

* Re: [PATCH 4/4 v3] Input: wacom - add SW_TOUCH to include/uapi/linux/input.h
From: Ping Cheng @ 2013-11-15 21:59 UTC (permalink / raw)
  To: Chris Bagwell
  Cc: linux-input@vger.kernel.org, Dmitry Torokhov, Jason Gerecke,
	Peter Hutterer, Ping Cheng
In-Reply-To: <CAGzDe_Z8HjejCN8Hh3ABaTEwGWhauGHbprVKYuJAoOXuMumBxg@mail.gmail.com>

On Fri, Nov 15, 2013 at 1:28 PM, Chris Bagwell <chris@cnpbagwell.com> wrote:
> Thanks for breaking out... Its easier to review now as well.
>
> Small question below.
>
> On Fri, Nov 15, 2013 at 2:00 PM, Ping Cheng <pinglinux@gmail.com> wrote:
>> New Intuos series models added a hardware switch to turn touch
>> data on/off. To report the state of the switch, SW_TOUCH
>> is added in include/uapi/linux/input.h.
>>
>> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
>> Tested-by: Jason Gerecke <killertofu@gmail.com>
>> Signed-off-by: Ping Cheng <pingc@wacom.com>
>> ---
>>  drivers/input/tablet/wacom_sys.c | 12 ++++++++++++
>>  drivers/input/tablet/wacom_wac.c | 30 +++++++++++++++++++++++++++---
>>  drivers/input/tablet/wacom_wac.h |  5 +++++
>>  include/uapi/linux/input.h       |  1 +
>>  4 files changed, 45 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
>> index 3a7d99c..bb72fa3 100644
>> --- a/drivers/input/tablet/wacom_sys.c
>> +++ b/drivers/input/tablet/wacom_sys.c
>> @@ -1193,6 +1193,8 @@ static void wacom_wireless_work(struct work_struct *work)
>>                 wacom_wac1->features.device_type = BTN_TOOL_PEN;
>>                 snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen",
>>                          wacom_wac1->features.name);
>> +               wacom_wac1->shared->touch_max = wacom_wac1->features.touch_max;
>> +               wacom_wac1->shared->type = wacom_wac1->features.type;
>>                 error = wacom_register_input(wacom1);
>>                 if (error)
>>                         goto fail;
>> @@ -1214,6 +1216,10 @@ static void wacom_wireless_work(struct work_struct *work)
>>                         error = wacom_register_input(wacom2);
>>                         if (error)
>>                                 goto fail;
>> +
>> +                       if (wacom_wac1->features.type == INTUOSHT &&
>> +                           wacom_wac1->features.touch_max)
>> +                               wacom_wac->shared->touch_input = wacom_wac2->input;
>>                 }
>>
>>                 error = wacom_initialize_battery(wacom);
>> @@ -1392,6 +1398,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
>>                         goto fail5;
>>                 }
>>         }
>> +
>> +       if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) {
>> +               if (wacom_wac->features.device_type == BTN_TOOL_FINGER)
>> +                       wacom_wac->shared->touch_input = wacom_wac->input;
>> +       }
>> +
>>         return 0;
>>
>>   fail5: wacom_destroy_leds(wacom);
>> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
>> index c0cd85d..70beca8 100644
>> --- a/drivers/input/tablet/wacom_wac.c
>> +++ b/drivers/input/tablet/wacom_wac.c
>> @@ -1220,13 +1220,23 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
>>
>>  static int wacom_bpt_pen(struct wacom_wac *wacom)
>>  {
>> +       struct wacom_features *features = &wacom->features;
>>         struct input_dev *input = wacom->input;
>>         unsigned char *data = wacom->data;
>>         int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
>>
>> -       if (data[0] != WACOM_REPORT_PENABLED)
>> +       if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
>>             return 0;
>>
>> +       if (data[0] == WACOM_REPORT_USB) {
>> +               if ((features->type == INTUOSHT) && features->touch_max) {
>> +                       input_report_switch(wacom->shared->touch_input,
>> +                                           SW_TOUCH, data[8] & 0x40);
>> +                       input_sync(wacom->shared->touch_input);
>> +               }
>> +               return 0;
>> +       }
>> +
>>         prox = (data[1] & 0x20) == 0x20;
>>
>>         /*
>> @@ -1259,8 +1269,8 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
>>                  * touching and applying pressure; do not report negative
>>                  * distance.
>>                  */
>> -               if (data[8] <= wacom->features.distance_max)
>> -                       d = wacom->features.distance_max - data[8];
>> +               if (data[8] <= features->distance_max)
>> +                       d = features->distance_max - data[8];
>>
>>                 pen = data[1] & 0x01;
>>                 btn1 = data[1] & 0x02;
>> @@ -1311,6 +1321,13 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>>         if (connected) {
>>                 int pid, battery;
>>
>> +               if ((wacom->shared->type == INTUOSHT) &&
>> +                               wacom->shared->touch_max) {
>> +                       input_report_switch(wacom->shared->touch_input,
>> +                                       SW_TOUCH, data[5] & 0x40);
>> +                       input_sync(wacom->shared->touch_input);
>> +               }
>
> Earlier in patch, SW_TOUCH is read from pen interface and this time
> its read from wireless interface.  Is this to handle a HW model
> difference or wired/wireless difference?

Thank you, Chris, for your review and comments.

Nothing has changed for this chunk of code between this patch and any
of those earlier versions.

I think you mixed 3/4 and 4/4.

There are two kinds of connection we support with Intuos: USB and Wireless.

For USB connection. SW_TOUCH is reported on pen interface. For
wireless, it is reported through wireless interface. It is by design
in the hardware/firmware. I can not change that;-).

> I assume for wired case, it has to come from pen interface... no
> telling what wireless mode does different.
>
> Anyways, maybe a small comment is worthwhile to let people know why
> its needed twice?

It's not twice. They deal with different connections. Anyone has a
device to work on or read the code in whole, not in patches, should
understand that logic easily.

> I see now that its next to impossible to get rid of
> shared->touch_input... which means my old comments were invalid. So:
>
> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>

Thank you for the Reviewed-by. Hope these months' old patches will
find their home soon.

Ping

>
>> +
>>                 pid = get_unaligned_be16(&data[6]);
>>                 battery = data[5] & 0x3f;
>>                 if (wacom->pid != pid) {
>> @@ -1780,6 +1797,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
>>                 break;
>>
>>         case INTUOSHT:
>> +               if (features->touch_max &&
>> +                   (features->device_type == BTN_TOOL_FINGER)) {
>> +                       input_dev->evbit[0] |= BIT_MASK(EV_SW);
>> +                       __set_bit(SW_TOUCH, input_dev->swbit);
>> +               }
>> +               /* fall through */
>> +
>>         case BAMBOO_PT:
>>                 __clear_bit(ABS_MISC, input_dev->absbit);
>>
>> diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
>> index 854cceb..3600cf7 100644
>> --- a/drivers/input/tablet/wacom_wac.h
>> +++ b/drivers/input/tablet/wacom_wac.h
>> @@ -55,6 +55,7 @@
>>  #define WACOM_REPORT_TPC1FGE           18
>>  #define WACOM_REPORT_24HDT             1
>>  #define WACOM_REPORT_WL                        128
>> +#define WACOM_REPORT_USB               192
>>
>>  /* device quirks */
>>  #define WACOM_QUIRK_MULTI_INPUT                0x0001
>> @@ -131,6 +132,10 @@ struct wacom_features {
>>  struct wacom_shared {
>>         bool stylus_in_proximity;
>>         bool touch_down;
>> +       /* for wireless device to access USB interfaces */
>> +       unsigned touch_max;
>> +       int type;
>> +       struct input_dev *touch_input;
>>  };
>>
>>  struct wacom_wac {
>> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
>> index a372627..fcddcb1 100644
>> --- a/include/uapi/linux/input.h
>> +++ b/include/uapi/linux/input.h
>> @@ -856,6 +856,7 @@ struct input_keymap_entry {
>>  #define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
>>  #define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
>>  #define SW_LINEIN_INSERT       0x0d  /* set = inserted */
>> +#define SW_TOUCH               0x0e  /* set = touch switch turned on (touch events off) */
>>  #define SW_MAX                 0x0f
>>  #define SW_CNT                 (SW_MAX+1)
>>
>> --
>> 1.8.3.2
>>

^ permalink raw reply

* [RFC 10/23] Input: omap-keypad - raw read and write endian fix
From: Taras Kondratiuk @ 2013-11-16  0:01 UTC (permalink / raw)
  To: linux-omap
  Cc: linaro-networking, Victor Kamensky, Dmitry Torokhov, linux-input,
	linux-kernel
In-Reply-To: <1384560086-11994-1-git-send-email-taras.kondratiuk@linaro.org>

From: Victor Kamensky <victor.kamensky@linaro.org>

All OMAP IP blocks expect LE data, but CPU may operate in BE mode.
Need to use endian neutral functions to read/write h/w registers.
I.e instead of __raw_read[lw] and __raw_write[lw] functions code
need to use read[lw]_relaxed and write[lw]_relaxed functions.
If the first simply reads/writes register, the second will byteswap
it if host operates in BE mode.

Changes are trivial sed like replacement of __raw_xxx functions
with xxx_relaxed variant.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
 drivers/input/keyboard/omap4-keypad.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 30acfd4..952a2eb 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -89,26 +89,26 @@ struct omap4_keypad {
 
 static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
 {
-	return __raw_readl(keypad_data->base +
+	return readl_relaxed(keypad_data->base +
 				keypad_data->reg_offset + offset);
 }
 
 static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
 {
-	__raw_writel(value,
+	writel_relaxed(value,
 		     keypad_data->base + keypad_data->reg_offset + offset);
 }
 
 static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
 {
-	return __raw_readl(keypad_data->base +
+	return readl_relaxed(keypad_data->base +
 				keypad_data->irqreg_offset + offset);
 }
 
 static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
 			     u32 offset, u32 value)
 {
-	__raw_writel(value,
+	writel_relaxed(value,
 		     keypad_data->base + keypad_data->irqreg_offset + offset);
 }
 
@@ -312,7 +312,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
 		goto err_unmap;
 	}
-	rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
+	rev = readl_relaxed(keypad_data->base + OMAP4_KBD_REVISION);
 	rev &= 0x03 << 30;
 	rev >>= 30;
 	switch (rev) {
-- 
1.7.9.5


^ permalink raw reply related

* Re: [appleir] BUG: unable to handle kernel NULL pointer dereference
From: Jiri Kosina @ 2013-11-16  0:21 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: James Henstridge, Jiri Kosina, Luis Henriques, linux-kernel,
	linux-input, Fabien André, Bastien Nocera
In-Reply-To: <527BB695.9040209@redhat.com>

On Thu, 7 Nov 2013, Benjamin Tissoires wrote:

> Ok, thanks for the report. Could you please test the following patch
> which should solve your problem (hopefully)?

James, do you happen to have testing results please?

> 
> Cheers,
> Benjamin
> 
> --
> 
> >From 54b332b992da1666abe7180b6cecd313c864e0b7 Mon Sep 17 00:00:00 2001
> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Date: Thu, 7 Nov 2013 10:46:48 -0500
> Subject: [PATCH] HID: appleir: force input to be set
> 
> Some weird remotes are not correctly creating the input device. Their
> report descriptor starts with:
> 0x06, 0x00, 0xff,              // Usage Page (Vendor Defined Page 1)  0
> 0xa1, 0x01,                    // Collection (Application)            3
> 
> whereas others (which are correctly handled) start with:
> 0x05, 0x0c,                    // Usage Page (Consumer Devices)       0
> 0x09, 0x01,                    // Usage (Consumer Control)            2
> 0xa1, 0x01,                    // Collection (Application)            4
> 
> The rest of the report descriptor is the same.
> 
> Adding the quirk HID_QUIRK_HIDINPUT_FORCE forces hid-input to allocate
> the inputs, and everything should be ok.
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>  drivers/hid/hid-appleir.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c
> index a42e6a3..0e6a42d 100644
> --- a/drivers/hid/hid-appleir.c
> +++ b/drivers/hid/hid-appleir.c
> @@ -297,6 +297,9 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id)
>  
>  	appleir->hid = hid;
>  
> +	/* force input as some remotes bypass the input registration */
> +	hid->quirks |= HID_QUIRK_HIDINPUT_FORCE;
> +
>  	spin_lock_init(&appleir->lock);
>  	setup_timer(&appleir->key_up_timer,
>  		    key_up_tick, (unsigned long) appleir);
> 

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Logitech M560 (Unifying receiver mouse) - strange keycodes, wrong mapping
From: Alexander Ploumistos @ 2013-11-16 11:09 UTC (permalink / raw)
  To: linux-input

Hello everyone,

I recently got my hands on a Logitech M560 mouse and I tried to use it
with 3.11.x kernels (Fedora & Ubuntu). The button mapping was not what
I expected, so I ran it through evtest, xev and xinput, to see what
was off.

First, a few words about the device itself: It appears to be a
somewhat new model, so there is almost no info about it on the net. It
has nine buttons (left & right click, scroll wheel, tilt, forward &
back buttons and a small button behind the wheel) and it connects to
the computer via a "Unifying receiver". It lacks a middle button;
pressing on the wheel engages and disengages the freewheel mechanism,
although I guess the small button behind the wheel is not too
inconvenient to be used for middle clicks. However, this button is
supposed to do something special in windows 8 and surprisingly, it has
two different states.

The original mapping: Left and right clicks are mapped to buttons 1
and 3, wheel up/down to buttons 4/5, left/right tilts to buttons 8/9
(BTN_SIDE & BTN_EXTRA respectively instead of horizontal wheel
left/right), the back button sends simultaneously keypresses for
Super_L and "d", the forward button acts like a keypress for Super_R.
When you press the aforementioned "special" button for the first time,
it sends keycodes 64, 133 and 201 simultaneously (Alt_L, Super_L and
XF86TouchpadOff); press it again, and it acts like button 1. From
there on, it cycles between those two events.

Would anyone be interested in adding support for the mouse? Is it
possible to override the keycodes sent by the buttons, so that they
are recognized as buttons and not keyboard keys?

I will send the evtest output in a follow-up message.

Thank you for your time

^ permalink raw reply

* Logitech M560 - Pt. 2
From: Alexander Ploumistos @ 2013-11-16 11:32 UTC (permalink / raw)
  To: linux-input

And here is the evtest output, I've removed mouse movements, to keep
it short. The keys are in the following order: Left click, right
click, wheel up, wheel down, left tilt, right tilt, forward button,
back button, small button behind the wheel (that last one twice).

Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc52b version 0x111
Input device name: "Logitech Unifying Device. Wireless PID:402d"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
    Event code 5 (KEY_4)
    Event code 6 (KEY_5)
    Event code 7 (KEY_6)
    Event code 8 (KEY_7)
    Event code 9 (KEY_8)
    Event code 10 (KEY_9)
    Event code 11 (KEY_0)
    Event code 12 (KEY_MINUS)
    Event code 13 (KEY_EQUAL)
    Event code 14 (KEY_BACKSPACE)
    Event code 15 (KEY_TAB)
    Event code 16 (KEY_Q)
    Event code 17 (KEY_W)
    Event code 18 (KEY_E)
    Event code 19 (KEY_R)
    Event code 20 (KEY_T)
    Event code 21 (KEY_Y)
    Event code 22 (KEY_U)
    Event code 23 (KEY_I)
    Event code 24 (KEY_O)
    Event code 25 (KEY_P)
    Event code 26 (KEY_LEFTBRACE)
    Event code 27 (KEY_RIGHTBRACE)
    Event code 28 (KEY_ENTER)
    Event code 29 (KEY_LEFTCTRL)
    Event code 30 (KEY_A)
    Event code 31 (KEY_S)
    Event code 32 (KEY_D)
    Event code 33 (KEY_F)
    Event code 34 (KEY_G)
    Event code 35 (KEY_H)
    Event code 36 (KEY_J)
    Event code 37 (KEY_K)
    Event code 38 (KEY_L)
    Event code 39 (KEY_SEMICOLON)
    Event code 40 (KEY_APOSTROPHE)
    Event code 41 (KEY_GRAVE)
    Event code 42 (KEY_LEFTSHIFT)
    Event code 43 (KEY_BACKSLASH)
    Event code 44 (KEY_Z)
    Event code 45 (KEY_X)
    Event code 46 (KEY_C)
    Event code 47 (KEY_V)
    Event code 48 (KEY_B)
    Event code 49 (KEY_N)
    Event code 50 (KEY_M)
    Event code 51 (KEY_COMMA)
    Event code 52 (KEY_DOT)
    Event code 53 (KEY_SLASH)
    Event code 54 (KEY_RIGHTSHIFT)
    Event code 55 (KEY_KPASTERISK)
    Event code 56 (KEY_LEFTALT)
    Event code 57 (KEY_SPACE)
    Event code 58 (KEY_CAPSLOCK)
    Event code 59 (KEY_F1)
    Event code 60 (KEY_F2)
    Event code 61 (KEY_F3)
    Event code 62 (KEY_F4)
    Event code 63 (KEY_F5)
    Event code 64 (KEY_F6)
    Event code 65 (KEY_F7)
    Event code 66 (KEY_F8)
    Event code 67 (KEY_F9)
    Event code 68 (KEY_F10)
    Event code 69 (KEY_NUMLOCK)
    Event code 70 (KEY_SCROLLLOCK)
    Event code 71 (KEY_KP7)
    Event code 72 (KEY_KP8)
    Event code 73 (KEY_KP9)
    Event code 74 (KEY_KPMINUS)
    Event code 75 (KEY_KP4)
    Event code 76 (KEY_KP5)
    Event code 77 (KEY_KP6)
    Event code 78 (KEY_KPPLUS)
    Event code 79 (KEY_KP1)
    Event code 80 (KEY_KP2)
    Event code 81 (KEY_KP3)
    Event code 82 (KEY_KP0)
    Event code 83 (KEY_KPDOT)
    Event code 85 (KEY_ZENKAKUHANKAKU)
    Event code 86 (KEY_102ND)
    Event code 87 (KEY_F11)
    Event code 88 (KEY_F12)
    Event code 89 (KEY_RO)
    Event code 90 (KEY_KATAKANA)
    Event code 91 (KEY_HIRAGANA)
    Event code 92 (KEY_HENKAN)
    Event code 93 (KEY_KATAKANAHIRAGANA)
    Event code 94 (KEY_MUHENKAN)
    Event code 95 (KEY_KPJPCOMMA)
    Event code 96 (KEY_KPENTER)
    Event code 97 (KEY_RIGHTCTRL)
    Event code 98 (KEY_KPSLASH)
    Event code 99 (KEY_SYSRQ)
    Event code 100 (KEY_RIGHTALT)
    Event code 102 (KEY_HOME)
    Event code 103 (KEY_UP)
    Event code 104 (KEY_PAGEUP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 107 (KEY_END)
    Event code 108 (KEY_DOWN)
    Event code 109 (KEY_PAGEDOWN)
    Event code 110 (KEY_INSERT)
    Event code 111 (KEY_DELETE)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 116 (KEY_POWER)
    Event code 117 (KEY_KPEQUAL)
    Event code 119 (KEY_PAUSE)
    Event code 121 (KEY_KPCOMMA)
    Event code 122 (KEY_HANGUEL)
    Event code 123 (KEY_HANJA)
    Event code 124 (KEY_YEN)
    Event code 125 (KEY_LEFTMETA)
    Event code 126 (KEY_RIGHTMETA)
    Event code 127 (KEY_COMPOSE)
    Event code 128 (KEY_STOP)
    Event code 129 (KEY_AGAIN)
    Event code 130 (KEY_PROPS)
    Event code 131 (KEY_UNDO)
    Event code 132 (KEY_FRONT)
    Event code 133 (KEY_COPY)
    Event code 134 (KEY_OPEN)
    Event code 135 (KEY_PASTE)
    Event code 136 (KEY_FIND)
    Event code 137 (KEY_CUT)
    Event code 138 (KEY_HELP)
    Event code 140 (KEY_CALC)
    Event code 142 (KEY_SLEEP)
    Event code 150 (KEY_WWW)
    Event code 152 (KEY_SCREENLOCK)
    Event code 158 (KEY_BACK)
    Event code 159 (KEY_FORWARD)
    Event code 161 (KEY_EJECTCD)
    Event code 163 (KEY_NEXTSONG)
    Event code 164 (KEY_PLAYPAUSE)
    Event code 165 (KEY_PREVIOUSSONG)
    Event code 166 (KEY_STOPCD)
    Event code 173 (KEY_REFRESH)
    Event code 176 (KEY_EDIT)
    Event code 177 (KEY_SCROLLUP)
    Event code 178 (KEY_SCROLLDOWN)
    Event code 179 (KEY_KPLEFTPAREN)
    Event code 180 (KEY_KPRIGHTPAREN)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
    Event code 186 (KEY_F16)
    Event code 187 (KEY_F17)
    Event code 188 (KEY_F18)
    Event code 189 (KEY_F19)
    Event code 190 (KEY_F20)
    Event code 191 (KEY_F21)
    Event code 192 (KEY_F22)
    Event code 193 (KEY_F23)
    Event code 194 (KEY_F24)
    Event code 240 (KEY_UNKNOWN)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
    Event code 275 (BTN_SIDE)
    Event code 276 (BTN_EXTRA)
    Event code 277 (BTN_FORWARD)
    Event code 278 (BTN_BACK)
    Event code 279 (BTN_TASK)
    Event code 280 (?)
    Event code 281 (?)
    Event code 282 (?)
    Event code 283 (?)
    Event code 284 (?)
    Event code 285 (?)
    Event code 286 (?)
    Event code 287 (?)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HWHEEL)
    Event code 8 (REL_WHEEL)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 17 (EV_LED)
    Event code 0 (LED_NUML)
    Event code 1 (LED_CAPSL)
    Event code 2 (LED_SCROLLL)
    Event code 3 (LED_COMPOSE)
    Event code 4 (LED_KANA)
Properties:
  Property type 20 (EV_REP)
    Property code 0 (REP_DELAY)
      Value    250
    Property code 1 (REP_PERIOD)
      Value     33
Testing ... (interrupt to exit)
Event: time 1384596124.022800, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1384596124.022800, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1384596124.022800, -------------- SYN_REPORT ------------
Event: time 1384596124.184807, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1384596124.184807, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1384596124.184807, -------------- SYN_REPORT ------------
Event: time 1384596126.178789, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1384596126.178789, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 1
Event: time 1384596126.178789, -------------- SYN_REPORT ------------
Event: time 1384596126.356737, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1384596126.356737, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 0
Event: time 1384596126.356737, -------------- SYN_REPORT ------------
Event: time 1384596135.276730, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1384596135.276730, -------------- SYN_REPORT ------------
Event: time 1384596140.958607, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1384596140.958607, -------------- SYN_REPORT ------------
Event: time 1384596159.362527, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1384596159.362527, type 1 (EV_KEY), code 275 (BTN_SIDE), value 1
Event: time 1384596159.362527, -------------- SYN_REPORT ------------
Event: time 1384596159.542501, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1384596159.542501, type 1 (EV_KEY), code 275 (BTN_SIDE), value 0
Event: time 1384596163.550443, -------------- SYN_REPORT ------------
Event: time 1384596163.636455, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1384596163.636455, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 1
Event: time 1384596163.636455, -------------- SYN_REPORT ------------
Event: time 1384596163.870448, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1384596163.870448, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 0
Event: time 1384596168.990412, -------------- SYN_REPORT ------------
Event: time 1384596169.138456, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e7
Event: time 1384596169.138456, type 1 (EV_KEY), code 126
(KEY_RIGHTMETA), value 1
Event: time 1384596169.138456, -------------- SYN_REPORT ------------
Event: time 1384596169.356463, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e7
Event: time 1384596169.356463, type 1 (EV_KEY), code 126
(KEY_RIGHTMETA), value 0
Event: time 1384596169.356463, -------------- SYN_REPORT ------------
Event: time 1384596178.602405, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1384596178.602405, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1384596178.602405, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007
Event: time 1384596178.602405, type 1 (EV_KEY), code 32 (KEY_D), value 1
Event: time 1384596178.602405, -------------- SYN_REPORT ------------
Event: time 1384596178.610395, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007
Event: time 1384596178.610395, type 1 (EV_KEY), code 32 (KEY_D), value 0
Event: time 1384596178.610395, -------------- SYN_REPORT ------------
Event: time 1384596178.618392, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1384596178.618392, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1384596178.618392, -------------- SYN_REPORT ------------
Event: time 1384596181.964304, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1384596181.964304, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1384596181.964304, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1384596181.964304, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1384596181.964304, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70072
Event: time 1384596181.964304, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1384596181.964304, -------------- SYN_REPORT ------------
Event: time 1384596181.972327, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2
Event: time 1384596181.972327, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1384596181.972327, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1384596181.972327, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1384596181.972327, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70072
Event: time 1384596181.972327, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1384596181.972327, -------------- SYN_REPORT ------------
Event: time 1384596184.976378, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1384596184.976378, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
Event: time 1384596184.976378, -------------- SYN_REPORT ------------
Event: time 1384596184.984314, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1384596184.984314, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1384596184.984314, -------------- SYN_REPORT ------------

^ permalink raw reply

* Re: [PATCH v3] add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)
From: Florian Echtler @ 2013-11-16 11:45 UTC (permalink / raw)
  To: Henrik Rydberg, Dmitry Torokhov
  Cc: linux-input, benjamin.tissoires, dh.herrmann
In-Reply-To: <52822E8B.6030906@butterbrot.org>

Looks like the sur40 driver didn't make it into the 3.13 pull request, 
anything still missing/broken? I was hoping this might still make it 
into Ubuntu 14.04...

BR, Florian

Florian Echtler <floe@butterbrot.org> wrote:
>On 11.11.2013 11:27, Henrik Rydberg wrote:
>>  >> Also, does the patch below mess up or device or it still works?
>>> I'll test this tomorrow (no access to SUR40 today). If everything
>works,
>>> should I resubmit my patch with yours included or just tell you that
>>> it's fine?
>> No need to resubmit, a confirmation will do nicely. Thanks!
>> Henrik
>
>I've tested Dmitry's additional patch, confirmed to work. Just for the
>record:
>
>Tested-by: Florian Echtler <floe@butterbrot.org>
>
>BR, Florian

^ permalink raw reply

* Re: About the PS3 Sixaxis linux driver
From: Antonio Ospite @ 2013-11-16 17:06 UTC (permalink / raw)
  To: simon; +Cc: Benjamin Tissoires, case, linux-input
In-Reply-To: <6ead5599102745d03c2c28b640b11fb4.squirrel@mungewell.org>

On Mon, 4 Nov 2013 16:40:29 -0500
simon@mungewell.org wrote:

Hi Simon, sorry for the delay on this one.
 
> > Actually I intended to rewrite the whole HID descriptor and add a sane
> > mapping for all the buttons (maybe following the Gamepad API and
> > even using the new ABS_ACCEL_* and ABS_GYRO_* events from David
> > Hermann).
> 
> I think that the root of the problem here is simply the large number of
> axis, and that the keycodes start at 'axis-x' then overflow into/past the
> MultiTouch keycode.
>

Yes, and the code that maps HID usages to event keycodes also comes into
play I guess.

> This problem is going to be a more common one as HID drivers present more
> buttons/axis.
> 
> We did some patching here:
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-sony.c?id=refs/tags/v3.12#n301
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/hid/hid-sony.c?id=61ab44bebdefab296487e7cd723a634849278827
> 
> Do we need to fix this is the HID descriptor, or in 'hid-sony' input stuff?

I think both:

  1. adjust the HID descriptor into something that can be more easily
     remapped;

  2. remap the keycodes in hid-sony to those of the gamepad API, because
     AFAICT that can't be achieved by solely deciding HID usage codes in
     the descriptor.

> Do you have example of another driver to copy?

I am doing some work already in this direction, on the lines of what we
did for the ps3remote in hid-sony, but it needs some input bits not
merged yet, I'll send an RFC as soon as this becomes more easily
testable.

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

^ permalink raw reply

* Re: [PATCH 04/13] Input: add motion-tracking ABS_* bits and docs
From: Antonio Ospite @ 2013-11-16 17:53 UTC (permalink / raw)
  To: David Herrmann
  Cc: open list:HID CORE LAYER, Dmitry Torokhov, Jiri Kosina,
	Peter Hutterer, Benjamin Tissoires
In-Reply-To: <CANq1E4Szv+0-GSkekH_Q5HXDv+hq7LS6tYbZFTtmxsUp1-ALkA@mail.gmail.com>

On Fri, 15 Nov 2013 11:17:31 +0100
David Herrmann <dh.herrmann@gmail.com> wrote:

> Hi Antonio
> 
> On Fri, Nov 15, 2013 at 11:11 AM, Antonio Ospite
> <ospite@studenti.unina.it> wrote:
> > On Fri,  1 Nov 2013 21:16:15 +0100
> > David Herrmann <dh.herrmann@gmail.com> wrote:
> >
> >> Motion sensors are getting quite common in mobile devices. To avoid
> >> returning accelerometer data via ABS_X/Y/Z and irritating the Xorg
> >> mouse-driver, this adds separate ABS_* bits for that.
> >>
> >> This is needed if gaming devices want to report their normal data plus
> >> accelerometer/gyro data. Usually, ABS_X/Y are already used by analog
> >> sticks, so need separate definitions, anyway.
> >>
> >> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> >
> > Hi, what's the status of this patch?
> > I cannot see it in Dmitry's repository, David maybe you have another
> > repository I can pull from?
> 
> Please see patch 1/13 and 2/13. They fix the kernel ABI to support new
> ABS_* bits (the current ABI is broken in that regard). As this is
> quite critical and caused breaks during the last merge-window, we
> haven't merged it yet. I hope to get it into 3.14, though. The current
> patches seem fine and work for me. I will try to get the user-space
> part working in the next weeks.
> 
> Any help is welcome!
> 

I can try updating evtest, any idea about how I should check at
runtime whether ABS_MAX2 is supported or not?

Ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

^ permalink raw reply

* Re: [PATCH v3] add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)
From: Henrik Rydberg @ 2013-11-16 18:08 UTC (permalink / raw)
  To: Florian Echtler
  Cc: Dmitry Torokhov, linux-input, benjamin.tissoires, dh.herrmann
In-Reply-To: <52875AEF.2010109@butterbrot.org>

Hi Florian,

> Looks like the sur40 driver didn't make it into the 3.13 pull request,
> anything still missing/broken? I was hoping this might still make it into
> Ubuntu 14.04...

Nothing is broken, don't worry. If you want to make sure to hit a
certain merge window, then everything should be set and applied
several weeks before that, to allow for automatic testing and
administration. It could be that Dmitry is stacking up for a second
pull request in a couple of weeks, but I would not count on it. If you
want Ubuntu to pick your patches up, you can always try to send them
to kernel-team@lists.ubuntu.com; they might be willing to carry your
patches to the next kernel release. It helps to refer to the
appropriate commits in linux-next.

Thanks,
Henrik

^ permalink raw reply

* Re: [PATCH 04/13] Input: add motion-tracking ABS_* bits and docs
From: David Herrmann @ 2013-11-16 18:07 UTC (permalink / raw)
  To: Antonio Ospite
  Cc: open list:HID CORE LAYER, Dmitry Torokhov, Jiri Kosina,
	Peter Hutterer, Benjamin Tissoires
In-Reply-To: <20131116185337.0d2c80ff184ea582d69858ed@studenti.unina.it>

Hi

On Sat, Nov 16, 2013 at 6:53 PM, Antonio Ospite
<ospite@studenti.unina.it> wrote:
> On Fri, 15 Nov 2013 11:17:31 +0100
> David Herrmann <dh.herrmann@gmail.com> wrote:
>
>> Hi Antonio
>>
>> On Fri, Nov 15, 2013 at 11:11 AM, Antonio Ospite
>> <ospite@studenti.unina.it> wrote:
>> > On Fri,  1 Nov 2013 21:16:15 +0100
>> > David Herrmann <dh.herrmann@gmail.com> wrote:
>> >
>> >> Motion sensors are getting quite common in mobile devices. To avoid
>> >> returning accelerometer data via ABS_X/Y/Z and irritating the Xorg
>> >> mouse-driver, this adds separate ABS_* bits for that.
>> >>
>> >> This is needed if gaming devices want to report their normal data plus
>> >> accelerometer/gyro data. Usually, ABS_X/Y are already used by analog
>> >> sticks, so need separate definitions, anyway.
>> >>
>> >> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
>> >
>> > Hi, what's the status of this patch?
>> > I cannot see it in Dmitry's repository, David maybe you have another
>> > repository I can pull from?
>>
>> Please see patch 1/13 and 2/13. They fix the kernel ABI to support new
>> ABS_* bits (the current ABI is broken in that regard). As this is
>> quite critical and caused breaks during the last merge-window, we
>> haven't merged it yet. I hope to get it into 3.14, though. The current
>> patches seem fine and work for me. I will try to get the user-space
>> part working in the next weeks.
>>
>> Any help is welcome!
>>
>
> I can try updating evtest, any idea about how I should check at
> runtime whether ABS_MAX2 is supported or not?

That's still my current issue that I need to fix. My intention is to
increase EVDEV_VERSION, so EVIOCGVERSION will suffice to test for it.

Thanks
David

^ permalink raw reply

* Re: [PATCH] HID: sony: Add force feedback support for Dualshock3 USB
From: simon @ 2013-11-16 22:30 UTC (permalink / raw)
  Cc: linux-input, Jiri Kosina, Colin Leitner, Sven Eckelmann
In-Reply-To: <1384021557-24106-1-git-send-email-sven@narfation.org>

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

> Sony Dualshock 3 controllers have two motors which can be used to provide
> simple force feedback rumble effects. The right motor is can be used to
> create
> a weak rumble effect but does not allow to set the force. The left motor
> is
> used to create a strong rumble effect with adjustable intensity.

Hi,
This patch appears to work OK with my DualShock/SixAxis controller (USB
connection), but causes a machine lockup when used with my Intec wired
controller.

The Intec controller works OK up to the point when I start rumble,
sometimes the motor runs some times it doesn't. I am using SDL2's
'testhaptic' application.

Syslog log attached detail controller.

If you have any specific tests to run, please advise,
Simon

[-- Attachment #2: intec.txt --]
[-- Type: text/plain, Size: 1305 bytes --]

Nov 16 14:26:21 womble kernel: [   95.296039] usb 3-1: new full-speed USB device number 2 using uhci_hcd
Nov 16 14:26:22 womble kernel: [   95.463964] usb 3-1: New USB device found, idVendor=054c, idProduct=0268
Nov 16 14:26:22 womble kernel: [   95.463973] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Nov 16 14:26:22 womble kernel: [   95.463978] usb 3-1: Product: PLAYSTATION(R)3 Controller
Nov 16 14:26:22 womble kernel: [   95.463982] usb 3-1: Manufacturer: GASIA CORP.
Nov 16 14:26:22 womble mtp-probe: checking bus 3, device 2: "/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1"
Nov 16 14:26:22 womble mtp-probe: bus: 3, device: 2 was not an MTP device
Nov 16 14:26:22 womble kernel: [   95.770400] usbcore: registered new interface driver usbhid
Nov 16 14:26:22 womble kernel: [   95.770408] usbhid: USB HID core driver
Nov 16 14:26:22 womble kernel: [   95.838174] sony 0003:054C:0268.0001: Fixing up Sony Sixaxis report descriptor
Nov 16 14:26:22 womble kernel: [   95.848763] input: GASIA CORP. PLAYSTATION(R)3 Controller as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input7
Nov 16 14:26:22 womble kernel: [   95.849784] sony 0003:054C:0268.0001: input,hiddev0,hidraw0: USB HID v1.11 Joystick [GASIA CORP. PLAYSTATION(R)3 Controller] on usb-0000:00:1d.1-1/input0

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox