aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-05-07HID: hid-lg4ff: Remove "hid_" prefix from some functions' namesMichal Malý1-14/+14
Remove "hid_" prefix from some functions' names. All internal functions of hid-lg4ff should be prefixed with just "lg4ff_" Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: hid-lg4ff: Remove double underscore prefix from numeric typesMichal Malý2-28/+28
Remove double underscore prefix from numeric types. This code will never be used outside the kernel so the prefixes are unnecessary. Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07Revert "HID: logitech-hidpp: support combo keyboard touchpad TK820"Benjamin Tissoires1-20/+0
This reverts commit 3a61e97563d78a2ca10752902449570d8433ce76. The Logitech TK820 seems to be affected by a firmware bug which delays the sending of the keys (pressed, or released, which triggers a key-repeat) while holding fingers on the touch sensor. This behavior can be observed while using the mouse emulation mode if the user moves the finger while typing (highly improbable though). Holding the finger still while in the mouse emulation mode does not trigger the key repeat problem. So better keep things in their previous state to not have to explain users that the new key-repeat bug they see is a "feature". Furthermore, I noticed that I disabled the media keys whith this patch. Sorry, my bad. I think it is best to revert the patch, in all the current versions it has been shipped. Cc: <stable@vger.kernel.org> # v3.19 and above Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sjoy: support Super Joy Box 4Sean Young3-1/+4
This device supports force feedback and has two ports. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Correct a typo in a HID descriptor comment and explain the odd Sixaxis axis mappingFrank Praznik1-1/+8
Correct a spelling mistake in the Sixaxis HID descriptor comment. Add an explanation as to why the Sixaxis has so many analog axes and why some of them are seen as multi-touch axes. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Simplify LED initialization and eliminate redundant copies when updating LED statesFrank Praznik1-30/+28
Directly set the initial LED states in the device state struct instead of copying them from a temporary array. This allows for the removal of a redundant "x = x" copy loop in sony_set_leds() that was taking place any time an LED was updated. It also allows for the simplifying of the parameters in functions dealing with LED initialization and updates since only a pointer to the sony_sc struct is needed now. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Correct Sony device orderingFrank Praznik1-2/+2
Rearrange Sony controller devices into alphabetical order in the hardware device list. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Add support for the Sony Motion ControllerFrank Praznik1-2/+136
Add a fixed-up HID descriptor for the Sony motion controller and enable controls for the LED light as well as force-feedback. The LED is multi-colored (red, green, blue). The motion controller has a single rumble motor so the higher of the left and right values is used to set the speed. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Add the product ID for the Sony Motion ControllerFrank Praznik2-0/+2
Adds the PID for the Sony motion controller to the hardware ID list. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: sony: Prevent the freeing of an unitialized ida valueFrank Praznik1-4/+4
sony_allocate_output_report() was being called before sony_set_device_id() which meant that an unallocated ida value was was freed if the output report allocation failed and the probe function jumped to err_stop. Do the device ID allocation before the output report allocation to avoid freeing an unallocated value in case of a failure. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: prodikeys: remove unused variableJiri Slaby1-2/+1
'key' is set but never used in the first loop. So remove the set. And indent the re-set of pm->last_key properly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: make timeout HZ independentNicholas Mc Guire1-1/+2
wait_event_interruptible_timeout() expects a timeout in jiffies so the numeric constant becomes HZ dependent - put it through msecs_to_jiffies() to make it HZ independent. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-07HID: lenovo: add support for Lenovo ThinkPad Keyboard Pro unitBenjamin Tissoires3-0/+33
This dock is used with the Thinkpad Helix 2 but suffers from an error in the report descriptor where an usage max is 65535. Add a report fixup for it and make the keyboard working. Tested-by: Jonathan Oppenheim <lejono@gmail.com> Tested-by: John Reid <owlman.lists@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-04HID: wacom: Fail probe if HID_GENERIC device has unknown device_typeJason Gerecke1-1/+7
The last patch was careful to maintain backwards-compatible behavior by forcing device_type to BTN_TOOL_PEN (and printing a warning) if it were still uninitialized after scanning the HID descriptor and applying quirks. We should be more strict with HID_GENERIC devices, however, since there is no a priori guarantee that it is a tablet or touchpad. If the device_type is still uninitialized for a HID_GENERIC device then we assume that it isn't something the driver can work with and so fail the probe. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-04HID: wacom: Discover device_type from HID descriptor for all devicesJason Gerecke3-14/+23
Currently, we assume a device_type of BTN_TOOL_PEN before scanning the HID descriptor and then change the device_type if what we discover proves that assumption wrong. This way of doing things makes it more difficult to figure out if a device (particularly a HID_GENERIC device) actually does tablet/touch input or is something completley different. This patch leaves device_type at its initial value of 0 and then calls 'wacom_parse_hid' for every device (not just those that have touch). As we map the usages, we can set the device_type as before. After we're finished, we can then check if the value is still zero and do whatever is most appropriate. Detecting the pen can be a little tricky on most Wacom devices because the descriptors describe opaque blobs. Fortunately, older Wacom tablets have the HID_DG_DIGITIZER usage on the pen's application collection and newer tablets seem to have a similar vendor-defined usage that we can trigger on. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-04HID: wacom: Do not add suffix to name of devices with an unknown typeJason Gerecke1-5/+8
The naming logic currently assumes that all devices will be a pen, finger, or pad. Though this has historically been the case, the new HID_GENERIC catch-all may cause us to probe devices with Wacom's 056A VID which aren't any of these types (e.g. the "Cintiq 24HDT Monitor Control"). This patch updates the logic so that no suffix will be added to the device name if the device type is unknown. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-27HID: wacom: retrieve name from HID descriptor for generic devicesPing Cheng1-11/+47
HID generic devices share the same default name, "Wacom HID". This causes userland programs to show same device names for different devices, which would confuse end users with same device names for different devices too. This patch uses name retrieved from HID descriptor, if a meaningful name is reported. Otherwise, affix its product ID to "Wacom HID". Names from descriptor may contain extra whitespaces. To comfort readers' eyes, we removed those extra whitespaces too. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-27HID: usbhid: Add a quirk for raphnet multi-gamepad adaptersRaphael Assenat2-0/+10
The raphnet.net 4nes4snes and 2nes2snes multi-joystick adapters use a single HID report descriptor with one report ID per controller. This has the effect that the inputs of otherwise independent game controllers get packed in one large joystick device. With this patch each controller gets its own /dev/input/jsX device, which is more natural and less confusing than having all inputs going to the same place. Signed-off-by: Raphael Assenat <raph@raphnet.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: i2c-hid: Do not fail probing if gpiolib is not enabledMika Westerberg1-1/+4
Using GPIOs and gpiolib is optional. If the kernel is compiled without GPIO support the driver should not fail if it finds the interrupt using normal methods. However, commit a485923efbb8 ("HID: i2c-hid: Add support for ACPI GPIO interrupts") did not take into account that acpi_dev_add_driver_gpios() returns -ENXIO when !CONFIG_GPIOLIB. Fix this by checking the return value against -ENXIO and 0 and only in that case fail the probe. Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: lenovo: set INPUT_PROP_POINTING_STICKAndreas Fleig1-0/+19
Set flags INPUT_PROP_POINTER and INPUT_PROP_POINTING_STICK for the trackpoint integrated in Lenovo USB and Bluetooth keyboards. Libinput checks these flags to enable features such as middle-button-scrolling by default. Signed-off-by: Andreas Fleig <andreasfleig@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: Add support for DTU-1141Aaron Skomra1-0/+4
Signed-off-by: Aaron Skomra <aaron.skomra@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: Simplify check for presence of single-finger touchJason Gerecke1-3/+2
To determine if a touch is present in the single-touch case, we can simply check if the BTN_TOUCH key is active or not. This will work for both HID_GENERIC and other device types. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: remove unused packet lengthsPing Cheng1-6/+0
We use generic hid_report_len() to get individual packet length now. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: move unit and unitExpo initialization to wacom_calculate_resPing Cheng1-6/+6
That is where they belong... Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: move all quirks to wacom_setup_device_quirksPing Cheng3-40/+31
It makes probe routine easy to follow. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-14Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-1/+1
Pull input subsystem updates from Dmitry Torokhov: "You will get the following new drivers: - Qualcomm PM8941 power key drver - ChipOne icn8318 touchscreen controller driver - Broadcom iProc touchscreen and keypad drivers - Semtech SX8654 I2C touchscreen controller driver ALPS driver now supports newer SS4 devices; Elantech got a fix that should make it work on some ASUS laptops; and a slew of other enhancements and random fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits) Input: alps - non interleaved V2 dualpoint has separate stick button bits Input: alps - fix touchpad buttons getting stuck when used with trackpoint Input: atkbd - document "no new force-release quirks" policy Input: ALPS - make alps_get_pkt_id_ss4_v2() and others static Input: ALPS - V7 devices can report 5-finger taps Input: ALPS - add support for SS4 touchpad devices Input: ALPS - refactor alps_set_abs_params_mt() Input: elantech - fix absolute mode setting on some ASUS laptops Input: atmel_mxt_ts - split out touchpad initialisation logic Input: atmel_mxt_ts - implement support for T100 touch object Input: cros_ec_keyb - fix clearing keyboard state on wakeup Input: gscps2 - drop pci_ids dependency Input: synaptics - allocate 3 slots to keep stability in image sensors Input: Revert "Revert "synaptics - use dmax in input_mt_assign_slots"" Input: MT - make slot assignment work for overcovered solutions mfd: tc3589x: enforce device-tree only mode Input: tc3589x - localize platform data Input: tsc2007 - Convert msecs to jiffies only once Input: edt-ft5x06 - remove EV_SYN event report Input: edt-ft5x06 - allow to setting the maximum axes value through the DT ...
2015-04-14Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds27-667/+2740
Pull HID updates from Jiri Kosina: - quite a few firmware fixes for RMI driver by Andrew Duggan - huion and uclogic drivers have been substantially overlaping in functionality laterly. This redundancy is fixed by hid-huion driver being merged into hid-uclogic; work done by Benjamin Tissoires and Nikolai Kondrashov - i2c-hid now supports ACPI GPIO interrupts; patch from Mika Westerberg - Some of the quirks, that got separated into individual drivers, have historically had EXPERT dependency. As HID subsystem matured (as well as the individual drivers), this made less and less sense. This dependency is now being removed by patch from Jean Delvare - Logitech lg4ff driver received a couple of improvements for mode switching, by Michal Malý - multitouch driver now supports clickpads, patches by Benjamin Tissoires and Seth Forshee - hid-sensor framework received a substantial update; namely support for Custom and Generic pages is being added; work done by Srinivas Pandruvada - wacom driver received substantial update; it now supports i2c-conntected devices (Mika Westerberg), Bamboo PADs are now properly supported (Benjamin Tissoires), much improved battery reporting (Jason Gerecke) and pen proximity cleanups (Ping Cheng) - small assorted fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits) HID: sensor: Update document for custom sensor HID: sensor: Custom and Generic sensor support HID: debug: fix error handling in hid_debug_events_read() Input - mt: Fix input_mt_get_slot_by_key HID: logitech-hidpp: fix error return code HID: wacom: Add support for Cintiq 13HD Touch HID: logitech-hidpp: add a module parameter to keep firmware gestures HID: usbhid: yet another mouse with ALWAYS_POLL HID: usbhid: more mice with ALWAYS_POLL HID: wacom: set stylus_in_proximity before checking touch_down HID: wacom: use wacom_wac_finger_count_touches to set touch_down HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT HID: pidff: effect can't be NULL HID: add quirk for PIXART OEM mouse used by HP HID: add HP OEM mouse to quirk ALWAYS_POLL HID: wacom: ask for a in-prox report when it was missed HID: hid-sensor-hub: Fix sparse warning HID: hid-sensor-hub: fix attribute read for logical usage id HID: plantronics: fix Kconfig default HID: pidff: support more than one concurrent effect ...
2015-04-13Merge tag 'for-v4.1' of git://git.infradead.org/battery-2.6Linus Torvalds6-97/+121
Pull power supply and reset changes from Sebastian Reichel: - new API for safe access of power supply function attrs - devres support for power supply (un)registration - new drivers / chips: - generic syscon based poweroff driver - iio & charger driver for da9150 - fuel gauge driver for axp288 - bq27x00: add support for bq27510 - bq2415x: add support for bq24157s - twl4030-madc-battery: convert to iio consumer - misc fixes * tag 'for-v4.1' of git://git.infradead.org/battery-2.6: (66 commits) power: twl4030_madc_battery: Add missing MODULE_ALIAS power: twl4030-madc-battery: Convert to iio consumer. dt: power: Add docs for generic SYSCON poweroff driver. power: reset: Add generic SYSCON register mapped poweroff. power: max17042_battery: add missed blank power: max17042_battery: Use reg type instead of chip type power/reset: at91: big endian fixes for atsama5d3x power_supply: charger-manager: Fix dereferencing of ERR_PTR HID: input: Fix NULL pointer dereference when power_supply_register fails power: constify of_device_id array power/reset/rmobile-reset.c: Fix !HAS_IOMEM build power_supply: 88pm860x_charger: Fix possible NULL pointer dereference and use of initialized variable arm: mach-pxa: Decrement the power supply's device reference counter mfd: ab8500: Decrement the power supply's device reference counter power_supply: bq2415x_charger: Decrement the power supply's device reference counter power_supply: 88pm860x_charger: Decrement the power supply's device reference counter x86/olpc/xo15/sci: Use newly added power_supply_put API x86/olpc/xo1/sci: Use newly added power_supply_put API power_supply: charger-manager: Decrement the power supply's device reference counter power_supply: Increment power supply use counter when obtaining references ...
2015-04-13Merge branch 'for-4.1/sensor-hub' into for-linusJiri Kosina4-74/+989
Conflicts: drivers/iio/common/hid-sensors/hid-sensor-trigger.c include/linux/hid-sensor-hub.h
2015-04-13Merge branches 'for-4.0/upstream-fixes', 'for-4.1/genius', 'for-4.1/huion-uclogic-merge', 'for-4.1/i2c-hid', 'for-4.1/kconfig-drop-expert-dependency', 'for-4.1/logitech', 'for-4.1/multitouch', 'for-4.1/rmi', 'for-4.1/sony', 'for-4.1/upstream' and 'for-4.1/wacom' into for-linusJiri Kosina25-593/+1735
2015-04-10HID: sensor: Custom and Generic sensor supportSrinivas Pandruvada3-0/+865
HID Sensor Spec defines two usage ids for custom sensors HID_USAGE_SENSOR_TYPE_OTHER_CUSTOM (0x09, 0xE1) HID_USAGE_SENSOR_TYPE_OTHER_GENERIC(0x09, 0xE2) In addition the standard also defines usage ids for custom fields. The purpose of these sensors is to extend the functionality or provide a way to obfuscate the data being communicated by a sensor. Without knowing the mapping between the data and its encapsulated form, it is difficult for an driver to determine what data is being communicated by the sensor. This allows some differentiating use cases, where vendor can provide applications. Since these can't be represented by standard sensor interfaces like IIO, we present these as fields with - type (input/output) - units - min/max - get/set value In addition an dev interface to transfer report events. Details about this interface is described in /Documentation/hid/hid-sensor.txt. Manufacturers should not use these ids for any standard sensors, otherwise the the product/vendor id can be added to black list. 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>
2015-04-10HID: debug: fix error handling in hid_debug_events_read()Jiri Kosina1-1/+2
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>
2015-04-05HID: logitech-hidpp: fix error return codeJulia Lawall1-0/+1
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>
2015-04-02HID: wacom: Add support for Cintiq 13HD TouchPing Cheng1-0/+11
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>
2015-04-02HID: logitech-hidpp: add a module parameter to keep firmware gesturesBenjamin Tissoires1-0/+10
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>
2015-04-02HID: usbhid: yet another mouse with ALWAYS_POLLOliver Neukum2-2/+4
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>
2015-04-02HID: usbhid: more mice with ALWAYS_POLLOliver Neukum2-0/+8
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>
2015-04-02HID: wacom: set stylus_in_proximity before checking touch_downPing Cheng1-18/+16
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>
2015-04-02HID: wacom: use wacom_wac_finger_count_touches to set touch_downPing Cheng1-51/+33
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>
2015-04-02HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUTPing Cheng3-32/+19
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>
2015-04-02Merge branch 'for-4.0/upstream-fixes' into for-4.1/wacomJiri Kosina10-43/+92
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>
2015-03-27HID: pidff: effect can't be NULLJiri Kosina1-1/+1
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>
2015-03-25HID: add quirk for PIXART OEM mouse used by HPOliver Neukum2-0/+2
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>
2015-03-25HID: add HP OEM mouse to quirk ALWAYS_POLLOliver Neukum2-0/+4
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>
2015-03-24HID: input: Fix NULL pointer dereference when power_supply_register failsKrzysztof Kozlowski1-2/+2
Do not call power_supply_powers() if power_supply_register() failed earlier. This fixes possible NULL pointer dereference by power_supply_powers() in such case. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-23Merge tag 'v4.0-rc5' into nextDmitry Torokhov23-261/+715
Merge with the latest upstream to synchronize Synaptics changes and bring in new infrastructure pieces. Conflicts: drivers/input/mouse/synaptics.c
2015-03-17HID: wacom: check for wacom->shared before following the pointerBenjamin Tissoires1-3/+4
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>
2015-03-16HID: wacom: ask for a in-prox report when it was missedBenjamin Tissoires2-1/+20
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>
2015-03-16HID: hid-sensor-hub: Fix sparse warningSrinivas Pandruvada1-2/+2
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>
2015-03-16HID: hid-sensor-hub: fix attribute read for logical usage idSrinivas Pandruvada1-2/+4
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>