summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-03-28HID: hyperv: Implement a stub raw_request() entry pointK. Y. Srinivasan1-0/+10
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>
2014-03-14HID: remove hid_output_raw_report transport implementationsBenjamin Tissoires5-60/+0
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>
2014-03-14HID: sony: do not rely on hid_output_raw_reportBenjamin Tissoires4-48/+24
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>
2014-03-14Merge branch 'for-3.15/sony' into for-3.15/hid-core-ll-transport-cleanupJiri Kosina3-66/+701
2014-03-14HID: cp2112: remove the last hid_output_raw_report() callBenjamin Tissoires1-1/+6
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>
2014-03-14HID: cp2112: remove various hid_out_raw_report callsBenjamin Tissoires1-6/+6
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>
2014-03-14Merge branch 'for-3.15/hid-cp2112' into for-3.15/hid-core-ll-transport-cleanupJiri Kosina5-0/+1080
2014-02-24HID: hidp: Add a comment that some devices depend on the current behavior of ↵Frank Praznik1-0/+3
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>
2014-02-24HID: sony: Prevent duplicate controller connections.Frank Praznik1-0/+140
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>
2014-02-24HID: sony: Perform a boundry check on the sixaxis battery level index.Frank Praznik1-1/+2
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>
2014-02-24HID: sony: Fix work queue issuesFrank Praznik1-14/+14
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>
2014-02-24HID: sony: Fix multi-line comment stylingFrank Praznik1-15/+30
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>
2014-02-24HID: hidraw: replace hid_output_raw_report() calls by appropriates onesBenjamin Tissoires1-5/+14
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>
2014-02-24HID: make .raw_request mandatoryBenjamin Tissoires4-11/+12
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>
2014-02-24HID: input: hid-input remove hid_output_raw_report callBenjamin Tissoires1-3/+7
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>
2014-02-20HID: sony: Enable LED controls and rumble for the Sixaxis on Bluetooth.Frank Praznik1-11/+13
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>
2014-02-18HID: cp2112: fix incorrect error propagation in cp2112_xfer()Jiri Kosina1-1/+1
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>
2014-02-18HID: cp2112: can't be used without gpio supportJiri Kosina1-1/+1
Add Kconfig driver dependency on GPIOLIB. Reported-by: fengguang.wu@intel.com Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-18HID: cp2112: convert to use hid_hw_raw_request()Jiri Kosina1-8/+10
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>
2014-02-18Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/hid-cp2112Jiri Kosina16-240/+714
2014-02-17HID: cp2112: use proper specifier for size_tJiri Kosina1-2/+2
%zd is a proper format string specifier for size_t Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-17HID: cp2112: make sysfs attributes staticJiri Kosina1-2/+2
No need to pollute namespace with dev_attr_*. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-17HID: add hid-cp2112 driverDavid Barksdale5-0/+1078
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>
2014-02-17HID: sony: Correct Sixaxis battery reportingFrank Praznik1-2/+2
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>
2014-02-17HID: core: check parameters when sending/receiving data from the deviceBenjamin Tissoires2-1/+7
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>
2014-02-17HID: wiimote: replace hid_output_raw_report with hid_hw_output_report for ↵Benjamin Tissoires1-2/+2
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>
2014-02-17HID: replace hid_output_raw_report with hid_hw_raw_request for feature requestsBenjamin Tissoires5-21/+25
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>
2014-02-17HID: logitech-dj: remove hid_output_raw_report callBenjamin Tissoires1-15/+6
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>
2014-02-17HID: usbhid: change return error of usbhid_output_reportBenjamin Tissoires1-1/+1
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>
2014-02-17HID: i2c-hid: use generic .request() implementationBenjamin Tissoires1-31/+0
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>
2014-02-17HID: i2c-hid: implement ll_driver transport-layer callbacksBenjamin Tissoires1-9/+60
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>
2014-02-17HID: core: implement generic .request()Benjamin Tissoires2-2/+48
.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>
2014-02-17HID: uHID: implement .raw_requestBenjamin Tissoires1-0/+16
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>
2014-02-17HID: uhid: reintroduce uhid_hid_get_raw()Jiri Kosina1-0/+83
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>
2014-02-17HID: uHID: remove duplicated codeBenjamin Tissoires1-21/+1
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>
2014-02-17HID: uhid: remove uhid_hid_get_raw()Jiri Kosina1-83/+0
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>
2014-02-17HID: sony: Add conditionals to enable all features in Bluetooth modeFrank Praznik1-7/+30
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>
2014-02-17HID: sony: Set initial battery level to 100% to avoid false low battery warningsFrank Praznik1-0/+5
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>
2014-02-17HID: sony: Add Dualshock 4 Bluetooth battery and touchpad parsingFrank Praznik1-8/+20
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>
2014-02-17HID: sony: Add Dualshock 4 Bluetooth output report formattingFrank Praznik1-5/+16
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>
2014-02-17HID: sony: Add modified Dualshock 4 Bluetooth HID descriptorFrank Praznik1-0/+214
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>
2014-02-17HID: sony: Use low-level transport driver functionsFrank Praznik1-42/+14
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>
2014-02-17Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sonyJiri Kosina15-195/+606
2014-02-17HID: Add HID transport driver documentationBenjamin Tissoires1-0/+316
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>
2014-02-17HID: introduce helper to access hid_output_raw_report()Benjamin Tissoires9-20/+36
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>
2014-02-17HID: remove hid_get_raw_report in struct hid_deviceBenjamin Tissoires8-14/+9
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>
2014-02-17HID: usbhid: remove duplicated codeBenjamin Tissoires1-53/+11
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>
2014-02-17HID: HIDp: remove duplicated codedBenjamin Tissoires1-57/+11
- 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>
2014-02-17HID: remove hidinput_input_event handlerBenjamin Tissoires2-7/+1
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>
2014-02-17HID: HIDp: remove hidp_hidinput_eventBenjamin Tissoires1-46/+0
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>