aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-08-08Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds8-981/+4523
Pull input updates from Dmitry Torokhov: - big update to Wacom driver by Benjamin Tissoires, converting it to HID infrastructure and unifying USB and Bluetooth models - large update to ALPS driver by Hans de Goede, which adds support for newer touchpad models as well as cleans up and restructures the code - more changes to Atmel MXT driver, including device tree support - new driver for iPaq x3xxx touchscreen - driver for serial Wacom tablets - driver for Microchip's CAP1106 - assorted cleanups and improvements to existing drover and input core * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (93 commits) Input: wacom - update the ABI doc according to latest changes Input: wacom - only register once the MODULE_* macros Input: HID - remove hid-wacom Bluetooth driver Input: wacom - add copyright note and bump version to 2.0 Input: wacom - remove passing id for wacom_set_report Input: wacom - check for bluetooth protocol while setting OLEDs Input: wacom - handle Intuos 4 BT in wacom.ko Input: wacom - handle Graphire BT tablets in wacom.ko Input: wacom - prepare the driver to include BT devices Input: hyperv-keyboard - register as a wakeup source Input: imx_keypad - remove ifdef round PM methods Input: jornada720_ts - get rid of space indentation and use tab Input: jornada720_ts - switch to using managed resources Input: alps - Rushmore and v7 resolution support Input: mcs5000_ts - remove ifdef around power management methods Input: mcs5000_ts - protect PM functions with CONFIG_PM_SLEEP Input: ads7846 - release resources on failure for clean exit Input: wacom - add support for 0x12C ISDv4 sensor Input: atmel_mxt_ts - use deep sleep mode when stopped ARM: dts: am437x-gp-evm: Update binding for touchscreen size ...
2014-08-07Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-ledsLinus Torvalds6-2/+339
Pull LED updates from Bryan Wu: "This cycle we got: - a fix of attribute-creation race for the whole leds subsystem - new drivers (HID:GT683R, leds-ipaq-micro) - other fixing and clean up" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (23 commits) leds: ipaq-micro: fix sparse non static symbol warning leds: add driver for the iPAQ micro Documentation: dts: tcs6507: Fix wrong statement about #gpio-cells leds: convert blink timer to workqueue leds:pca963x: Update for PCA9635 and correct statement about MODE2 OUTDRV default leds:pca963x: Always initialize MODE2 register leds:pca963x: Add support for PCA9635 LED driver chip HID: gt683r: move mode attribute to led-class devices HID: gt683r: fix race condition HID: add support for MSI GT683R led panels leds: lp55xx-common: fix attribute-creation race leds: lp55xx-common: fix sysfs entry leak input: lm8323: fix attribute-creation race leds: wm831x-status: fix attribute-creation race leds: ss4200: fix attribute-creation race leds: ns2: fix attribute-creation race leds: netxbig: fix attribute-creation race leds: max8997: fix attribute-creation race leds: lm3642: fix attribute-creation race leds: lm355x: fix attribute-creation race ...
2014-08-06Merge branch 'next' into for-linusDmitry Torokhov21-1293/+6338
Prepare first round of input updates for 3.17.
2014-08-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds16-642/+1181
Pull HID updates from Jiri Kosina: "Some highlights: - hid-sony improvements of Sixaxis device support by Antonio Ospite - hid-hyperv driven devices can now be used as wakeup source, by Dexuan Cui - hid-lenovo driver is now more generic and supports more devices, by Jamie Lentin - hid-huion now supports wider range of tablets, by Nikolai Kondrashov - other various unsorted fixes and device ID additions" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (30 commits) HID: hyperv: register as a wakeup source HID: sony: Default initialize all elements of the LED max_brightness array to 1 HID: huion: Fix sparse warnings HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed HID: ignore jabra gn9350e HID: cp2112: add I2C mode HID: use multi input quirk for 22b9:2968 HID: rmi: only bind the hid-rmi driver to the mouse interface of composite USB devices HID: rmi: check that report ids exist in the report_id_hash before accessing their size HID: lenovo: Add support for Compact (BT|USB) keyboard HID: lenovo: Don't call function in condition, show error codes HID: lenovo: Prepare support for adding other devices HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovo HID: huion: Handle tablets with UC-Logic vendor ID HID: huion: Switch to generating report descriptor HID: huion: Don't ignore other interfaces HID: huion: Use "tablet" instead of specific model HID: add quirk for 0x04d9:0xa096 device HID: i2c-hid: call the hid driver's suspend and resume callbacks HID: rmi: change logging level of log messages related to unexpected reports ...
2014-08-06Input: wacom - only register once the MODULE_* macrosBenjamin Tissoires2-4/+5
Putting the various MODULE_* makes them appear several times in modinfo because wacom.h is used both in wacom_sys.c and wacom_wac.h. Having the macros near the module declaration makes them appear only once. Add also MODULE_VERSION(DRIVER_VERSION) to export the current version number. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: HID - remove hid-wacom Bluetooth driverBenjamin Tissoires3-982/+2
Bluetooth Wacom tablets are now handled by the regular wacom.ko driver. Remove the now useless hid-wacom driver. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - add copyright note and bump version to 2.0Benjamin Tissoires1-1/+4
Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - remove passing id for wacom_set_reportPrzemo Firszt1-18/+17
Every call of wacom_set_report was passing "id" as a separate parameter and buffer also passed the same information. We can use first u8 of the buffer instead of "id" Signed-off-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - check for bluetooth protocol while setting OLEDsBenjamin Tissoires1-8/+21
Bluetooth Intuos 4 use 1-bit definition while the USB ones use a 4-bits definition. This changes the size of the raw image we receive, and thus the kernel will only accept 1-bit images for Bluetooth and 4-bits for USB. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Przemo Firszt <przemo@firszt.eu> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - handle Intuos 4 BT in wacom.koBenjamin Tissoires5-2/+92
A good point of this change is that now, the Intuos4 bluetooth can handle the different tools (artpen, airbrush, mice), and we get a common interface between USB and BT for accessing the LEDs/OLEDs. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - handle Graphire BT tablets in wacom.koBenjamin Tissoires5-5/+132
First, merge the Graphire BT tablet. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - prepare the driver to include BT devicesBenjamin Tissoires2-3/+69
Now that wacom is a hid driver, there is no point in having a separate driver for bluetooth devices. This patch prepares the common paths of Bluetooth devices in the common wacom driver. It also adds the sysfs file "speed" used by Bluetooth devices. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Merge branches 'for-3.17/upstream', 'for-3.17/cp2112', 'for-3.17/huion', 'for-3.17/hyperv', 'for-3.17/i2c', 'for-3.17/lenovo', 'for-3.17/rmi' and 'for-3.17/sony' into for-linusJiri Kosina16-645/+1190
2014-08-04HID: hyperv: register as a wakeup sourceDexuan Cui1-0/+6
With this patch, we can move the mouse to wake up the VM after the VM executes "echo freeze > /sys/power/state". This addresses part of https://bugzilla.redhat.com/show_bug.cgi?id=1086100 Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-30HID: sony: Default initialize all elements of the LED max_brightness array to 1Frank Praznik1-1/+1
Previously only the first element of the array was initialized to 1 leading to potential incorrect max brightness values for the LEDs on the Dualshock 3 and buzzer controllers. Use a designated initializer to initialize the whole array to the correct value. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: huion: Fix sparse warningsNikolai Kondrashov1-1/+1
Fix sparse warnings in hid-huion.c by using correct buffer type for retrieved string descriptor. The warnings in question were: drivers/hid/hid-huion.c:144:44: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:145:44: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:146:51: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:147:30: sparse: cast to restricted __le16 Reported-by: fengguang.wu@intel.com Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removedReyad Attiyat1-1/+5
Set disconnected flag in struct usbhid when a usb device is removed. Check for disconnected flag before sending urb requests. This prevents a kernel panic when a hid driver calls hid_hw_request() after removing a usb device. BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 IP: [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290 PGD 0 Oops: 0002 [#1] PREEMPT SMP CPU: 2 PID: 39 Comm: khubd Tainted: G IO 3.16.0-rc5+ #112 Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 2, BIOS 2.03.0250 09/06/2013 task: ffff880118aba6e0 ti: ffff8800daf80000 task.ti: ffff8800daf80000 RIP: 0010:[<ffffffff8161746f>] [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290 RSP: 0018:ffff8800daf83750 EFLAGS: 00010086 RAX: 0000000080000300 RBX: ffff88003f60c000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff880117f78000 RBP: ffff8800daf83788 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880117f78000 R13: ffff88003f11a290 R14: 000000000000000c R15: ffff880091cb3ab8 FS: 0000000000000000(0000) GS:ffff88011b000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000058 CR3: 0000000001c11000 CR4: 00000000001407e0 Stack: ffff880117f3dcd0 ffff880117f78000 ffff88003f60c000 ffff880117f78000 ffff880117f78000 ffff88003f11a290 0000000000000000 ffff8800daf837b0 ffffffff81617707 ffff880117f78000 ffff88003f60c000 0000000000000013 Call Trace: [<ffffffff81617707>] usbhid_restart_ctrl_queue+0x87/0x140 [<ffffffff81617a88>] usbhid_submit_report+0x2c8/0x370 [<ffffffff81617b4a>] usbhid_request+0x1a/0x30 [<ffffffffa020edfb>] sensor_hub_set_feature+0x8b/0xd0 [hid_sensor_hub] [<ffffffffa02d9084>] hid_sensor_power_state+0x84/0x110 [hid_sensor_trigger] [<ffffffffa02d9129>] hid_sensor_data_rdy_trigger_set_state+0x19/0x20 [hid_sensor_trigger] [<ffffffffa034d5b7>] iio_triggered_buffer_predisable+0xa7/0xb0 [industrialio] [<ffffffffa034cc4a>] iio_disable_all_buffers+0x3a/0xc0 [industrialio] [<ffffffffa03487d3>] iio_device_unregister+0x53/0x80 [industrialio] [<ffffffffa026c06a>] hid_accel_3d_remove+0x2a/0x50 [hid_sensor_accel_3d] [<ffffffff814f433d>] platform_drv_remove+0x1d/0x40 [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0 [<ffffffff814f1955>] device_release_driver+0x25/0x40 [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0 [<ffffffff814ed7d6>] device_del+0x136/0x1e0 [<ffffffff81512190>] ? mfd_cell_disable+0x80/0x80 [<ffffffff814f41d1>] platform_device_del+0x21/0xc0 [<ffffffff814f4282>] platform_device_unregister+0x12/0x30 [<ffffffff815121d3>] mfd_remove_devices_fn+0x43/0x50 [<ffffffff814ed3e3>] device_for_each_child+0x43/0x70 [<ffffffff81512105>] mfd_remove_devices+0x25/0x30 [<ffffffffa020ebd7>] sensor_hub_remove+0x87/0x140 [hid_sensor_hub] [<ffffffff81607c5b>] hid_device_remove+0x6b/0xd0 [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0 [<ffffffff814f1955>] device_release_driver+0x25/0x40 [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0 [<ffffffff814ed7d6>] device_del+0x136/0x1e0 [<ffffffff81607d47>] hid_destroy_device+0x27/0x60 [<ffffffff81616972>] usbhid_disconnect+0x22/0x50 [<ffffffff81568597>] usb_unbind_interface+0x77/0x2b0 [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0 [<ffffffff814f1955>] device_release_driver+0x25/0x40 [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0 [<ffffffff814ed7d6>] device_del+0x136/0x1e0 [<ffffffff81565cd1>] usb_disable_device+0x91/0x2a0 [<ffffffff8155b046>] usb_disconnect+0x96/0x2e0 [<ffffffff8155d74a>] hub_thread+0xb5a/0x1840 Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: ignore jabra gn9350ePatrick Plattes2-0/+2
Ignore Jabra GN9350E HID interface. USB audio is working nicely, but registering as HID blocks USB mouse buttons. Since special userspace programs are needed we will avoid attaching usbhid drivers in general. Signed-off-by: Patrick Plattes <patrick@erdbeere.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: cp2112: add I2C modeAntonio Borneo1-1/+102
cp2112 supports single I2C read/write transactions. It can't combine I2C transactions. Add master_xfer, using similar code flow as for smbus_xfer. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: use multi input quirk for 22b9:2968Wen-chien Jesse Sung2-0/+2
This device generates ABS_Z and ABS_RX events instead of ABS_X and ABS_Y. Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: rmi: only bind the hid-rmi driver to the mouse interface of composite USB devicesAndrew Duggan1-1/+3
On composite HID devices there may be multiple HID devices on separate interfaces, but hid-rmi should only bind to the mouse interface. One example is the Dell Venue 11 Pro's keyboard dock which contains a composite USB device with a HID touchpad and HID keyboard on separate intefaces. Since the USB Vendor ID is Synaptic's, hid-core is currently trying to bind hid-rmi to all\of the HID devices. This patch ensures that hid-rmi only binds to the mouse interface. related bug: https://bugzilla.kernel.org/show_bug.cgi?id=80091 Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: rmi: check that report ids exist in the report_id_hash before accessing their sizeAndrew Duggan1-6/+22
It is possible that the hid-rmi driver could get loaded onto a device which does not have the expected report ids. This should not happen because it would indicate that the hid-rmi driver is not compatible with that device. However, if it does happen it should return an error from probe instead of dereferencing a null pointer. related bug: https://bugzilla.kernel.org/show_bug.cgi?id=80091 Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: lenovo: Add support for Compact (BT|USB) keyboardJamie Lentin4-0/+214
Add support for both ThinkPad Compact Bluetooth Keyboard with TrackPoint and ThinkPad Compact USB Keyboard with TrackPoint. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: lenovo: Don't call function in condition, show error codesJamie Lentin1-4/+4
Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: lenovo: Prepare support for adding other devicesJamie Lentin1-8/+45
Ensure all tpkbd specifics are within a postfixed function, the main functions for the driver should just switch to the appropriate function depending on product ID. Given this, we can add extra devices by including extra postfixed functions. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovoJamie Lentin4-101/+102
Rename module and all functions within so we can add support for other keyboards in the same file. Rename the _tp postfix to _tpkbd, to signify functions relevant to the TP USB keyboard. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: huion: Handle tablets with UC-Logic vendor IDNikolai Kondrashov1-0/+1
Add handling of Huion tablets with UC-Logic vendor ID, but the same product ID to hid-huion driver. A Huion H580 was seen using it. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: huion: Switch to generating report descriptorNikolai Kondrashov1-78/+167
Switch to generating tablet pen report descriptor from a template and parameters retrieved from string descriptor 0x64. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: huion: Don't ignore other interfacesNikolai Kondrashov1-13/+7
Don't ignore non pen-reporting interfaces as they may be used by some models reusing the same product ID. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: huion: Use "tablet" instead of specific modelNikolai Kondrashov3-14/+15
Use word "tablet" in identifiers and comments instead of referring to specific Huion tablet model name, as the product ID is used by at least several tablet models. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: add quirk for 0x04d9:0xa096 deviceWangzhao Cai2-0/+2
I am using a USB keyborad that give me "usb_submit_urb(ctrl) failed: -1" error when I plugin it. and I need to wait for 10s for this device to be ready. By adding this quirks, the usb keyborad is usable right after plugin Signed-off-by: Wangzhao Cai <microcaicai@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: i2c-hid: call the hid driver's suspend and resume callbacksAndrew Duggan1-1/+14
Currently, the i2c-hid driver does not call the suspend, resume, and reset_resume callbacks in the hid_driver struct when those events occur. This means that HID drivers for i2c-hid devices will not be able to execute commands which may be needed during suspend or resume. One example is when a touchpad using the hid-multitouch driver gets reset by i2c-hid coming out of resume. Since the reset_resume callback never gets called the device is never put back into the correct input mode. This patch calls the suspend and resume callbacks and tries to duplicate the functionality of the usb-hid driver. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Vincent Huang <vincent.huang@tw.synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: rmi: change logging level of log messages related to unexpected reportsAndrew Duggan1-2/+2
Userspace tools may use hidraw to perform operations on the device from userspace while hid-rmi is bound to the device. This can cause hid-rmi to print error messages when its ->raw_event() callback gets called as the reports pass through the HID stack. In this case receiving responses which were not initiated by hid-rmi is not actually an error so the resulting error messages are incorrect and misleading. This patch changes the log messages to debug so that the messages can be turned on in the event that there is a problem and there is not a userspace tool running. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-29HID: rmi: make compututation of the address of Query 12 more carefulAndrew Duggan1-10/+25
There are additional queries which are optional and may not be present depending on the configuration of the firmware. Knowing which queries are present is needed to properly compute the address of Query 12 and all subsequent queries. Additional bits in Query 1 are used to indicate the presence of these optional queries. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-28Input: wacom - add support for 0x12C ISDv4 sensorJason Gerecke1-0/+4
Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - register an ac power supply for wireless devicesBenjamin Tissoires3-5/+55
This is used by HID Bluetooth devices but also add some more information to the USB Wireless Receiver. We are just porting the bits from hid-wacom.c to the common driver here. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - use a uniq name for the battery deviceBenjamin Tissoires2-1/+6
The current implementation uses "wacom_battery" as a generic name for batteries. This prevents us to have two Wacom devices with a battery attached as the power system will complain about the name which is already registered. Use an incremental name for each battery attached. Related bug: https://sourceforge.net/p/linuxwacom/bugs/248/ Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - enhance Wireless Receiver battery reportingBenjamin Tissoires4-8/+43
- Reports the current status of the battery (discharging, charging, full). - Also notify the upower daemon when there is a change in the battery value. - keep the battery value as a percentage, not the raw value - add WACOM_QUIRK_BATTERY to easily add a battery to a device (required for Bluetooth devices) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - put a flag when the led are initializedBenjamin Tissoires2-0/+7
This solves a bug with the wireless receiver: - at plug, the wireless receiver does not know which Wacom device it is connected to, so it does not actually creates all the LEDs - when the tablet connects, wacom->wacom_wac.features.type is set to the proper device so that wacom_wac can understand the packets - when the receiver is unplugged, it detects that a LED should have been created (based on wacom->wacom_wac.features.type) and tries to remove it: crash when removing the sysfs group. Side effect, we can now safely call several times wacom_destroy_leds(). Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - support up to 2048 pressure levels with ISDv4Jason Gerecke1-1/+1
Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - move the USB (now hid) Wacom driver in drivers/hidBenjamin Tissoires6-0/+4128
wacom.ko is now a full HID driver, we have to move it into the proper subdirectory: drivers/hid. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - switch from an USB driver to a HID driverBenjamin Tissoires2-2/+10
All USB Wacom tablets are actually HID devices. For historical reasons, they are handled as plain USB devices. The current code makes more and more reference to the HID subsystem like implementing its own HID report descriptor parser to handle new devices. From the user point of view, we can transparently switch from this state to a driver handled in the HID subsystem and clean up a lot of USB specific code in the wacom.ko driver. The other benefit once the USB dependecies have been removed is that we can use a tool like uhid to make regression tests and allow further cleanup or new implementations without risking breaking current behaviors. To match the current handling of devices in wacom_wac.c, we rely on the hid_type set by usbhid. usbhid sets the hid_type to HID_TYPE_USBMOUSE when it sees a USB boot mouse protocol declared and HID_TYPE_USBNONE when the device is plain HID. There is thus a one to one matching between the list of supported devices before and after the switch from USB to HID. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25[media] rc-core: remove protocol arraysDavid Härdeman1-1/+1
The basic API of rc-core used to be: dev = rc_allocate_device(); dev->x = a; dev->y = b; dev->z = c; rc_register_device(); which is a pretty common pattern in the kernel, after the introduction of protocol arrays the API looks something like: dev = rc_allocate_device(); dev->x = a; rc_set_allowed_protocols(dev, RC_BIT_X); dev->z = c; rc_register_device(); There's no real need for the protocols to be an array, so change it back to be consistent (and in preparation for the following patches). [m.chehab@samsung.com: added missing changes at some files] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-07Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hidLinus Torvalds5-11/+24
Pull HID fixes from Jiri Kosina: "A few tiny HID subsystem fixes for 3.16" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: use multi input quirk for 22b9:2968 HID: sensor-hub: fix potential memory leak HID: usbhid: quirk for PM1610 and PM1640 Touchscreen. HID: rmi: Protect PM-only functions by #ifdef CONFIG_PM HID: sensor-hub: introduce Kconfig dependency on IOMEM HID: sensor-hub: make dyn_callback_lock IRQ-safe
2014-07-07HID: cp2112: fix gpio value in gpio_direction_outputAntonio Borneo1-2/+6
CP2112 does not offer an atomic method to set both gpio direction and value. Also it does not permit to set gpio value before putting gpio in output. In fact, accordingly to Silicon Labs AN495, Rev. 0.2, cpt. 4.4, the HID report to set gpio values "does not affect any pins that are not configured as outputs". This is confirmed on evaluation board CP2112-EK. With current driver, after execute: echo in > /sys/class/gpio/gpio248/direction echo low > /sys/class/gpio/gpio248/direction gpio output is still high. Only after a following echo low > /sys/class/gpio/gpio248/direction gpio output gets low. Fix driver by changing order of operations; first set direction then set value. The drawback of this new sequence is that we can have a pulse on gpio pin when direction is changed from input to output-low, but this cannot be avoided on current CP2112. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-07HID: use multi input quirk for 22b9:2968Wen-chien Jesse Sung2-0/+2
This device generates ABS_Z and ABS_RX events instead of ABS_X and ABS_Y. Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-07-03HID: gt683r: move mode attribute to led-class devicesJanne Kanniainen1-12/+24
Move led_mode attribute from HID device to led-class devices and rename it mode. This will also fix race condition by using attribute-groups. (cooloney@gmai.com: fix a typo in commit message) Signed-off-by: Janne Kanniainen <janne.kanniainen@gmail.com> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-07-03HID: gt683r: fix race conditionJanne Kanniainen1-3/+3
This will fix race condition noticed by Oliver Neukum. Sysfs files are created before mutex and work are initialized. Signed-off-by: Janne Kanniainen <janne.kanniainen@gmail.com> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-07-01HID: add support for MSI GT683R led panelsJanne Kanniainen6-2/+327
This driver adds support for USB controlled led panels that exists in MSI GT683R laptop Signed-off-by: Janne Kanniainen <janne.kanniainen@gmail.com> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-06-30HID: sensor-hub: fix potential memory leakJiri Slaby1-0/+1
hsdev is not freed in sensor_hub_probe when kasprintf inside the for loop fails. This is because hsdev is not set to platform_data yet (to be freed by the code in the err_no_mem label). So free the memory explicitly in the 'if' branch, as this is the only place where this is (and will) be needed. Reported-by: coverity Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: srinivas pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>