]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Fri, 10 Apr 2015 15:33:45 +0000 (17:33 +0200)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: debug: fix error handling in hid_debug_events_read()
Jiri Kosina [Thu, 9 Apr 2015 11:32:35 +0000 (13:32 +0200)]
HID: debug: fix error handling in hid_debug_events_read()

In the unlikely case of hdev vanishing while hid_debug_events_read() was
sleeping, we can't really break out of the case switch as with other cases,
as on the way out we'll try to remove ourselves from the hdev waitqueue.

Fix this by taking a shortcut exit path and avoiding cleanup that doesn't
make sense in case hdev doesn't exist any more anyway.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Tue, 7 Apr 2015 13:17:11 +0000 (15:17 +0200)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoInput - mt: Fix input_mt_get_slot_by_key
Benjamin Tissoires [Mon, 30 Mar 2015 18:54:15 +0000 (14:54 -0400)]
Input - mt: Fix input_mt_get_slot_by_key

The case occurred recently with a touchscreen using twice a slot during a
single EV_SYN event:

E: 0.288415 0000 0000 0000      # ------------ SYN_REPORT (0) ----------
E: 0.296207 0003 002f 0000      # EV_ABS / ABS_MT_SLOT          0
E: 0.296207 0003 0039 -001      # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 0.296207 0003 002f 0001      # EV_ABS / ABS_MT_SLOT          1
E: 0.296207 0003 0035 0908      # EV_ABS / ABS_MT_POSITION_X    908
E: 0.296207 0003 0036 1062      # EV_ABS / ABS_MT_POSITION_Y    1062
E: 0.296207 0003 002f 0000      # EV_ABS / ABS_MT_SLOT          0
E: 0.296207 0003 0039 8787      # EV_ABS / ABS_MT_TRACKING_ID   8787
E: 0.296207 0003 0035 1566      # EV_ABS / ABS_MT_POSITION_X    1566
E: 0.296207 0003 0036 0861      # EV_ABS / ABS_MT_POSITION_Y    861
E: 0.296207 0003 0000 0908      # EV_ABS / ABS_X                908
E: 0.296207 0003 0001 1062      # EV_ABS / ABS_Y                1062
E: 0.296207 0000 0000 0000      # ------------ SYN_REPORT (0) ----------

This occurred because while having already slots 0 and 1 assigned, the
touchscreen sent:

0.293377 Tip Switch: 0 | Contact Id: 0 | X:  539 | Y: 1960 | Contact Count: 3
0.294783 Tip Switch: 1 | Contact Id: 1 | X:  908 | Y: 1062 | Contact Count: 0
0.296187 Tip Switch: 1 | Contact Id: 2 | X: 1566 | Y:  861 | Contact Count: 0

Slot 0 is released correclty, but when we look for Contact ID 2, the slot
0 is then picked up again because it is marked as inactive (trackingID < 0).

This is wrong, and we should not reuse a slot in the same frame.
The test should also check for input_mt_is_used().

In addition, we need to initialize mt->frame to an other value than 0.
With mt->frame being 0, all slots are tags as currently used, and so
input_mt_get_slot_by_key() would return -1 for all requests.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88903
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/logitech' into for-next
Jiri Kosina [Sun, 5 Apr 2015 20:56:54 +0000 (22:56 +0200)]
Merge branch 'for-4.1/logitech' into for-next

9 years agoHID: logitech-hidpp: fix error return code
Julia Lawall [Sun, 5 Apr 2015 12:06:29 +0000 (14:06 +0200)]
HID: logitech-hidpp: fix error return code

Return a negative error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Thu, 2 Apr 2015 12:58:58 +0000 (14:58 +0200)]
Merge branch 'for-4.1/wacom' into for-next

9 years agoHID: wacom: Add support for Cintiq 13HD Touch
Ping Cheng [Thu, 26 Mar 2015 00:08:13 +0000 (17:08 -0700)]
HID: wacom: Add support for Cintiq 13HD Touch

Cintiq 13HD Touch is a new display tablet with pen and 10 finger touches.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/logitech' into for-next
Jiri Kosina [Thu, 2 Apr 2015 12:30:21 +0000 (14:30 +0200)]
Merge branch 'for-4.1/logitech' into for-next

9 years agoHID: logitech-hidpp: add a module parameter to keep firmware gestures
Benjamin Tissoires [Thu, 26 Mar 2015 16:41:57 +0000 (12:41 -0400)]
HID: logitech-hidpp: add a module parameter to keep firmware gestures

The Logitech T650 used to report 3 fingers swipes to the up as a press on the
Super key. When we switched the touchpad to the raw mode, we also disable such
firmware gesture and some users may rely on it.

Unfortunately, 3 finger swipes are still not supported in most of the Linux
environments, which means that we disabled a feature of the touchpad.

Allow users to revert the raw reporting mode and keep going with the firmware
gestures by providing a new module parameter.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Thu, 2 Apr 2015 12:26:01 +0000 (14:26 +0200)]
Merge branch 'for-4.0/upstream-fixes' into for-next

9 years agoHID: usbhid: yet another mouse with ALWAYS_POLL
Oliver Neukum [Mon, 30 Mar 2015 10:36:36 +0000 (12:36 +0200)]
HID: usbhid: yet another mouse with ALWAYS_POLL

The device exists with two device IDs instead of one as previously
believed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: usbhid: more mice with ALWAYS_POLL
Oliver Neukum [Mon, 30 Mar 2015 10:36:35 +0000 (12:36 +0200)]
HID: usbhid: more mice with ALWAYS_POLL

During a stress test these mice kept dropping and reappearing
in runlevel 1 as opposed to 5.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Thu, 2 Apr 2015 12:19:54 +0000 (14:19 +0200)]
Merge branch 'for-4.1/wacom' into for-next

Conflicts:
drivers/hid/wacom_wac.c

9 years agoHID: wacom: set stylus_in_proximity before checking touch_down
Ping Cheng [Fri, 20 Mar 2015 21:58:01 +0000 (14:58 -0700)]
HID: wacom: set stylus_in_proximity before checking touch_down

In wacom_bpt_pen, we checked touch_down before assigning new
stylus_in_proximity value. This would cause stylus_in_proximity not updated
properly if touch is down before pen is in proximity.

[jkosina@suse.cz: fix if-else style]
Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: use wacom_wac_finger_count_touches to set touch_down
Ping Cheng [Fri, 20 Mar 2015 21:57:21 +0000 (14:57 -0700)]
HID: wacom: use wacom_wac_finger_count_touches to set touch_down

Counting number of touching fingers by wacom_wac_finger_count_touches so we
don't have to count them inside individual routines.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT
Ping Cheng [Fri, 20 Mar 2015 21:57:00 +0000 (14:57 -0700)]
HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT

The quirk was added for devices that support both pen and touch.  It decides if
a device supports multiple inputs by hardcoded feature type. However, for some
devices, we do not know if they support both before accessing their HID
descriptors.

This patch relies on dynamically assigned device_type to make the decision.
Also, we make it certain that wacom_wac->shared is always created. That is, the
driver will not be loaded if it fails to create wacom_wac->shared.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-4.1/wacom
Jiri Kosina [Thu, 2 Apr 2015 12:09:09 +0000 (14:09 +0200)]
Merge branch 'for-4.0/upstream-fixes' into for-4.1/wacom

Conflicts:
drivers/hid/wacom_wac.c

Need to fetch the 4.0 fixes to apply 4.1 patches based on top
of those.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Fri, 27 Mar 2015 15:05:41 +0000 (16:05 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: pidff: effect can't be NULL
Jiri Kosina [Fri, 27 Mar 2015 15:03:26 +0000 (16:03 +0100)]
HID: pidff: effect can't be NULL

Force-beedback core guarantees that the 'effect' pointer that's being passed
to ->upload() callback is non-NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Wed, 25 Mar 2015 15:02:58 +0000 (16:02 +0100)]
Merge branch 'for-4.0/upstream-fixes' into for-next

9 years agoHID: add quirk for PIXART OEM mouse used by HP
Oliver Neukum [Wed, 25 Mar 2015 14:38:31 +0000 (15:38 +0100)]
HID: add quirk for PIXART OEM mouse used by HP

This mouse is also known under other IDs. It needs the quirk or will disconnect
in runlevel 1 or 3.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: add HP OEM mouse to quirk ALWAYS_POLL
Oliver Neukum [Wed, 25 Mar 2015 14:13:36 +0000 (15:13 +0100)]
HID: add HP OEM mouse to quirk ALWAYS_POLL

This mouse needs QUIRK_ALWAYS_POLL.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Tue, 17 Mar 2015 20:01:20 +0000 (21:01 +0100)]
Merge branch 'for-4.0/upstream-fixes' into for-next

9 years agoHID: wacom: check for wacom->shared before following the pointer
Benjamin Tissoires [Thu, 5 Mar 2015 22:36:35 +0000 (17:36 -0500)]
HID: wacom: check for wacom->shared before following the pointer

486b908 (HID: wacom: do not send pen events before touch is up/forced out)
introduces a kernel oops when plugging a tablet without touch.

wacom->shared is null for these devices so this leads to a null pointer
exception.

Change the condition to make it clear that what we need is wacom->shared
not NULL.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Mon, 16 Mar 2015 19:19:43 +0000 (20:19 +0100)]
Merge branch 'for-4.1/wacom' into for-next

9 years agoHID: wacom: ask for a in-prox report when it was missed
Benjamin Tissoires [Thu, 5 Mar 2015 22:36:54 +0000 (17:36 -0500)]
HID: wacom: ask for a in-prox report when it was missed

If noone listens to the input device when a tool comes in proximity,
the tablet does not send the in-prox event when a client becomes available.
That means that no events will be sent until the tool is taken out of
proximity.

In this situation, ask for the report WACOM_REPORT_INTUOSREAD which will
read the corresponding feature and generate an in-prox event.
To make some generation of hardware working, we need to unset the
quirk NO_GET set by hid-core because the interfaces are seen as "boot
mouse".

We don't schedule this read in a worker while we are in an IO interrupt.
We know that usbhid will do it asynchronously. If this is triggered by
uhid, then this is obviously a client side bug :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/sensor-hub' into for-next
Jiri Kosina [Mon, 16 Mar 2015 15:25:49 +0000 (16:25 +0100)]
Merge branch 'for-4.1/sensor-hub' into for-next

9 years agoHID: hid-sensor-hub: Fix sparse warning
Srinivas Pandruvada [Thu, 26 Feb 2015 19:04:44 +0000 (11:04 -0800)]
HID: hid-sensor-hub: Fix sparse warning

Since I can't change the type of hid_set_field argument 3, using __force __s32 to remove
this warning.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/sensor-hub' into for-next
Jiri Kosina [Mon, 16 Mar 2015 15:22:16 +0000 (16:22 +0100)]
Merge branch 'for-4.1/sensor-hub' into for-next

9 years agoHID: hid-sensor-hub: fix attribute read for logical usage id
Srinivas Pandruvada [Thu, 26 Feb 2015 02:56:27 +0000 (18:56 -0800)]
HID: hid-sensor-hub: fix attribute read for logical usage id

For defining enumeration values like report or power status events, the
enumeration usage ids are enclosed in a logical collection.  In this case we
need to match logical usage id for pending read on this usage id. For example,
in the below field, when read is requested for 0319, the report will
contain one of the status usages like 850, 851 etc. In this case the raw
event will not match 0319. So when logical collection matches, then wake
up the pending thread.

      Physical(Sensor.OtherCustom)
      Logical(Sensor.0319)
      Application(Sensor.Sensor)
      Usage(6)
        Sensor.0850
        Sensor.0851
        Sensor.0852
        Sensor.0853
        Sensor.0854
        Sensor.0855
      Logical Minimum(1)
      Logical Maximum(5)
      Report Size(8)
      Report Count(1)
      Report Offset(24)
      Flags( Array Absolute )

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Mon, 16 Mar 2015 15:17:17 +0000 (16:17 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: plantronics: fix Kconfig default
Stefan Richter [Sun, 1 Feb 2015 19:42:04 +0000 (20:42 +0100)]
HID: plantronics: fix Kconfig default

This driver didn't exist until before v3.19.
Why would suddenly everybody want to build it?

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Mon, 16 Mar 2015 15:12:37 +0000 (16:12 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: pidff: support more than one concurrent effect
Jim Keir [Thu, 26 Feb 2015 09:14:03 +0000 (09:14 +0000)]
HID: pidff: support more than one concurrent effect

The PID driver (usbhid/hid-pidff.c) does not set the effect ID when
uploading an effect. The result is that the initial upload works but
subsequent uploads to modify effect parameters are all directed at the
last-created effect.

The targeted effect ID must be passed back to the device when effect
parameters are changed. This is done at the start of
"pidff_set_condition_report", "pidff_set_periodic_report" etc. based on
the value of "pidff->block_load[PID_EFFECT_
BLOCK_INDEX].value[0]".

This value is only ever set during pidff_request_effect_upload.
The result is stored in "pidff->pid_id[effect->id]" at the end of
pid_upload_effect, for later use. However, if an effect is modified and
re-sent then this identifier is not being copied back from
pidff->pid_id[effect->id] before sending the command to the device. The
fix is to do this at the start of pidff_upload_effect.

Signed-off-by: Jim Keir <jimkeir@oracledbadirect.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/kconfig-drop-expert-dependency' into for-next
Jiri Kosina [Mon, 16 Mar 2015 15:00:14 +0000 (16:00 +0100)]
Merge branch 'for-4.1/kconfig-drop-expert-dependency' into for-next

9 years agoHID: Stop hiding options with !EXPERT
Jean Delvare [Fri, 20 Feb 2015 16:33:33 +0000 (17:33 +0100)]
HID: Stop hiding options with !EXPERT

Many HID driver options are hidden unless EXPERT is set. While I
understand the idea of simplifying the kernel configuration for most
users, in practice I believe it adds more confusion than it helps.

One thing that worries me is that, in non-EXPERT mode, these drivers
will be either built-in or modular based on apparent magic. For
example, switching INPUT and HID from m to y will cause all these
drivers to be built into the kernel when they were previously built
as modules. Short of enabling EXPERT mode altogether, the user has no
control over that.

Generally I do not think tristate options should depend on !EXPERT.
Of these, 11 of 15 are currently in the hid subsystem.

The HID_LOGITECH option is even worse than the others. Sub-options
depend on it, and this causes menuconfig and friends to display the
option even though the user can't change its value. The help page for
HID_LOGITECH will not explain why the value can't be changed. It only
says, for example:

  Depends on: INPUT [=y] && HID [=y]

and that leaves the user puzzled about why the option is forced to y.
You might argue that this is a Kconfig bug, but that doesn't make it
less annoying for the user.

Even worse is that some of the sub-options of HID_LOGITECH select
INPUT_FF_MEMLESS, which in turn gets out of control for the user. So,
if you set INPUT=y and HID=y (something most general purpose
distributions would do these days, as both modules would get loaded on
a vast majority of systems otherwise), and you want support for
force-feedback game controllers, you can't have that as a module, it
has to be built-in, regardless of how rare these devices are.

Of course, all this madness goes away once EXPERT is enabled, but then
the rest of the kernel configuration becomes more complex, which
totally voids the original point.

For this reason, I would like all HID device tristate options to be
displayed regardless of EXPERT being set or not. We can let the
default settings still depend on EXPERT, that's not intrusive.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/huion-uclogic-merge' into for-next
Jiri Kosina [Mon, 16 Mar 2015 14:48:01 +0000 (15:48 +0100)]
Merge branch 'for-4.1/huion-uclogic-merge' into for-next

9 years agoHID: uclogic: make input_mapping independent of usb
Benjamin Tissoires [Sun, 15 Mar 2015 18:26:27 +0000 (14:26 -0400)]
HID: uclogic: make input_mapping independent of usb

No need to retrieve the USB handle in input_mapping() when we already
do that in probe. It also allows to use the quirk without having to
add the product ID matching.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Sun, 15 Mar 2015 14:11:41 +0000 (10:11 -0400)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: samples/hidraw: make it possible to select device
Pavel Machek [Sat, 14 Mar 2015 20:57:22 +0000 (21:57 +0100)]
HID: samples/hidraw: make it possible to select device

Makefile that can actually build the example, and allow selecting device to
work on.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Sun, 15 Mar 2015 14:05:30 +0000 (10:05 -0400)]
Merge branch 'for-4.0/upstream-fixes' into for-next

9 years agoHID: tivo: enable all buttons on the TiVo Slide Pro remote
Forest Wilkinson [Fri, 13 Mar 2015 06:58:16 +0000 (23:58 -0700)]
HID: tivo: enable all buttons on the TiVo Slide Pro remote

The linux kernel has supported the TiVo Slide remote control for some time, but
does not recognize the USB ID of the newer Slide Pro. This patch adds the
missing data structures so the newer remote will be recognized by the driver,
thereby allowing the TiVo, LiveTV, and Thumbs Up/Down buttons to be
mapped with a hwdb file.

Signed-off-by: Forest Wilkinson <web11.forest@tibit.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/multitouch' into for-next
Jiri Kosina [Thu, 12 Mar 2015 04:05:26 +0000 (00:05 -0400)]
Merge branch 'for-4.1/multitouch' into for-next

9 years agoHID: multitouch: Add support for button type usage
Seth Forshee [Wed, 11 Mar 2015 22:26:41 +0000 (17:26 -0500)]
HID: multitouch: Add support for button type usage

According to [1], Windows Precision Touchpad devices must supply
a button type usage in the device capabilities feature report. A
value of 0 indicates that the device contains a depressible
button (i.e. it's a click-pad) whereas a value of 1 indicates
a non-depressible button. Add support for this usage and set
INPUT_PROP_BUTTONPAD on the touchpad input device whenever a
depressible button is present.

[1] https://msdn.microsoft.com/en-us/library/windows/hardware/dn467314(v=vs.85).aspx

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Wed, 11 Mar 2015 17:51:59 +0000 (13:51 -0400)]
Merge branch 'for-4.1/wacom' into for-next

9 years agoHID: wacom: Add battery presence indicator to wireless tablets
Jason Gerecke [Wed, 11 Mar 2015 17:25:41 +0000 (10:25 -0700)]
HID: wacom: Add battery presence indicator to wireless tablets

Declare the POWER_SUPPLY_PROP_PRESENT property to provide userspace
with a way to determine if the battery on a wireless tablet is plugged
in. Although current wireless tablets do not explicitly report this
information, it can be inferred from other state information. In
particular, a battery is assumed to be present if any of the following
are true: a non-zero battery level reported, the battery is reported as
charging, or the tablet is operating wirelessly.

Note: The last condition above may not strictly hold for the Graphire
Wireless (it charges from a DC barrel jack instead of a USB port), but I
do not know what is reported in the no-battery condition.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Wed, 11 Mar 2015 16:13:43 +0000 (12:13 -0400)]
Merge branch 'for-4.0/upstream-fixes' into for-next

9 years agoHID: add ALWAYS_POLL quirk for a Logitech 0xc007
oliver@neukum.org [Tue, 10 Mar 2015 15:36:22 +0000 (16:36 +0100)]
HID: add ALWAYS_POLL quirk for a Logitech 0xc007

This device disconnects every 60s without X

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Wed, 11 Mar 2015 15:52:53 +0000 (11:52 -0400)]
Merge branch 'for-4.1/wacom' into for-next

Conflicts:
drivers/hid/wacom_wac.c

9 years agoHID: wacom: drop WACOM_PKGLEN_STATUS
Jiri Kosina [Wed, 11 Mar 2015 15:48:11 +0000 (11:48 -0400)]
HID: wacom: drop WACOM_PKGLEN_STATUS

The constant is not used (leftover from previous patch versions
that never got merged).

Reported-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Status packet provides 'charging', not 'powered' bit
Jason Gerecke [Fri, 6 Mar 2015 19:47:43 +0000 (11:47 -0800)]
HID: wacom: Status packet provides 'charging', not 'powered' bit

The status packet for tablets which can use a wireless module contains a
bit that is set if the battery is charging. This bit will be 0 if either
a battery is not present or if the battery has reached full charge. Note
that the charging circuit may continue to charge the battery for a short
time after reaching "100%".

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Report battery status for Intuos Pro and Intuos5
Jason Gerecke [Fri, 6 Mar 2015 19:47:42 +0000 (11:47 -0800)]
HID: wacom: Report battery status for Intuos Pro and Intuos5

Calls the wacom_status_irq function to report battery status for the
Intuos Pro and Intuos5 (in addition to the already-reporting Intuos
and last-generation Bamboo).

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Provide battery charge state to system over USB if available
Jason Gerecke [Fri, 6 Mar 2015 19:47:41 +0000 (11:47 -0800)]
HID: wacom: Provide battery charge state to system over USB if available

If a wireless adapter (which contains the charging circuitry) is
detected as being attached to the tablet then create a new battery
interface and update its status as data is reported. Also destroy the
battery if the adapter goes away.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Allow dynamic battery creation/destruction
Jason Gerecke [Fri, 6 Mar 2015 19:47:40 +0000 (11:47 -0800)]
HID: wacom: Allow dynamic battery creation/destruction

Tablets like the Intuos, Intuos Pro, and Bamboo have a connector for an
optional wireless module that can be connected on the fly. The presence
(or absence) of this module is indicated in a status report recieved
from the tablet. This patch adds a workqueue function that will create
or destroy a power_supply object at runtime to match the current state
of the WACOM_QUIRK_BATTERY flag.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Centralize updating of wacom_wac battery status
Jason Gerecke [Fri, 6 Mar 2015 19:47:39 +0000 (11:47 -0800)]
HID: wacom: Centralize updating of wacom_wac battery status

Has the 'wacom_notify_battery' function take on the job of detecting if
updating the power supply is necessary to remove multiple
nearly-identical 'if' blocks.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: Move handling of Intuos status packets to seperate function
Jason Gerecke [Fri, 6 Mar 2015 19:47:38 +0000 (11:47 -0800)]
HID: wacom: Move handling of Intuos status packets to seperate function

In addition to the touchswitch state for "Intuos", these packets are
also sent by the Intuos Pro, Intuos5, and last-generation Bamboo
tablets when using a wired connection. They contain, among other
things, information about the optional wireless module and battery
charge state (to be supported in subsuquent patches).

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/multitouch' into for-next
Jiri Kosina [Fri, 6 Mar 2015 21:55:30 +0000 (22:55 +0100)]
Merge branch 'for-4.1/multitouch' into for-next

9 years agoHID: multitouch: add support of clickpads
Benjamin Tissoires [Fri, 6 Mar 2015 16:14:42 +0000 (11:14 -0500)]
HID: multitouch: add support of clickpads

Touchpads that have only one button are called clickpads and should
be advertised as such by the kernel.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Wed, 4 Mar 2015 22:33:06 +0000 (23:33 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: map telephony usage page
Dmitry Torokhov [Wed, 4 Mar 2015 22:10:26 +0000 (14:10 -0800)]
HID: map telephony usage page

Currently HID code maps usages from telephony page into BTN_0, BTN_1, etc
keys which get interpreted by mousedev and userspace as left/right/middle
button clicks, which is not really helpful.

This change adds mappings for usages that have corresponding input event
definitions, and leaves the rest unmapped. This can be changed when
there are userspace consumers for more telephony usages.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/huion-uclogic-merge' into for-next
Jiri Kosina [Wed, 4 Mar 2015 16:33:34 +0000 (17:33 +0100)]
Merge branch 'for-4.1/huion-uclogic-merge' into for-next

9 years agoHID: Kconfig: add USB_HID dependency to UC-LOGIC
Benjamin Tissoires [Wed, 4 Mar 2015 16:24:55 +0000 (11:24 -0500)]
HID: Kconfig: add USB_HID dependency to UC-LOGIC

In commit 08177f4 (HID: uclogic: merge hid-huion driver in hid-uclogic)
HID_HUION depends explicitely on USB_HID because it contained quite some
USB-isms.

Now that hid-uclogic is the new home of Huion tablets, we need to also
add the dependency on USB_HID to this driver.

Reported-by: Jiri Kosina <jkosina@suse.cz>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/huion-uclogic-merge' into for-next
Jiri Kosina [Tue, 3 Mar 2015 20:33:22 +0000 (21:33 +0100)]
Merge branch 'for-4.1/huion-uclogic-merge' into for-next

9 years agoHID: uclogic: actually invert the in-range bit for huion tablets only
Benjamin Tissoires [Tue, 3 Mar 2015 17:44:05 +0000 (12:44 -0500)]
HID: uclogic: actually invert the in-range bit for huion tablets only

This hack is only needed for Huion tablets. It does not seem to have
any effect on the other tablets handled by this device right now, but
it's better to check for the product id sooner than discovering that
we have messed up one tablet later.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: uclogic: discard the extra Pen input node on Huion tablets
Benjamin Tissoires [Tue, 3 Mar 2015 17:44:04 +0000 (12:44 -0500)]
HID: uclogic: discard the extra Pen input node on Huion tablets

Some Huion tablets present 2 HID Pen interfaces. Only one is used, so
we can drop the unused one.

Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: uclogic: apply quirk NO_EMPTY_INPUT
Benjamin Tissoires [Tue, 3 Mar 2015 17:44:03 +0000 (12:44 -0500)]
HID: uclogic: apply quirk NO_EMPTY_INPUT

NO_EMPTY_INPUT is useful when MULTI_INPUT is set. It prevents to create
empty input nodes that user space does not know what to do with.

It does not seem to be required at the moment, this is just a preventive
patch. This check is only made during the plug of the device, so it does
not hurt to have it.

Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: uclogic: name the input nodes based on their tool
Benjamin Tissoires [Tue, 3 Mar 2015 17:44:02 +0000 (12:44 -0500)]
HID: uclogic: name the input nodes based on their tool

We append "Pen", "Pad", "Mouse", "Keyboard", "Consumer Control" or
"System Control" suffix to the appropriate input node to match what
the Wacom driver does and be more convenient for the user to know
which one is which.

Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: uclogic: merge hid-huion driver in hid-uclogic
Nikolai Kondrashov [Tue, 3 Mar 2015 17:44:01 +0000 (12:44 -0500)]
HID: uclogic: merge hid-huion driver in hid-uclogic

Merge the hid-huion driver into hid-uclogic as all the devices supported
by hid-huion are in fact UC-Logic devices.

Signed-off-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: uclogic: Set quirks from inside the driver
Benjamin Tissoires [Tue, 3 Mar 2015 17:44:00 +0000 (12:44 -0500)]
HID: uclogic: Set quirks from inside the driver

Based on a patch from: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

Most of the tablets handled by hid-uclogic already use MULTI_INPUT.
For the ones which are not quirked in usbhid/hidquirks, they have a
custom report descriptor which contains only one report per HID
interface. For those tablets HID_QUIRK_MULTI_INPUT is transparent.

According to https://github.com/DIGImend/tablets, the only problematic
tablet currently handled by hid-uclogic is the TWHA60 v3. This tablet
presents different report descriptors from the ones currently quirked.
This is not a problem per se, given that this tablet is not supported
currently in this version (it needs the same command as a Huion to
start forwarding events).

Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.0/upstream-fixes' into for-next
Jiri Kosina [Tue, 3 Mar 2015 12:01:42 +0000 (13:01 +0100)]
Merge branch 'for-4.0/upstream-fixes' into for-next

Conflicts:
drivers/hid/wacom_wac.c

9 years agoHID: wacom: rely on actual touch down count to decide touch_down
Ping Cheng [Fri, 20 Feb 2015 22:27:30 +0000 (14:27 -0800)]
HID: wacom: rely on actual touch down count to decide touch_down

touch_down is a flag to indicate if there are touches on tablet
or not. Since one set of touch events may be posted over more
than one data packet/touch frame, and pen may come in proximity
while touch events are partially sent, counting all touch events
for the set reflects the actual status of touch_down.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: do not send pen events before touch is up/forced out
Ping Cheng [Fri, 20 Feb 2015 22:25:58 +0000 (14:25 -0800)]
HID: wacom: do not send pen events before touch is up/forced out

If pen comes in proximity while touch is down, we force touch up
before sending pen events. Otherwise, there can be unfinished
touch events compete with pen events. This idea has been fully
implemented for Tablet PCs. But other tablets that support both
pen and touch are not fully considered.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Fri, 27 Feb 2015 07:39:27 +0000 (08:39 +0100)]
Merge branch 'for-4.1/wacom' into for-next

9 years agoHID: wacom: add full support of the Wacom Bamboo PAD
Benjamin Tissoires [Thu, 26 Feb 2015 16:28:50 +0000 (11:28 -0500)]
HID: wacom: add full support of the Wacom Bamboo PAD

The stylus of this device works just fine out of the box.
The touch is seen by default as a mouse with relative events and some
gestures.
The wireless and the wired version have slightly different firmwares, but
the debug mode 2 on the feature 2 is common to the 2 devices. In this mode,
all the reports are emitted through the debug interface (pen, raw touch
and mouse emulation), so we have to re-route manually the events.

We keep the Pen interface as a HID_GENERIC one because it works, and only
parse the raw touches while discarding the mouse emulation & gestures.

Switching the default in raw mode allows us to have a consistent user
experience accross all the multitouch touchpads (and enable the touch part
of the devices).

Note that the buttons of this devices are reported through the touch
interface. There is no 'Pad' interface. It seemed more natural to have
the BTN_LEFT and BTN_RIGHT reported with the touch because they are
placed under the touch interface and it looks like they belong to the
touch part.

Tested-by: Josep Sanchez Ferreres <josep.sanchez.ferreres@est.fib.upc.edu>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: wacom: store the hid_device pointers of the sibling devices
Benjamin Tissoires [Wed, 25 Feb 2015 16:43:39 +0000 (11:43 -0500)]
HID: wacom: store the hid_device pointers of the sibling devices

The Bamboo PAD in debug mode needs to re-route events from the debug
interface to the Pen interface. This can be easily done with
hid_input_report(), but that means that we need to keep a reference to
the various hid_devices.

There should be only one touch and one pen interface per physical tablet,
so there is no need to keep a list of hid-devices, plain pointers are
sufficient.

Tested-by: Josep Sanchez Ferreres <josep.sanchez.ferreres@est.fib.upc.edu>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Thu, 26 Feb 2015 23:38:01 +0000 (00:38 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: remove 2 unused usb.h includes
Benjamin Tissoires [Thu, 26 Feb 2015 18:39:48 +0000 (13:39 -0500)]
HID: remove 2 unused usb.h includes

These 2 are left over from the USB dependency cleaning, so there is
no need to keep them.

[jkosina@suse.cz: fix filename]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/rmi' into for-next
Jiri Kosina [Wed, 25 Feb 2015 14:46:26 +0000 (15:46 +0100)]
Merge branch 'for-4.1/rmi' into for-next

9 years agoHID: rmi: disable palm detect gesture when present
Andrew Duggan [Wed, 25 Feb 2015 01:36:50 +0000 (17:36 -0800)]
HID: rmi: disable palm detect gesture when present

A touchpad may have firmware based palm detection code enabled which
suppresses 2D data from being reported when the firmware believes a palm is
on the touchpad. This functionality is meant to be used in mouse mode without
a driver. When a driver is present, the driver can do a better job of
determining if a contact is a palm. If this gesture is enabled on a touchpad
operating in rmi mode then the firmware will not properly clear the palm detect
interrupt, causing the touchpad to interrupt indefinately. This patch disables
the palm detect gesture when the touchpad is operating in rmi mode.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: rmi: disable dribble packets on Synaptics touchpads
Andrew Duggan [Wed, 25 Feb 2015 01:36:49 +0000 (17:36 -0800)]
HID: rmi: disable dribble packets on Synaptics touchpads

When a finger is lifted from a Synaptics touchpad the firmware will continue
to interrupts for up to a second. These additional interrupts are know and
dribble interrupts. Since the data read from the touchpad does not change
the input subsystem only reports a single event. This makes the servicing of
dribble interrupts on Linux unnecessary. This patch simply disables dribble
interupts when configuring the touchpad.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: rmi: Add functions for writing to registers
Andrew Duggan [Wed, 25 Feb 2015 01:36:48 +0000 (17:36 -0800)]
HID: rmi: Add functions for writing to registers

Writing to registers is needed for setting configuration parameters.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/i2c-hid' into for-next
Jiri Kosina [Tue, 24 Feb 2015 20:00:16 +0000 (21:00 +0100)]
Merge branch 'for-4.1/i2c-hid' into for-next

Conflicts:
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
include/linux/hid-sensor-hub.h

9 years agoHID: i2c-hid: Add support for ACPI GPIO interrupts
Mika Westerberg [Mon, 23 Feb 2015 13:52:45 +0000 (15:52 +0200)]
HID: i2c-hid: Add support for ACPI GPIO interrupts

The HID over I2C specification allows to have the interrupt for a HID
device to be GPIO instead of directly connected to the IO-APIC.

Add support for this so that when the driver does not find proper interrupt
number from the I2C client structure we check if it has ACPI GpioInt()
resource listed in _CRS. If it is found we convert it to an interrupt
number and use it instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Tue, 24 Feb 2015 16:25:44 +0000 (08:25 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

 - a few fixes to Sony driver (rmmod breakage, spinlock initialization),
   by Antonio Ospite, Frank Praznik and Jiri Kosina

 - fix for wMaxInputLength handling regression in i2c-hid, by Seth
   Forshee

 - IRQ safety spinlock fix in sensor hub driver, by Srinivas Pandruvada

 - IRQ level sensitivity fix to i2c-hid to be compliant with the spec,
   by Mika Westerberg

 - a couple device ID additions piggy-backing on top of that

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: microsoft: Add ID for NE7K wireless keyboard
  HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events
  HID: sony: fix uninitialized per-controller spinlock
  HID: sony: initialize sony_dev_list_lock properly
  HID: sony: Fix a WARNING shown when rmmod-ing the driver
  HID: sensor-hub: correct dyn_callback_lock IRQ-safe change
  HID: hid-sensor-hub: Correct documentation
  HID: saitek: add USB ID for older R.A.T. 7
  HID: i2c-hid: The interrupt should be level sensitive
  HID: wacom: Add missing ABS_MISC event and feature declaration for 27QHD

9 years agoMerge branch 'for-4.1/wacom' into for-next
Jiri Kosina [Tue, 24 Feb 2015 10:30:32 +0000 (11:30 +0100)]
Merge branch 'for-4.1/wacom' into for-next

9 years agoHID: wacom: Add support for I2C connected devices
Mika Westerberg [Mon, 23 Feb 2015 13:52:43 +0000 (15:52 +0200)]
HID: wacom: Add support for I2C connected devices

Lenovo Thinkpad 10 has wacom digitizer connected as a I2C-HID device. Add
generic support for this.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/upstream' into for-next
Jiri Kosina [Mon, 23 Feb 2015 15:17:45 +0000 (16:17 +0100)]
Merge branch 'for-4.1/upstream' into for-next

9 years agoHID: expose country code in sysfs
Olivier Gay [Tue, 17 Feb 2015 13:00:03 +0000 (14:00 +0100)]
HID: expose country code in sysfs

This commit exposes in sysfs the HID country code that is stored in the country
member of hid_device structure. It identifies the country code of localized
hardware.

For example some keyboards use it to exhibit the language of the key layout. It
helps the upper layer to identify the localized hardware and setup the correct
language to use.

For USB HID devices the country code comes for the HID descriptor and for
Bluetooth HID devices it is the HIDCountryCode attribute from the SDP database.

Signed-off-by: Olivier Gay <ogay@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: microsoft: Add ID for NE7K wireless keyboard
Jakub Sitnicki [Sat, 21 Feb 2015 19:51:08 +0000 (20:51 +0100)]
HID: microsoft: Add ID for NE7K wireless keyboard

Microsoft Natural Wireless Ergonomic Keyboard 7000 has special My
Favorites 1..5 keys which are handled through a vendor-defined usage
page (0xff05).

Apply MS_ERGONOMY quirks handling to USB PID 0x071d (Microsoft Microsoft
2.4GHz Transceiver V1.0) so that the My Favorites 1..5 keys are reported
as KEY_F14..18 events.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=52841
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branch 'for-4.1/sensor-hub' into for-next
Jiri Kosina [Mon, 23 Feb 2015 14:20:50 +0000 (15:20 +0100)]
Merge branch 'for-4.1/sensor-hub' into for-next

9 years agoHID: hid-sensor-hub: Enhance feature report set API
Srinivas Pandruvada [Thu, 19 Feb 2015 23:35:26 +0000 (15:35 -0800)]
HID: hid-sensor-hub: Enhance feature report set API

Current API only allows setting one offset in the field. This API
is extended to set multiple offsets in the field report.
Also update parameters in the users of this API.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: hid-sensor-hub: Enhance get feature report API
Srinivas Pandruvada [Thu, 19 Feb 2015 23:35:25 +0000 (15:35 -0800)]
HID: hid-sensor-hub: Enhance get feature report API

Some hid sensor feature report can contain more than one reports.
This API can now support receiving multiple values from the feature
report.
Also update the parameters in the users of this API.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: hid-sensor-hub: Extend API for async reads
Srinivas Pandruvada [Thu, 19 Feb 2015 23:33:56 +0000 (15:33 -0800)]
HID: hid-sensor-hub: Extend API for async reads

Add additional flag to read in async mode. In this mode the caller will get
reply via registered callback for capture_sample. Callbacks can be registered
using sensor_hub_register_callback function. The usage id parameter of the
capture_sample can be matched with the usage id of the requested attribute.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: hid-sensor-hub: Add support for application collection
Srinivas Pandruvada [Thu, 19 Feb 2015 23:31:26 +0000 (15:31 -0800)]
HID: hid-sensor-hub: Add support for application collection

Section 4.2.5 of HID Sensor hub specification allows two methods
defining sensor devices.
- Each sensor device by its own collection
- A top level application collection object, including multiple
sensors.
In the first method, each sensor can be in its own sensor application
collection without a physical collection.
In the second method there is a usage id for collection type, which
is defined as an application collection, with multiple physical
collections in it. It is possible to define fusion sensor with this
and may have its own handler. If there is a callback registered
for the collection type, then forward all reports for sensors in
its collection to this handler.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: hid-sensor-hub: Allow parallel synchronous reads
Srinivas Pandruvada [Thu, 19 Feb 2015 23:31:25 +0000 (15:31 -0800)]
HID: hid-sensor-hub: Allow parallel synchronous reads

Current implementation only allows one outstanding synchronous read.
This is a performance hit when user mode is requesting raw reads
of sensor attributes on multiple sensors together.
This change changes the mutex lock to per hid sensor hub device instead
of global lock. Although request to hid sensor hub is serialized, there
can be multiple outstanding read requests pending for responses via
hid reports.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: i2c-hid: Limit reads to wMaxInputLength bytes for input events
Seth Forshee [Fri, 20 Feb 2015 17:45:11 +0000 (11:45 -0600)]
HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events

d1c7e29e8d27 (HID: i2c-hid: prevent buffer overflow in early IRQ)
changed hid_get_input() to read ihid->bufsize bytes, which can be
more than wMaxInputLength. This is the case with the Dell XPS 13
9343, and it is causing events to be missed. In some cases the
missed events are releases, which can cause the cursor to jump or
freeze, among other problems. Limit the number of bytes read to
min(wMaxInputLength, ihid->bufsize) to prevent such problems.

Fixes: d1c7e29e8d27 "HID: i2c-hid: prevent buffer overflow in early IRQ"
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoHID: sony: fix uninitialized per-controller spinlock
Frank Praznik [Mon, 23 Feb 2015 01:42:46 +0000 (20:42 -0500)]
HID: sony: fix uninitialized per-controller spinlock

Per-controller spinlock needs to be properly initialized during device probe.

[jkosina@suse.cz: massage changelog]
[jkosina@suse.cz: drop hunk that has already been applied by previous
 patch]
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoMerge branches 'for-4.1/genius', 'for-4.1/logitech', 'for-4.1/rmi', 'for-4.1/sony...
Jiri Kosina [Mon, 23 Feb 2015 10:28:12 +0000 (11:28 +0100)]
Merge branches 'for-4.1/genius', 'for-4.1/logitech', 'for-4.1/rmi', 'for-4.1/sony' and 'for-4.1/wacom' into for-next

9 years agoHID: sony: initialize sony_dev_list_lock properly
Jiri Kosina [Mon, 23 Feb 2015 10:15:44 +0000 (11:15 +0100)]
HID: sony: initialize sony_dev_list_lock properly

sony_dev_list_lock spinlock (which was introduced in d2d782fccee ("HID: sony:
Prevent duplicate controller connections") is not being initialized properly.
Fix that.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>