]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Tue, 1 Apr 2014 16:46:15 +0000 (18:46 +0200)]
Merge branch 'for-3.15/sony' into for-next

10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sony
Jiri Kosina [Tue, 1 Apr 2014 16:45:27 +0000 (18:45 +0200)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sony

10 years agoHID: sony: Set the quriks flag for Bluetooth controllers
Frank Praznik [Sat, 15 Mar 2014 13:41:16 +0000 (09:41 -0400)]
HID: sony: Set the quriks flag for Bluetooth controllers

The Sixaxis and DualShock 4 want HID output reports sent on the control
endpoint when connected via Bluetooth.  Set the
HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP flag for these devices so hidraw write()
works properly.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Fix Sixaxis cable state detection
Frank Praznik [Sat, 15 Mar 2014 13:41:15 +0000 (09:41 -0400)]
HID: sony: Fix Sixaxis cable state detection

Byte 31 of the Sixaxis report can change depending on whether or not the
controller is rumbling.  Using bit 3 is the only reliable way to detect the
state of the cable regardless of rumble activity.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/uhid' into for-next
Jiri Kosina [Tue, 1 Apr 2014 16:29:00 +0000 (18:29 +0200)]
Merge branch 'for-3.15/uhid' into for-next

10 years agoHID: uhid: Add UHID_CREATE2 + UHID_INPUT2
Petri Gynther [Mon, 24 Mar 2014 20:50:01 +0000 (13:50 -0700)]
HID: uhid: Add UHID_CREATE2 + UHID_INPUT2

UHID_CREATE2:
HID report descriptor data (rd_data) is an array in struct uhid_create2_req,
instead of a pointer. Enables use from languages that don't support pointers,
e.g. Python.

UHID_INPUT2:
Data array is the last field of struct uhid_input2_req. Enables userspace to
write only the required bytes to kernel (ev.type + ev.u.input2.size + the part
of the data array that matters), instead of the entire struct uhid_input2_req.

Note:
UHID_CREATE2 increases the total size of struct uhid_event slightly, thus
increasing the size of messages that are queued for userspace. However, this
won't affect the userspace processing of these events.

[Jiri Kosina <jkosina@suse.cz>: adjust to hid_get_raw_report() and
hid_output_raw_report() API changes]

Signed-off-by: Petri Gynther <pgynther@google.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next
Jiri Kosina [Sat, 29 Mar 2014 01:41:57 +0000 (18:41 -0700)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next

10 years agoHID: hyperv: fix _raw_request() prototype
Jiri Kosina [Sat, 29 Mar 2014 01:40:42 +0000 (18:40 -0700)]
HID: hyperv: fix _raw_request() prototype

The 3rd argument is pointer to the buffer, not a single __u8.
This has no bad sideeffect, as the stub is not using any of its
argument, but better have it correct.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: hyperv: Implement a stub raw_request() entry point
K. Y. Srinivasan [Sat, 29 Mar 2014 00:41:27 +0000 (17:41 -0700)]
HID: hyperv: Implement a stub raw_request() entry point

commit 3c86726cfe38 ("HID: make .raw_request mandatory") made .raw_request
mandatory and broke the Hyper-V mouse driver. This patch fixes the problem.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/multitouch' into for-next
Jiri Kosina [Thu, 20 Mar 2014 09:02:15 +0000 (10:02 +0100)]
Merge branch 'for-3.15/multitouch' into for-next

10 years agoHID: multitouch: add support for Win 8.1 multitouch touchpads
Andrew Duggan [Wed, 19 Mar 2014 20:39:03 +0000 (13:39 -0700)]
HID: multitouch: add support for Win 8.1 multitouch touchpads

Multitouch touchpads built for Win 8.1 need to be sent an input mode feature report
in order to start reporting multitouch events. This is the same process sent
to Win 7 multitouch touchscreens except the value of the feature report is 3 for
touchpads.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next
Jiri Kosina [Fri, 14 Mar 2014 14:33:07 +0000 (15:33 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next

10 years agoHID: remove hid_output_raw_report transport implementations
Benjamin Tissoires [Sun, 9 Mar 2014 03:52:43 +0000 (22:52 -0500)]
HID: remove hid_output_raw_report transport implementations

Nobody calls hid_output_raw_report anymore, and nobody should.
We can now remove the various implementation in the different
transport drivers and the declarations.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: do not rely on hid_output_raw_report
Benjamin Tissoires [Sun, 9 Mar 2014 03:52:42 +0000 (22:52 -0500)]
HID: sony: do not rely on hid_output_raw_report

hid_out_raw_report is going to be obsoleted as it is not part of the
unified HID low level transport documentation
(Documentation/hid/hid-transport.txt)

To do so, we need to introduce two new quirks:
* HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP: this quirks prevents the
  transport driver to use the interrupt channel to send output report
  (and thus force to use HID_REQ_SET_REPORT command)
* HID_QUIRK_SKIP_OUTPUT_REPORT_ID: this one forces usbhid to not
  include the report ID in the buffer it sends to the device through
  HID_REQ_SET_REPORT in case of an output report

This also fixes a regression introduced in commit 3a75b24949a8
(HID: hidraw: replace hid_output_raw_report() calls by appropriates ones).
The hidraw API was not able to communicate with the PS3 SixAxis
controllers in USB mode.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-3.15/hid-core-ll-transport-cleanup
Jiri Kosina [Fri, 14 Mar 2014 14:30:16 +0000 (15:30 +0100)]
Merge branch 'for-3.15/sony' into for-3.15/hid-core-ll-transport-cleanup

10 years agoHID: cp2112: remove the last hid_output_raw_report() call
Benjamin Tissoires [Sun, 9 Mar 2014 03:52:41 +0000 (22:52 -0500)]
HID: cp2112: remove the last hid_output_raw_report() call

tests have shown that output reports use hid_hw_output_report().

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: cp2112: remove various hid_out_raw_report calls
Benjamin Tissoires [Sun, 9 Mar 2014 03:52:40 +0000 (22:52 -0500)]
HID: cp2112: remove various hid_out_raw_report calls

hid_out_raw_report is going to be obsoleted as it is not part of the
unified HID low level transport documentation
(Documentation/hid/hid-transport.txt)

  hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
is strictly equivalent to:
  hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);

Then replace buf[0] by the appropriate define.

So use the new api.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-cp2112' into for-3.15/hid-core-ll-transport-cleanup
Jiri Kosina [Fri, 14 Mar 2014 14:27:36 +0000 (15:27 +0100)]
Merge branch 'for-3.15/hid-cp2112' into for-3.15/hid-core-ll-transport-cleanup

10 years agoMerge branch 'for-3.15/multitouch' into for-next
Jiri Kosina [Wed, 5 Mar 2014 13:30:18 +0000 (14:30 +0100)]
Merge branch 'for-3.15/multitouch' into for-next

10 years agoHID: multitouch: add support of other generic collections in hid-mt
Benjamin Tissoires [Fri, 28 Feb 2014 16:41:25 +0000 (11:41 -0500)]
HID: multitouch: add support of other generic collections in hid-mt

The ANTON Touch Pad is a device which can switch from a multitouch
touchpad to a mouse. It thus presents several generic collections which
are currently ignored by hid-multitouch. Enable them by not ignoring
them in mt_input_mapping.
Adding also a suffix for them depending on their application.

Reported-by: Edel Maks <edelmaks@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: multitouch: remove pen special handling
Benjamin Tissoires [Fri, 28 Feb 2014 16:41:24 +0000 (11:41 -0500)]
HID: multitouch: remove pen special handling

Pens have a special handling in hid-mt as hybrid pen/touch devices
are quite common now. However, some fancy devices presents also
useful collections like mouse or keyboard.
The special case for the pen may not be a special case, and treat it as
a generic case.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: multitouch: remove registered devices with default behavior
Benjamin Tissoires [Fri, 28 Feb 2014 16:41:23 +0000 (11:41 -0500)]
HID: multitouch: remove registered devices with default behavior

The default multitouch protocol class in use since the kernel v3.9 is
working quite well. Since its inclusion, the only devices we had to tweak
were those who really need quirks (GeneralTouch, FocalTech and Wistron,
the 3 of them are Win 7 certified ones).
The flow of new unhandled devices has stopped, which is great and I think
it's time to reduce the list of registered device.

This commit removes only the registration in the kernel of devices that
use the class MT_CLS_DEFAULT, or that can use it. By that, I mean that I
checked all the recordings I have, and the produced input device and
events are the same before and after applying the patch.

This gives two benefits:
- remove a bunch of lines of codes
- prevent bad handling of existing registered devices which are using a
different protocol while using the same VID/PID (I got the case of a
Quanta 3008 recently).

I also removed the associated classes (MT_CLS*). I kept their #define in
case people use the new_id sysfs node with a non standard class (their
should be really few people now, but we never now). This is why there
are /* reserved .... */.

Last, I add a comment on top of mt_devices[] definition to remember people
(and myself) not to include devices for the beauty of it.

To people still trying to add devices with the default class:
"""
Guys, try out your device under a kernel greater or equal to v3.9. If it
works, you are all set. Adding your VID/PID to the kernel only brings us
overload and you won't get anything from it _because_ even a backport of
this shiny patch will _not_ make the device work under 3.0, 3.2, 3.4 or
even 3.8.
So if it works, it works.
If it does not work, then yes, submit a patch or call for help.
In any cases, if you want me to do regression tests, I'd be happy to
get some traces of your device. But I won't patch the kernel if it works.
"""

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Mon, 24 Feb 2014 16:39:58 +0000 (17:39 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: hidp: Add a comment that some devices depend on the current behavior of uniq
Frank Praznik [Thu, 20 Feb 2014 16:36:04 +0000 (11:36 -0500)]
HID: hidp: Add a comment that some devices depend on the current behavior of uniq

Add a comment noting that some devices depend on the destination address being
stored in uniq.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Prevent duplicate controller connections.
Frank Praznik [Thu, 20 Feb 2014 16:36:03 +0000 (11:36 -0500)]
HID: sony: Prevent duplicate controller connections.

If a Sixaxis or Dualshock 4 controller is connected via USB while already
connected via Bluetooth it will cause duplicate devices to be added to the
input device list.

To prevent this a global list of controllers and their MAC addresses is
maintained and new controllers are checked against this list.  If a duplicate
is found, the probe function will exit with -EEXIST.

On USB the MAC is retrieved via a feature report.  On Bluetooth neither
controller reports the MAC address in a feature report so the MAC is parsed from
the uniq string.  As uniq cannot be guaranteed to be a MAC address in every case
(uHID or the behavior of HIDP changing) a parsing failure will not prevent the
connection.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Perform a boundry check on the sixaxis battery level index.
Frank Praznik [Thu, 20 Feb 2014 16:36:02 +0000 (11:36 -0500)]
HID: sony: Perform a boundry check on the sixaxis battery level index.

Make sure that an out-of-bounds read doesn't occur in the Sixaxis battery level
lookup table in the event that the controller sends an invalid battery status
value in the report.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Fix work queue issues
Frank Praznik [Thu, 20 Feb 2014 16:36:01 +0000 (11:36 -0500)]
HID: sony: Fix work queue issues

Only initialize force feedback for devices that actually support it (Sixaxis and
Dualshock 4) to prevent calls to schedule_work() with an uninitialized work
queue.

Move the cancel_work_sync() call out of sony_destroy_ff() since the state worker
is used for the LEDs even when force-feedback is disabled.

Remove the sony_destroy_ff() function since it is no longer used.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Fix multi-line comment styling
Frank Praznik [Thu, 20 Feb 2014 16:36:00 +0000 (11:36 -0500)]
HID: sony: Fix multi-line comment styling

Convert multi-line comments to comply with the kernel coding style.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next
Jiri Kosina [Mon, 24 Feb 2014 16:24:11 +0000 (17:24 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next

10 years agoHID: hidraw: replace hid_output_raw_report() calls by appropriates ones
Benjamin Tissoires [Thu, 20 Feb 2014 20:24:50 +0000 (15:24 -0500)]
HID: hidraw: replace hid_output_raw_report() calls by appropriates ones

Remove hid_output_raw_report() call as it is not a ll_driver callbacj,
and switch to the hid_hw_* implementation. USB-HID used to fallback
into SET_REPORT when there were no output interrupt endpoint,
so emulating this if hid_hw_output_report() returns -ENOSYS.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: make .raw_request mandatory
Benjamin Tissoires [Thu, 20 Feb 2014 20:24:49 +0000 (15:24 -0500)]
HID: make .raw_request mandatory

SET_REPORT and GET_REPORT are mandatory in the HID specification.
Make the corresponding API in hid-core mandatory too, which removes the
need to test against it in some various places.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: input: hid-input remove hid_output_raw_report call
Benjamin Tissoires [Thu, 20 Feb 2014 20:24:48 +0000 (15:24 -0500)]
HID: input: hid-input remove hid_output_raw_report call

hid_output_raw_report() is not a ll_driver callback and should not be used.
To keep the same code path than before, we are forced to play with the
different hid_hw_* calls: if the usb or i2c device does not support
direct output reports, then we will rely on the SET_REPORT HID call.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Thu, 20 Feb 2014 13:15:13 +0000 (14:15 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: sony: Enable LED controls and rumble for the Sixaxis on Bluetooth.
Frank Praznik [Tue, 18 Feb 2014 22:22:01 +0000 (17:22 -0500)]
HID: sony: Enable LED controls and rumble for the Sixaxis on Bluetooth.

Add a SIXAXIS_CONTROLLER macro to simplify conditionals where the
connection type is irrelevant.

Enable the LED and force feedback controls for Sixaxis controllers connected via
Bluetooth.

Send Sixaxis Bluetooth output reports on the control channel.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-cp2112' into for-next
Jiri Kosina [Tue, 18 Feb 2014 08:56:21 +0000 (09:56 +0100)]
Merge branch 'for-3.15/hid-cp2112' into for-next

10 years agoHID: cp2112: fix incorrect error propagation in cp2112_xfer()
Jiri Kosina [Tue, 18 Feb 2014 08:43:53 +0000 (09:43 +0100)]
HID: cp2112: fix incorrect error propagation in cp2112_xfer()

Both cp2112_read_req() and cp2112_write_req() are returning negative
value in cases of error, but cp2112_xfer() is storing the return
value into unsigned size_t-typed 'count'.

Fix this by making 'count' signed type.

Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: cp2112: can't be used without gpio support
Jiri Kosina [Tue, 18 Feb 2014 08:40:17 +0000 (09:40 +0100)]
HID: cp2112: can't be used without gpio support

Add Kconfig driver dependency on GPIOLIB.

Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-cp2112' into for-next
Jiri Kosina [Mon, 17 Feb 2014 23:41:44 +0000 (00:41 +0100)]
Merge branch 'for-3.15/hid-cp2112' into for-next

10 years agoHID: cp2112: convert to use hid_hw_raw_request()
Jiri Kosina [Mon, 17 Feb 2014 23:39:39 +0000 (00:39 +0100)]
HID: cp2112: convert to use hid_hw_raw_request()

Commit cafebc0 ("HID: remove hid_get_raw_report in struct hid_device")
obsoletes the use of hdev->hid_get_raw_report(), as calling
hid_hw_raw_request() is functionally equivalent.

Convert cp2112 to use this notation.

Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/hid-cp2112
Jiri Kosina [Mon, 17 Feb 2014 23:37:07 +0000 (00:37 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/hid-cp2112

10 years agoMerge branch 'for-3.15/hid-cp2112' into for-next
Jiri Kosina [Mon, 17 Feb 2014 22:45:47 +0000 (23:45 +0100)]
Merge branch 'for-3.15/hid-cp2112' into for-next

10 years agoHID: cp2112: use proper specifier for size_t
Jiri Kosina [Mon, 17 Feb 2014 22:44:54 +0000 (23:44 +0100)]
HID: cp2112: use proper specifier for size_t

%zd is a proper format string specifier for size_t

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: cp2112: make sysfs attributes static
Jiri Kosina [Mon, 17 Feb 2014 22:40:20 +0000 (23:40 +0100)]
HID: cp2112: make sysfs attributes static

No need to pollute namespace with dev_attr_*.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-cp2112' into for-next
Jiri Kosina [Mon, 17 Feb 2014 22:33:53 +0000 (23:33 +0100)]
Merge branch 'for-3.15/hid-cp2112' into for-next

10 years agoHID: add hid-cp2112 driver
David Barksdale [Tue, 4 Feb 2014 18:42:48 +0000 (12:42 -0600)]
HID: add hid-cp2112 driver

This patch adds support for the Silicon Labs CP2112 "Single-Chip HID USB to
SMBus Master Bridge."

This is a HID device driver which registers as an i2c adapter and gpiochip to
expose these functions of the CP2112. The customizable USB descriptor fields
are exposed as sysfs attributes.  The SMBus byte-read, byte-data-read/write,
and word-data-read transfer modes have been tested by talking to an i2c
sensor.  The GPIO functions and USB descriptor field programming have also
been tested.

Signed-off-by: David Barksdale <dbarksdale@uplogix.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Mon, 17 Feb 2014 22:18:12 +0000 (23:18 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: sony: Correct Sixaxis battery reporting
Frank Praznik [Sat, 15 Feb 2014 18:35:42 +0000 (13:35 -0500)]
HID: sony: Correct Sixaxis battery reporting

The battery_charging and cable_state flags were backwards on the Sixaxis.
The low bit of report byte 30 is 0 when charging and 1 when not.
Bit 5 of byte 31 is 0 when a USB cable is connected and 1 when not.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-sensor-hub' into for-next
Jiri Kosina [Mon, 17 Feb 2014 16:14:57 +0000 (17:14 +0100)]
Merge branch 'for-3.15/hid-sensor-hub' into for-next

10 years agoHID: hid-sensor-hub: Processing for duplicate physical ids
Srinivas Pandruvada [Fri, 31 Jan 2014 20:04:10 +0000 (12:04 -0800)]
HID: hid-sensor-hub: Processing for duplicate physical ids

In HID sensor hub, HID physical ids are used to represent different sensors.
For example physical id of 0x73 in usage page = 0x20, represents an
accelerometer. The HID sensor hub driver uses this physical ids to create
platform devices using MFD. There is 1:1 correspondence between an phy id and a
client driver.

But in some cases these physical ids are reused. There is a phy id 0xe1, which
specifies a custom sensor, which can exist multiple times to represent various
custom sensors. In this case there can be multiple instances of client MFD
drivers, processing specific custom sensor. In this case when client driver
looks for report id or a field index, it should still get the report id
specific to its own type. This is also true for reports, they should be
directed towards correct instance.  This change introduce a way to parse and
tie physical devices to their correct instance.

Summary of changes:
- To get physical ids, use collections. If a collection of type=physical
  exist then use usage id as in the name of platform device name
- As part of the platform data, we assign a hdsev instance, which has
  start and end of collection indexes. Using these indexes attributes
  can be tied to correct MFD client instances
- When a report is received, call callback with correct hsdev instance.
  In this way using its private data stored as part of its registry, it
  can distinguish different sensors even when they have same physical and
  logical ids.

  This patch is co-authored with Archana Patni <archna.patni@intel.com>.

Reported-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-sensor-hub' into for-next
Jiri Kosina [Mon, 17 Feb 2014 14:10:33 +0000 (15:10 +0100)]
Merge branch 'for-3.15/hid-sensor-hub' into for-next

10 years agoiio: hid-sensor-hub: Remove hard coded indexes
Srinivas Pandruvada [Fri, 24 Jan 2014 02:50:22 +0000 (18:50 -0800)]
iio: hid-sensor-hub: Remove hard coded indexes

Remove the hard coded indexes, instead search for usage id and
use the index to set the power and report state.
This will fix issue, where the report descriptor doesn't contain
the full list of possible selector for power and report state.

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>
10 years agoHID: hid-sensor-hub: Add selector api
Srinivas Pandruvada [Fri, 24 Jan 2014 02:50:21 +0000 (18:50 -0800)]
HID: hid-sensor-hub: Add selector api

In some report descriptors, they leave holes in the selectors. In
this case if we use hardcoded selector values, this will result
in invalid values. For example, if there is selectors defined for
Power State from OFF to D0 to D3. We can't use indexes of these states
if some states are not implemented or not present in the report decriptors.
In this case, we need to get the indexes from report descriptors.

One API is added to get the index of a selector. This API will
search for usage id in the field usage list and return the index.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next
Jiri Kosina [Mon, 17 Feb 2014 13:59:29 +0000 (14:59 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next

10 years agoHID: core: check parameters when sending/receiving data from the device
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:59 +0000 (12:58 -0500)]
HID: core: check parameters when sending/receiving data from the device

It is better to check them soon enough before triggering any kernel panic.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: wiimote: replace hid_output_raw_report with hid_hw_output_report for output...
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:55 +0000 (12:58 -0500)]
HID: wiimote: replace hid_output_raw_report with hid_hw_output_report for output requests

For BT transport layer,
  ret = hid_output_raw_report(A, B, C, HID_OUTPUT_REPORT);
is equivalent to
  ret = hid_hw_output_report(A, B, C);

So use the new API where available

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: replace hid_output_raw_report with hid_hw_raw_request for feature requests
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:54 +0000 (12:58 -0500)]
HID: replace hid_output_raw_report with hid_hw_raw_request for feature requests

  ret = hid_output_raw_report(A, B, C, HID_FEATURE_REPORT);
is equivalent to
  ret = hid_hw_raw_request(A, B[0], B, C, HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
whatever the transport layer is.

So use the new API where available

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: logitech-dj: remove hid_output_raw_report call
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:53 +0000 (12:58 -0500)]
HID: logitech-dj: remove hid_output_raw_report call

hid-input do not use anymore hid_output_raw_report() to set the LEDs.
Use the correct implementation now and make them working again.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: usbhid: change return error of usbhid_output_report
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:51 +0000 (12:58 -0500)]
HID: usbhid: change return error of usbhid_output_report

If there is no urbout when sending a output report, ENOSYS (Function
not implemented) is a better error than EIO (I/O error).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: i2c-hid: use generic .request() implementation
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:50 +0000 (12:58 -0500)]
HID: i2c-hid: use generic .request() implementation

Having our own .request() implementation does not give anything,
so use the generic binding.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: i2c-hid: implement ll_driver transport-layer callbacks
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:49 +0000 (12:58 -0500)]
HID: i2c-hid: implement ll_driver transport-layer callbacks

Add output_report and raw_request to i2c-hid.
The current implementation of i2c_hid_output_raw_report decides
by itself if it should use a direct send of the output report
or use the data register (SET_REPORT). Split that by reimplement
the logic in __i2c_hid_output_raw_report() which will be dropped
soon.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: core: implement generic .request()
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:48 +0000 (12:58 -0500)]
HID: core: implement generic .request()

.request() can be emulated through .raw_request()
we can implement this emulation in hid-core, and make .request
not mandatory for transport layer drivers.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: uHID: implement .raw_request
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:47 +0000 (12:58 -0500)]
HID: uHID: implement .raw_request

uHID is missing a SET_REPORT protocol implementation, but as
.hid_get_raw_report() as been removed from struct hid_device,
there were no means to access GET_REPORT in uhid.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: uhid: reintroduce uhid_hid_get_raw()
Jiri Kosina [Mon, 17 Feb 2014 13:49:34 +0000 (14:49 +0100)]
HID: uhid: reintroduce uhid_hid_get_raw()

This reverts commit 4a76d370f0c0508b5d6580d15eae3d40b47d837c. Removing
it was a mistake, as we need a means to access GET_REPORT.

Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: uHID: remove duplicated code
Benjamin Tissoires [Mon, 10 Feb 2014 17:58:46 +0000 (12:58 -0500)]
HID: uHID: remove duplicated code

uhid_hid_output_report() can be implemented through a simple call
to uhid_hid_output_raw().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next
Jiri Kosina [Mon, 17 Feb 2014 13:18:03 +0000 (14:18 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-next

10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Mon, 17 Feb 2014 13:17:48 +0000 (14:17 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: uhid: remove uhid_hid_get_raw()
Jiri Kosina [Mon, 17 Feb 2014 13:15:48 +0000 (14:15 +0100)]
HID: uhid: remove uhid_hid_get_raw()

This function is now unused since cafebc058bf8 ("HID: remove
hid_get_raw_report in struct hid_device").

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Add conditionals to enable all features in Bluetooth mode
Frank Praznik [Thu, 6 Feb 2014 01:03:49 +0000 (20:03 -0500)]
HID: sony: Add conditionals to enable all features in Bluetooth mode

Add the conditionals to enable rumble, battery reporting, LED and touchpad
support for the Dualshock 4 in Bluetooth mode.

Add dualshock4_set_operational_bt to initialize the controller to the proper
operational state.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Set initial battery level to 100% to avoid false low battery warnings
Frank Praznik [Thu, 6 Feb 2014 01:03:48 +0000 (20:03 -0500)]
HID: sony: Set initial battery level to 100% to avoid false low battery warnings

Set the initial battery level to 100% to avoid false low battery warnings if
the battery state is polled before a report with the actual battery level is
received.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Add Dualshock 4 Bluetooth battery and touchpad parsing
Frank Praznik [Thu, 6 Feb 2014 01:03:47 +0000 (20:03 -0500)]
HID: sony: Add Dualshock 4 Bluetooth battery and touchpad parsing

Add Dualshock 4 battery and touchpad parsing for Bluetooth reports.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Add Dualshock 4 Bluetooth output report formatting
Frank Praznik [Thu, 6 Feb 2014 01:03:46 +0000 (20:03 -0500)]
HID: sony: Add Dualshock 4 Bluetooth output report formatting

Add formating for the Dualshock 4 output report data in Bluetooth mode.

In Bluetooth mode the Dualshock 4 wants output reports sent on the control
channel.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Add modified Dualshock 4 Bluetooth HID descriptor
Frank Praznik [Thu, 6 Feb 2014 01:03:45 +0000 (20:03 -0500)]
HID: sony: Add modified Dualshock 4 Bluetooth HID descriptor

By default, the Dualshock 4 sends controller data via report 1. Once a valid
output report 0x11 is received or a feature report of type 0x02 is requested the
controller changes from sending data in report 1 to sending data in report 17,
which is unmapped in the default descriptor. The mappings have to be moved to
report 17 to let the HID driver properly process the incoming reports.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: sony: Use low-level transport driver functions
Frank Praznik [Thu, 6 Feb 2014 01:03:44 +0000 (20:03 -0500)]
HID: sony: Use low-level transport driver functions

Switch to the low-level transport driver functions.

sony_set_output_report is removed since it is no longer used.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sony
Jiri Kosina [Mon, 17 Feb 2014 13:07:35 +0000 (14:07 +0100)]
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sony

10 years agoHID: Add HID transport driver documentation
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:24 +0000 (16:33 -0500)]
HID: Add HID transport driver documentation

Add David Herrmann's documentation for the new low-level HID transport driver
functions.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: introduce helper to access hid_output_raw_report()
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:23 +0000 (16:33 -0500)]
HID: introduce helper to access hid_output_raw_report()

Add a helper to access hdev->hid_output_raw_report().

To convert the drivers, use the following snippets:

for i in drivers/hid/*.c
do
  sed -i.bak "s/[^ \t]*->hid_output_raw_report(/hid_output_raw_report(/g" $i
done

Then manually fix for checkpatch.pl

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: remove hid_get_raw_report in struct hid_device
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:22 +0000 (16:33 -0500)]
HID: remove hid_get_raw_report in struct hid_device

dev->hid_get_raw_report(X) and hid_hw_raw_request(X, HID_REQ_GET_REPORT)
are strictly equivalent. Switch the hid subsystem to the hid_hw notation
and remove the field .hid_get_raw_report in struct hid_device.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: usbhid: remove duplicated code
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:21 +0000 (16:33 -0500)]
HID: usbhid: remove duplicated code

Well, no use to keep twice the same code.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: HIDp: remove duplicated coded
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:20 +0000 (16:33 -0500)]
HID: HIDp: remove duplicated coded

- Move hidp_output_report() above
- Removed duplicated code in hidp_output_raw_report()

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: remove hidinput_input_event handler
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:19 +0000 (16:33 -0500)]
HID: remove hidinput_input_event handler

All the different transport drivers use now the generic event handling
in hid-input. We can remove the handler definitively now.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: HIDp: remove hidp_hidinput_event
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:18 +0000 (16:33 -0500)]
HID: HIDp: remove hidp_hidinput_event

hidp uses its own ->hidinput_input_event() instead of the generic binding
in hid-input.
Moving the handling of LEDs towards hidp_hidinput_event() allows two things:
- remove hidinput_input_event definitively from struct hid_device
- hidraw user space programs can also set the LEDs

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: logitech-dj: remove hidinput_input_event
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:17 +0000 (16:33 -0500)]
HID: logitech-dj: remove hidinput_input_event

hid-logitech-dj uses its own ->hidinput_input_event() instead of
the generic binding in hid-input.
Moving the handling of LEDs towards logi_dj_output_hidraw_report()
allows two things:
- remove hidinput_input_event in struct hid_device
- hidraw user space programs can also set the LEDs

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: add inliners for ll_driver transport-layer callbacks
Benjamin Tissoires [Wed, 5 Feb 2014 21:33:16 +0000 (16:33 -0500)]
HID: add inliners for ll_driver transport-layer callbacks

Those callbacks are not mandatory, so it's better to add inliners
to use them safely.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Thu, 6 Feb 2014 08:46:18 +0000 (09:46 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: hid-sony: report actual brightness value when reading LED
Simon Wood [Wed, 5 Feb 2014 19:34:18 +0000 (12:34 -0700)]
HID: hid-sony: report actual brightness value when reading LED

The Dualshock4 controller contains a RGB LED, which is enabled via
the '/sys/class/leds' interface. At present the driver only returns
whether each of the RGB LEDs is lit (ie not off), but no indication
of it's brightness.

This patch fixes the reading of the current brightnes so that it
returns the value (rather than just off=0, on=LED_FULL).

Tested on the DS4 and SixAxis (for compatibility).

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Tue, 4 Feb 2014 14:24:00 +0000 (15:24 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: Kconfig updates for the Sony module
Frank Praznik [Sat, 1 Feb 2014 15:39:58 +0000 (10:39 -0500)]
HID: Kconfig updates for the Sony module

Update the HID_SONY config with 'select POWER_SUPPLY' to fix build issues
relating to undefined references to the  power_supply_* functions in
certain build configurations.

Update the description text to reflect that Playstation 4 controllers are now
supported.

[jkosina@suse.cz: drop the POWER_SUPPLY hunk, as I've already fixed that]
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:18:45 +0000 (11:18 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoHID: sony: fix build wrt. power_supply
Jiri Kosina [Mon, 3 Feb 2014 10:17:25 +0000 (11:17 +0100)]
HID: sony: fix build wrt. power_supply

Sony driver now makes use of power supply support. Make kernel
config aware of it.

Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoMerge branch 'for-3.15/sony' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:15:04 +0000 (11:15 +0100)]
Merge branch 'for-3.15/sony' into for-next

10 years agoMerge branch 'for-3.15/microsoft' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:14:56 +0000 (11:14 +0100)]
Merge branch 'for-3.15/microsoft' into for-next

10 years agoMerge branch 'for-3.15/ll-driver-new-callbacks' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:14:48 +0000 (11:14 +0100)]
Merge branch 'for-3.15/ll-driver-new-callbacks' into for-next

10 years agoMerge branch 'for-3.15/i2c-hid' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:14:43 +0000 (11:14 +0100)]
Merge branch 'for-3.15/i2c-hid' into for-next

10 years agoMerge branch 'master' into for-next
Jiri Kosina [Mon, 3 Feb 2014 10:14:07 +0000 (11:14 +0100)]
Merge branch 'master' into for-next

10 years agoHID: hid-microsoft: Add support for 2 reserved usage ids used on ms office kb
Hans de Goede [Wed, 29 Jan 2014 16:57:44 +0000 (17:57 +0100)]
HID: hid-microsoft: Add support for 2 reserved usage ids used on ms office kb

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: hid-microsoft: Add support for scrollwheel and special keypad keys
Hans de Goede [Wed, 29 Jan 2014 16:57:43 +0000 (17:57 +0100)]
HID: hid-microsoft: Add support for scrollwheel and special keypad keys

The Microsoft Office keyboard has a scrollwheel as well as some special keys
above the keypad which are handled through the custom MS usage page, this
commit adds support for these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: hid-microsoft: Do the check for the ms usage page per device
Hans de Goede [Wed, 29 Jan 2014 16:57:42 +0000 (17:57 +0100)]
HID: hid-microsoft: Do the check for the ms usage page per device

For some devices we may also want to do custom mappings for other pages.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: Add some missing HUT mappings
Hans de Goede [Wed, 29 Jan 2014 16:57:41 +0000 (17:57 +0100)]
HID: Add some missing HUT mappings

Add mapping for "AL Next Task/Application", "AL Previous Task/Application"
and "AL File Browser" buttons, as found on the Microsoft Office keyboard.

Note that there already is a mapping for "AL Local Machine Browser" to
KEY_FILE. Unless we ever encounter a device with both that should not be
a problem.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoHID: i2c-hid: add runtime PM support
Mika Westerberg [Wed, 29 Jan 2014 09:24:36 +0000 (11:24 +0200)]
HID: i2c-hid: add runtime PM support

This patch adds runtime PM support for the HID over I2C driver. When the
i2c-hid device is first opened we power it on and on the last close we
power it off. This is actually what the driver is already doing but in
addition it allows subsystems, like ACPI power domain to power off the
device during runtime PM suspend, which should save even more power.

The implementation is not the most power efficient because it needs some
interaction from the userspace (e.g close the device node whenever we are
no more interested in getting events), nevertheless it allows us to save
some power and works with devices that are not wake capable.

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>
10 years agoHID: Add the transport-driver functions to the HIDP driver.
Frank Praznik [Wed, 22 Jan 2014 18:49:44 +0000 (13:49 -0500)]
HID: Add the transport-driver functions to the HIDP driver.

Add raw_request, set_raw_report and output_report transport-driver functions to
the HIDP driver.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>