aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2016-08-05HID: wacom: EKR: have one array of struct remotes instead of many arraysBenjamin Tissoires3-29/+32
No functional changes, just a prep patch for the one after. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: EKR: use devres groups to manage resourcesBenjamin Tissoires1-16/+28
This will be useful when each remote will be assigned its own input device. We won't need to unregister each input and sysfs and other elements one at a time. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: EKR: have proper allocator and destructorBenjamin Tissoires1-40/+53
The wacom_remote_create_attr_group() and wacom_remote_destroy_attr_group() functions were both allocating/destroying the sysfs groups but also initializing the parameters for the remotes. Have proper functions that can be called and extended. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: rework fail path in probe() and parse_and_register()Benjamin Tissoires1-23/+14
Thanks to devres management, we don't need to remember a lot of failure path. One or two is enough. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: EKR: have the wacom resources dynamically allocatedBenjamin Tissoires4-66/+94
If we want to have one input device per remote, it's better to have our own struct wacom_remote which is dynamically allocated. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: EKR: add a worker to add/remove resources on addition/removalBenjamin Tissoires4-38/+113
wacom_remote_status_irq() sends information of addition/removal of EKR. We want to allocate one input node per remote, so better having this in a separate worker, not handled in the IRQ directly. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: leds: dynamically allocate LED groupsBenjamin Tissoires3-17/+78
We need to add an action to ensure wacom->led.groups is null when wacom_led_control() gets called after the resources has been freed. This also prevents to send a LED command when there is no support from the device. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: devres manage the shared data tooBenjamin Tissoires1-34/+39
wacom_release_shared_data() and wacom_remove_shared_data() are moved up so they can be referenced in wacom_add_shared_data(). There is no point in explicitly setting wacom_wac1->shared->type to 0 in wacom_wireless_work() (plus this would give an oops). Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: use devres to allocate driver dataBenjamin Tissoires1-3/+1
We started switching the driver to devres, so we should use it as much as possible. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: use devm_kasprintf for allocating the name of the remoteBenjamin Tissoires1-8/+6
The sysfs group was indeed removed by kobject_put(wacom->remote_dir) in wacom_remove(), but the name of the group was never freed. Also remove the misplaced kobject_put(wacom->remote_dir) in the error path of wacom_remote_create_attr_group(). Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: convert LEDs to devresBenjamin Tissoires2-51/+45
Use our own wacom_devm_sysfs_create_group() as there is currently no generic one. It has been requested at least twice [1][2] but has been always rejected. However, in the Wacom case, for the wirelessly connected devices, we need to be able to release the created sysfs files without removing the parent kobject. [1] https://patchwork.kernel.org/patch/7526551/ [2] https://lkml.org/lkml/2013/3/14/728 Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: put the managed resources in a groupBenjamin Tissoires4-43/+32
We currently have a complex clean_inputs() function while this can be handled all by devres. Set a group that we can destroy in wireless_work(). Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: switch inputs to devresBenjamin Tissoires1-18/+16
Simplifying the error code paths. We need to keep wacom_clean_inputs() around for now as the wireless module is using it to dynamically remove the inputs on disconnect. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: switch battery to devresBenjamin Tissoires1-14/+24
Simplifying the error code paths. We need to keep wacom_destroy_battery() around for now as the wireless module and the remotes are using it to dynamically remove the battery supply on disconnect. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: use one work queue per taskBenjamin Tissoires3-15/+29
Looks like the battery hijacked the wireless worker. That's not fair so use a work queue per task. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: untie leds from inputsBenjamin Tissoires1-9/+11
Like remotes, LEDs should be handled by themself, not magically behind the inputs as they have a complete different life. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: remove cleanup of wacom->remote_dir from wacom_clean_inputs()Benjamin Tissoires1-11/+14
wacom->remote_dir has nothing to do with inputs, so better not magically removing it when cleaning inputs. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: store the type in wacom->shared for INTUOSHT and INTUOSHT2Benjamin Tissoires1-2/+3
The type is never set but we check for it in wacom_wireless_irq(). It looks like this is a big hack from the beginning, so fill in the gap only. Untested. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: wacom: actually report the battery level for wireless connectedBenjamin Tissoires1-1/+2
Since fd5f92b ("HID: wacom: reuse wacom_parse_and_register() in wireless_work"), wacom->shared->type is not set. Send the information of the battery if we have one. Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-05HID: input: add mic mute key on HP slim keyboardAceLan Kao1-0/+1
Add MIC mute key which is found on HP Business Slim Keyboard T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 23 Spd=1.5 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=03f0 ProdID=2f4a Rev=00.10 S: Manufacturer=Chicony S: Product=HP Business Slim Keyboard C: #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=usbhid I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid Signed-off-by: AceLan Kao <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-02HID: Add a new Saitek mouse device ID (RAT 9)Mayeul Cantan3-0/+4
The new device has 06a3:0cfa as identifiers, and the same quirks as the other RAT models. It needs this fix in order not to confuse the xorg server with its tristate button, which is reported as three different buttons, one of which is always on. [[email protected]: drop unrelated whitespace hunk] Signed-off-by: Mayeul Cantan <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-02HID: sony: disable descriptor fixup for FutureMax Dance MatMikko Perttunen1-1/+5
The FutureMax Dance Mat claims to be a SixAxis controller but breaks if descriptor fixups are applied. Detect the device using its USB product string and disable fixups when it is detected. Signed-off-by: Mikko Perttunen <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Acked-by: Antonio Ospite <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-08-02HID: use IS_ENABLED() instead of checking for built-in or moduleJavier Martinez Canillas1-1/+1
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Using the macro makes the code more readable by helping abstract away some of the Kconfig built-in and module enable details. Signed-off-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-28Merge branch 'for-4.8/hid-led' into for-linusJiri Kosina6-267/+554
Conflicts: drivers/hid/hid-thingm.c
2016-07-28Merge branches 'for-4.8/alps', 'for-4.8/apple', 'for-4.8/i2c-hid', ↵Jiri Kosina9-29/+65
'for-4.8/uhid-offload-hid-device-add' and 'for-4.8/upstream' into for-linus
2016-07-12HID: logitech-hidpp: select CONFIG_POWER_SUPPLYArnd Bergmann1-0/+1
A recent commit added barry support to this driver, but that causes a link failure when CONFIG_POWER_SUPPLY is not set: drivers/hid/built-in.o: In function `hidpp_battery_get_property': :(.text+0x1a834): undefined reference to `power_supply_get_drvdata' drivers/hid/built-in.o: In function `hidpp_raw_event': :(.text+0x1b10c): undefined reference to `power_supply_changed' drivers/hid/built-in.o: In function `hidpp_connect_event': :(.text+0x1bd88): undefined reference to `devm_power_supply_register' :(.text+0x1be30): undefined reference to `power_supply_powers' This adds a dependency, identically to the other HID drivers that need this. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Fixes: 5a2b190cddb9 ("HID: logitech-hidpp: add battery support for HID++ 2.0 devices") Signed-off-by: Jiri Kosina <[email protected]>
2016-07-11HID: add usb device id for Apple Magic KeyboardJean-Gabriel Gill-Couture3-0/+4
USB device Vendor 05ac (Apple) Device 0267 (Magic Keyboard) This keyboard supports both Bluetooth and USB connections, this patch only covers USB. Thanks to Maxime Poulin <[email protected]> Signed-off-by: Jean-Gabriel Gill-Couture <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-08HID: hid-led: fix Delcom support on big endian systemsHeiner Kallweit1-1/+1
Properly handle this __le16 value on big endian systems. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-07HID: logitech-hidpp: remove HIDPP_QUIRK_CONNECT_EVENTSBenjamin Tissoires1-12/+7
Now that we can create battery power_supply sources, it's better to enable the connect_event callback unconditionally. Signed-off-by: Benjamin Tissoires <[email protected]> Tested-by: Peter Hutterer <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-07HID: logitech-hidpp: add battery support for HID++ 2.0 devicesPeter Hutterer1-1/+237
If the 0x1000 Unified Battery Level Status feature exists, expose the battery level. The main drawback is that while a device is plugged in its battery level is 0. To avoid exposing that as 0% charge we make up a number based on the charging status. Signed-off-by: Peter Hutterer <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-07HID: hid-led: add support for Greynut LuxaforHeiner Kallweit4-0/+29
Add support for Greynut Luxafor. This device has two groups of three independent LED's each. Successfully tested with such a device. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-07HID: hid-led: add support for Delcom Visual Signal Indicator G2Heiner Kallweit4-0/+103
Add support for the HID-compliant Delcom Visual Signal Indicator generation 2 devices. Successfully tested with part no 904000 from the family of these devices. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-07-07HID: hid-led: remove report id from struct hidled_configHeiner Kallweit1-11/+2
Delcom uses the report id to submit command information. To be able to use the hidled framework also for Delcom devices we have to remove the report id from struct hidled_config. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-28HID: multitouch: enable palm rejection for Windows Precision TouchpadAllen Hung1-3/+15
The usage Confidence is mandary to Windows Precision Touchpad devices. If it is examined in input_mapping on a WIndows Precision Touchpad, a new add quirk MT_QUIRK_CONFIDENCE desgned for such devices will be applied to the device. A touch with the confidence bit is not set is determined as invalid. Tested on Dell XPS13 9343 Cc: [email protected] # v4.5+ Reviewed-by: Benjamin Tissoires <[email protected]> Tested-by: Andy Lutomirski <[email protected]> # XPS 13 9350, BIOS 1.4.3 Signed-off-by: Allen Hung <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-28Revert "HID: multitouch: enable palm rejection if device implements ↵Allen Hung1-5/+0
confidence usage" This reverts commit 25a84db15b3f ("HID: multitouch: enable palm rejection if device implements confidence usage") The commit enables palm rejection for Win8 Precision Touchpad devices but the quirk MT_QUIRK_VALID_IS_CONFIDENCE it is using is not working very properly. This quirk is originally designed for some WIn7 touchscreens. Use of this for a Win8 Precision Touchpad will cause unexpected pointer jumping problem. Cc: [email protected] # v4.5+ Reviewed-by: Benjamin Tissoires <[email protected]> Tested-by: Andy Lutomirski <[email protected]> # XPS 13 9350, BIOS 1.4.3 Signed-off-by: Allen Hung <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-24HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commandsScott Bauer1-5/+5
This patch validates the num_values parameter from userland during the HIDIOCGUSAGES and HIDIOCSUSAGES commands. Previously, if the report id was set to HID_REPORT_ID_UNKNOWN, we would fail to validate the num_values parameter leading to a heap overflow. Cc: [email protected] Signed-off-by: Scott Bauer <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-23HID: alps: a few cleanupsMasaki Ota3-69/+50
Remove an unnecessary codes. Change input_ivent() function to appropriate function. Add the device ID of "HID_DEVICE_ID_ALPS_U1_DUAL". [[email protected]: removed unnecessary bitshifts of values passed input_report_key() as spotted by Dmitry] Signed-off-by: Masaki Ota <[email protected]> Reviewed-by: Dmitry Torokhov <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-23HID: remove ThingM blink(1) driverHeiner Kallweit3-268/+4
Now that support for ThingM blink(1) was merged into the hid-led driver the dedicated driver for this device can be removed. Signed-off-by: Heiner Kallweit <[email protected]> Acked-by: Vivien Didelot <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-23HID: hid-led: add support for ThingM blink(1)Heiner Kallweit2-3/+70
Add support for ThingM blink(1) and make the dedicated ThingM driver obsolete. Successfully tested with a blink(1) mk2. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-23HID: hid-led: add support for reading from LED devicesHeiner Kallweit1-0/+29
Add support for reading data from LED devices. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-23HID: hid-led: add support for devices with multiple independent LEDsHeiner Kallweit1-30/+55
Add generic support for devices with multiple independent LED's. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-21HID: i2c-hid: set power sleep before shutdownGuohua Zhong1-1/+9
Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd & free irq before device shutdown. Some HW design (i.e. Umaro, a chromebook model) is that the power to i2c hid device won't down after device shutdown. Also the i2c-hid driver do not send suspend cmd to the hid i2c device and free its irq before shutdown.So if We touch the touchscreen or some other i2c hid device, the power consumtion will be go up even when the device is in shutdown state. Though the root cause maybe a HW issue. But it seems that it is a good pratice to set power sleep for i2c-hid device before shutdown. Signed-off-by: Guohua Zhong <[email protected]> Acked-By: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-20HID: alps: match alps devices in coreJiri Kosina1-0/+1
All devices with ALPS_JP VID are handled by hid-alps driver, hence they require an entry in hid_have_special_driver[]. Signed-off-by: Jiri Kosina <[email protected]>
2016-06-20HID: thingm: simplify debug output codeHeiner Kallweit1-6/+2
Kernel printf format %*ph allows to print small buffers up to 64 bytes. Make use of it to simplify the debug output code. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-20HID: alps: pass correct sizes to hid_hw_raw_request()Jiri Kosina1-3/+4
Calculating size of the report as sizeof(pointer) always passess the length corresponding to the pointer type, not the underlying data report. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-17HID: alps: struct u1_dev *priv is internal to the driverJiri Kosina1-1/+1
... and therefore should be marked static. Signed-off-by: Jiri Kosina <[email protected]>
2016-06-17HID: add Alps I2C HID Touchpad-Stick supportMasaki Ota4-0/+536
Add support Alps I2C HID Touchpad and Stick device. Signed-off-by: Masaki Ota <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-17HID: led: fix configJiri Kosina1-2/+2
The driver port was done carefully not to depend on USB at all, in favor of being generic HID driver instead. Therefore there is no need to explicitly talk about USB only in the config. Signed-off-by: Jiri Kosina <[email protected]>
2016-06-17HID: migrate USB LED driver from usb misc to hidHeiner Kallweit5-3/+306
This patch migrates the USB LED driver to the HID subsystem. Supported are Dream Cheeky Webmail Notifier / Friends Alert and Riso Kagaku Webmail Notifier. Benefits: - Avoid using USB low-level calls and use the HID subsystem instead (as this device provides a USB HID interface) - Use standard LED subsystem instead of proprietary sysfs entries, this allows e.g. to use the device with features like triggers Successfully tested with a Dream Cheeky Webmail Notifier and a Riso Kagaku Webmail Notifier compatible device. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2016-06-06HID: i2c_hid: enable i2c-hid devices to suspend/resume asynchronouslyFu, Zhonghui1-0/+1
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process. Signed-off-by: Zhonghui Fu <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>