dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

1329 Commits

Author SHA1 Message Date
Przemo Firszt a72c5ddb67 HID: wacom: Force new name for Wacom Intuos4 WL PTK-540WL
The name reported by Inutos4 WL connected by bluetooth is "PTK-540WL" and
to make it consistent with other Wacom devices it has to be converted to
"Wacom Intuos4 WL". It also makes userland applications aware that it's
a Wacom device.

This aligns naming of device to same used when this device is plugged into USB
port and controlled by USB wacom driver; and thus helps align userland logic to
route to apps like xf86-input-wacom.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-21 12:01:34 +01:00
Ville Ranki 724ed328a1 HID: Add quirk for CH Products Fighterstick
CH Fighterstick requires HID_QUIRK_NOGET as many other CH devices do. This
patch adds device id for Fighterstick and adds necessary line to HID quirk
list.

Signed-off-by: Ville Ranki <ville.ranki@iki.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-21 11:58:29 +01:00
Denis Kovalev 2258e863b4 HID: multitouch: add support of Panasonic multitouch panels
While at it, also fix some minor codingstyle issues.

Signed-off-by: Denis Kovalev <Denis.Kovalev@dataart.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-21 11:55:45 +01:00
Chase Douglas 503f7d53b3 HID: hid-magicmouse: Add pointer and buttonpad properties for Magic Trackpad
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-21 11:52:20 +01:00
Hans Verkuil 65dd3b699f [media] hid-core: ignore the Keene FM transmitter
The Keene FM transmitter USB device has the same USB ID as
the Logitech AudioHub Speaker, but it should ignore the hid.
Check if the name is that of the Keene device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14 16:40:00 -02:00
Nikolai Kondrashov 4fdc18d151 HID: waltop: Add support for Waltop Q Pad
Add support for Waltop Q Pad by fixing its report descriptor.

This tablet is also sold as Aiptek HyperPen Mini. Other possible names
include: NGS Flexi Style, VisTablet PenPad, iVistaTablet Q Flex Pad, Bravod
Q-PD65-S.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-07 13:51:53 +01:00
Jiri Kosina 217c8b2b19 HID: wiimote: fix invalid power_supply_powers call
Analogically to d7cb3dbd1 ("HID: wacom: Fix invalid power_supply_powers
calls"), fix also the same occurence in wiimote driver.

Reported-by: przemo@firszt.eu
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-07 13:40:56 +01:00
Jiri Kosina 2701eaabd7 HID: tivo: fix broken build
Fix mismatch between Kconfig name and Makefile expectation.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 17:36:38 +01:00
Jarod Wilson 44ea35c138 HID: add support for tivo slide remote
This patch finishes off adding full support for the TiVo Slide remote,
which is a mostly pure HID device from the perspective of the kernel.
There are a few mappings that use a vendor-specific usage page, and a
few keys in the consumer usage page that I think make sense to remap
slightly, to better fit their key labels' intended use. Doing this in a
stand-alone hid-tivo.c makes the modifications only matter for this
specific device.

What's actually connected to the computer is a Broadcom-made usb dongle,
which has an embedded hub, bluetooth adapter, mouse and keyboard
devices. You pair with the dongle, then the remote sends data that its
converted into HID on the keyboard interface (the mouse interface
doesn't do anything interesting, so far as I can tell).

lsusb for this device:
Bus 004 Device 005: ID 0a5c:2190 Broadcom Corp.
Bus 004 Device 004: ID 0a5c:4503 Broadcom Corp.
Bus 004 Device 003: ID 150a:1201
Bus 004 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)

Speaking of the keyboard interface, the remote actually does contain a
keyboard as well. The top slides away, revealing a reasonably functional
qwerty keyboard (not unlike many slide cell phones), thus the product
name.

CC: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 17:35:03 +01:00
Przemo Firszt d7cb3dbd10 HID: wacom: Fix invalid power_supply_powers calls
power_supply_powers calls added in 35b4c01e2 ("power_supply: add "powers" links
to self-powered HID devices") have to be called after power device is created.
This patch also fixes the second call - it has to be "ac" instead of "battery"

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 16:14:20 +01:00
Jiri Kosina d4730ace0c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into upstream-fixes
Sync with Linus' tree. This is necessary to have a base for
patch that fixes commit 35b4c01e29 ("power_supply: add "powers"
links to self-powered HID devices") which went in through Anton's
tree.
2012-02-06 16:12:16 +01:00
Benjamin Tissoires 847672cd14 HID: multitouch: support Perixx PERIPAD 701
Perixx Peripad 701 is an hybrid device which presents a touchpad and
a keyboard on the same surface. The switch between the two is controlled
by a physical switch, and the firmware sends the events on the right
interface (mouse, keyboard or multitouch).
This patch enables the multitouch interface of this device to work.

We need to manually set the device as a trackpad (we cannot infer it
from the reports descriptors as the device works under Windows, a system
that does not allow multitouch touchpad).
We also need to set the hid feature MAX CONTACT NUMBER to 2 or the device
stops sending events once it has been pressed by two touches.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 13:22:39 +01:00
Benjamin Tissoires 31ae9bddb9 HID: multitouch: add control of the feature "Maximum Contact Number"
Some devices, like Perixx Peripad 701 do not work if the feature
"Maximum Contact Number" is not set to the right value.
This patch allows hid-multitouch to control this feature.

If the programmer fills the field maxcontacts in the mt_class,
then the driver will set the feature to this value. It is safe
for current drivers as the feature is read/write in the HID norm
and all devices should implement the norm.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 13:22:39 +01:00
Benjamin Tissoires c2ef8f21ea HID: multitouch: add support for trackpads
* some multitouch trackpads present the touch usage. This needs to be
filtered as it will conflict with mt-implementation.
* trackpads send BTN_TOOL_* to notify how many fingers are present
(this is used by xorg to use synaptics instead of generic evdev)
* trackpads like Perixx 701 are not different from a hid point of view
from a touchscreen, and we need to manually set them as touchpad.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-06 13:22:38 +01:00
Stefan Achatz bd393dbd33 HID: roccat: Only one Kconfig entry for all roccat drivers
To cleanup Kconfig space and ease selection for users there is now
a single entry that selects all roccat related drivers at once.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-05 17:22:40 +01:00
Jeremy Fitzhardinge 45d9c273b2 HID: hid-input/battery: set scope and powered device for HID battery
Set the battery's power supply scope to "Device" and point the power
supply to the powered device.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-03 23:54:58 +01:00
Jan Steinhoff 8491ee1093 Input: add Synaptics USB device driver
This patch adds a driver for Synaptics USB touchpad or pointing stick
devices. These USB devices emulate an USB mouse by default, so one can
also use the usbhid driver. However, in combination with special user
space drivers this kernel driver allows one to customize the behaviour
of the device.

An extended version of this driver with support for the cPad background
display can be found at
<http://jan-steinhoff.de/linux/synaptics-usb.html>.

Signed-off-by: Jan Steinhoff <mail@jan-steinhoff.de>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-02-03 00:25:03 -08:00
K. Y. Srinivasan c1c454b869 HID: hyperv: Properly disconnect the input device
When we unload the mouse driver, properly disconnect the input device.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Fuzhou Chen <fuzhouch@microsoft.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-02 10:56:11 +01:00
Nestor Lopez Casado 765031668f HID: logitech: fix mask to enable DJ mode
The user can only experience the bug if she pairs 6 devices to a Unifying
receiver. The sixth paired device would not work.

The value changed is actually a bitmask that enables reporting from each
paired device. As the sixth bit was not set, the sixth device reports are
ignored by the receiver and never get to the driver.

Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>

 drivers/hid/hid-logitech-dj.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-02 10:54:14 +01:00
Keng-Yu Lin 6c30d5a532 HID: add more hotkeys in Asus AIO keyboards
Add support for the camera key. The hotkey for
Asus S.H.E(Super Hybrid Engine) mode is mapped to KEY_KEY_PROG1
just for notifying the userspace.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-02 10:32:45 +01:00
Keng-Yu Lin 3596bb929f HID: add extra hotkeys in Asus AIO keyboards
The Asus All-In-One PC has a wireless keyboard with wifi toggle,
brightness up, brightness down and display off hotkeys.

This patch adds suppoort for these hotkeys.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-02 10:31:26 +01:00
Ming Lei ba18311dff HID: usbhid: fix dead lock between open and disconect
There is no reason to hold hiddev->existancelock before
calling usb_deregister_dev, so move it out of the lock.

The patch fixes the lockdep warning below.

[ 5733.386271] ======================================================
[ 5733.386274] [ INFO: possible circular locking dependency detected ]
[ 5733.386278] 3.2.0-custom-next-20120111+ #1 Not tainted
[ 5733.386281] -------------------------------------------------------
[ 5733.386284] khubd/186 is trying to acquire lock:
[ 5733.386288]  (minor_rwsem){++++.+}, at: [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386311]
[ 5733.386312] but task is already holding lock:
[ 5733.386315]  (&hiddev->existancelock){+.+...}, at: [<ffffffffa0094d17>] hiddev_disconnect+0x26/0x87 [usbhid]
[ 5733.386328]
[ 5733.386329] which lock already depends on the new lock.
[ 5733.386330]
[ 5733.386333]
[ 5733.386334] the existing dependency chain (in reverse order) is:
[ 5733.386336]
[ 5733.386337] -> #1 (&hiddev->existancelock){+.+...}:
[ 5733.386346]        [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
[ 5733.386357]        [<ffffffff813df961>] __mutex_lock_common+0x60/0x465
[ 5733.386366]        [<ffffffff813dfe4d>] mutex_lock_nested+0x36/0x3b
[ 5733.386371]        [<ffffffffa0094ad6>] hiddev_open+0x113/0x193 [usbhid]
[ 5733.386378]        [<ffffffffa0011971>] usb_open+0x66/0xc2 [usbcore]
[ 5733.386390]        [<ffffffff8111a8b5>] chrdev_open+0x12b/0x154
[ 5733.386402]        [<ffffffff811159a8>] __dentry_open.isra.16+0x20b/0x355
[ 5733.386408]        [<ffffffff811165dc>] nameidata_to_filp+0x43/0x4a
[ 5733.386413]        [<ffffffff81122ed5>] do_last+0x536/0x570
[ 5733.386419]        [<ffffffff8112300b>] path_openat+0xce/0x301
[ 5733.386423]        [<ffffffff81123327>] do_filp_open+0x33/0x81
[ 5733.386427]        [<ffffffff8111664d>] do_sys_open+0x6a/0xfc
[ 5733.386431]        [<ffffffff811166fb>] sys_open+0x1c/0x1e
[ 5733.386434]        [<ffffffff813e7c79>] system_call_fastpath+0x16/0x1b
[ 5733.386441]
[ 5733.386441] -> #0 (minor_rwsem){++++.+}:
[ 5733.386448]        [<ffffffff8108255d>] __lock_acquire+0xa80/0xd74
[ 5733.386454]        [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
[ 5733.386458]        [<ffffffff813e01f5>] down_write+0x44/0x77
[ 5733.386464]        [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386475]        [<ffffffffa0094d2d>] hiddev_disconnect+0x3c/0x87 [usbhid]
[ 5733.386483]        [<ffffffff8132df51>] hid_disconnect+0x3f/0x54
[ 5733.386491]        [<ffffffff8132dfb4>] hid_device_remove+0x4e/0x7a
[ 5733.386496]        [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
[ 5733.386502]        [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
[ 5733.386507]        [<ffffffff812c0564>] bus_remove_device+0x114/0x128
[ 5733.386512]        [<ffffffff812bdd6f>] device_del+0x131/0x183
[ 5733.386519]        [<ffffffff8132def3>] hid_destroy_device+0x1e/0x3d
[ 5733.386525]        [<ffffffffa00916b0>] usbhid_disconnect+0x36/0x42 [usbhid]
[ 5733.386530]        [<ffffffffa000fb60>] usb_unbind_interface+0x57/0x11f [usbcore]
[ 5733.386542]        [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
[ 5733.386547]        [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
[ 5733.386552]        [<ffffffff812c0564>] bus_remove_device+0x114/0x128
[ 5733.386557]        [<ffffffff812bdd6f>] device_del+0x131/0x183
[ 5733.386562]        [<ffffffffa000de61>] usb_disable_device+0xa8/0x1d8 [usbcore]
[ 5733.386573]        [<ffffffffa0006bd2>] usb_disconnect+0xab/0x11f [usbcore]
[ 5733.386583]        [<ffffffffa0008aa0>] hub_thread+0x73b/0x1157 [usbcore]
[ 5733.386593]        [<ffffffff8105dc0f>] kthread+0x95/0x9d
[ 5733.386601]        [<ffffffff813e90b4>] kernel_thread_helper+0x4/0x10
[ 5733.386607]
[ 5733.386608] other info that might help us debug this:
[ 5733.386609]
[ 5733.386612]  Possible unsafe locking scenario:
[ 5733.386613]
[ 5733.386615]        CPU0                    CPU1
[ 5733.386618]        ----                    ----
[ 5733.386620]   lock(&hiddev->existancelock);
[ 5733.386625]                                lock(minor_rwsem);
[ 5733.386630]                                lock(&hiddev->existancelock);
[ 5733.386635]   lock(minor_rwsem);
[ 5733.386639]
[ 5733.386640]  *** DEADLOCK ***
[ 5733.386641]
[ 5733.386644] 6 locks held by khubd/186:
[ 5733.386646]  #0:  (&__lockdep_no_validate__){......}, at: [<ffffffffa00084af>] hub_thread+0x14a/0x1157 [usbcore]
[ 5733.386661]  #1:  (&__lockdep_no_validate__){......}, at: [<ffffffffa0006b77>] usb_disconnect+0x50/0x11f [usbcore]
[ 5733.386677]  #2:  (hcd->bandwidth_mutex){+.+.+.}, at: [<ffffffffa0006bc8>] usb_disconnect+0xa1/0x11f [usbcore]
[ 5733.386693]  #3:  (&__lockdep_no_validate__){......}, at: [<ffffffff812c09bb>] device_release_driver+0x18/0x2d
[ 5733.386704]  #4:  (&__lockdep_no_validate__){......}, at: [<ffffffff812c09bb>] device_release_driver+0x18/0x2d
[ 5733.386714]  #5:  (&hiddev->existancelock){+.+...}, at: [<ffffffffa0094d17>] hiddev_disconnect+0x26/0x87 [usbhid]
[ 5733.386727]
[ 5733.386727] stack backtrace:
[ 5733.386731] Pid: 186, comm: khubd Not tainted 3.2.0-custom-next-20120111+ #1
[ 5733.386734] Call Trace:
[ 5733.386741]  [<ffffffff81062881>] ? up+0x34/0x3b
[ 5733.386747]  [<ffffffff813d9ef3>] print_circular_bug+0x1f8/0x209
[ 5733.386752]  [<ffffffff8108255d>] __lock_acquire+0xa80/0xd74
[ 5733.386756]  [<ffffffff810808b4>] ? trace_hardirqs_on_caller+0x15d/0x1a3
[ 5733.386763]  [<ffffffff81043a3f>] ? vprintk+0x3f4/0x419
[ 5733.386774]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386779]  [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
[ 5733.386789]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386797]  [<ffffffff813e01f5>] down_write+0x44/0x77
[ 5733.386807]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386818]  [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
[ 5733.386825]  [<ffffffffa0094d2d>] hiddev_disconnect+0x3c/0x87 [usbhid]
[ 5733.386830]  [<ffffffff8132df51>] hid_disconnect+0x3f/0x54
[ 5733.386834]  [<ffffffff8132dfb4>] hid_device_remove+0x4e/0x7a
[ 5733.386839]  [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
[ 5733.386844]  [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
[ 5733.386848]  [<ffffffff812c0564>] bus_remove_device+0x114/0x128
[ 5733.386854]  [<ffffffff812bdd6f>] device_del+0x131/0x183
[ 5733.386859]  [<ffffffff8132def3>] hid_destroy_device+0x1e/0x3d
[ 5733.386865]  [<ffffffffa00916b0>] usbhid_disconnect+0x36/0x42 [usbhid]
[ 5733.386876]  [<ffffffffa000fb60>] usb_unbind_interface+0x57/0x11f [usbcore]
[ 5733.386882]  [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
[ 5733.386886]  [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
[ 5733.386890]  [<ffffffff812c0564>] bus_remove_device+0x114/0x128
[ 5733.386895]  [<ffffffff812bdd6f>] device_del+0x131/0x183
[ 5733.386905]  [<ffffffffa000de61>] usb_disable_device+0xa8/0x1d8 [usbcore]
[ 5733.386916]  [<ffffffffa0006bd2>] usb_disconnect+0xab/0x11f [usbcore]
[ 5733.386921]  [<ffffffff813dff82>] ? __mutex_unlock_slowpath+0x130/0x141
[ 5733.386929]  [<ffffffffa0008aa0>] hub_thread+0x73b/0x1157 [usbcore]
[ 5733.386935]  [<ffffffff8106a51d>] ? finish_task_switch+0x78/0x150
[ 5733.386941]  [<ffffffff8105e396>] ? __init_waitqueue_head+0x4c/0x4c
[ 5733.386950]  [<ffffffffa0008365>] ? usb_remote_wakeup+0x56/0x56 [usbcore]
[ 5733.386955]  [<ffffffff8105dc0f>] kthread+0x95/0x9d
[ 5733.386961]  [<ffffffff813e90b4>] kernel_thread_helper+0x4/0x10
[ 5733.386966]  [<ffffffff813e24b8>] ? retint_restore_args+0x13/0x13
[ 5733.386970]  [<ffffffff8105db7a>] ? __init_kthread_worker+0x55/0x55
[ 5733.386974]  [<ffffffff813e90b0>] ? gs_change+0x13/0x13

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-02-02 09:48:00 +01:00
Alan Stern cef9bc56e1 Dynamic ID addition doesn't need get_driver()
As part of the removal of get_driver()/put_driver(), this patch
(as1511) changes all the places that add dynamic IDs for drivers.
Since these additions are done by writing to the drivers' sysfs
attribute files, and the attributes are removed when the drivers are
unregistered, there is no reason to take an extra reference to the
drivers.

The one exception is the pci-stub driver, which calls pci_add_dynid()
as part of its registration.  But again, there's no reason to take an
extra reference here, because the driver can't be unloaded while it is
being registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Jiri Kosina <jkosina@suse.cz>
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-24 16:00:35 -08:00
Rusty Russell 90ab5ee941 module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-13 09:32:20 +10:30
Linus Torvalds b24ca57e76 Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6: (68 commits)
  power_supply: Mark da9052 driver as broken
  power_supply: Drop usage of nowarn variant of sysfs_create_link()
  s3c_adc_battery: Average over more than one adc sample
  power_supply: Add DA9052 battery driver
  isp1704_charger: Fix missing check
  jz4740-battery: Fix signedness bug
  power_supply: Assume mains power by default
  sbs-battery: Fix devicetree match table
  ARM: rx51: Add bq27200 i2c board info
  sbs-battery: Change power supply name
  devicetree-bindings: Propagate bq20z75->sbs rename to dt bindings
  devicetree-bindings: Add vendor entry for Smart Battery Systems
  sbs-battery: Rename internals to new name
  bq20z75: Rename to sbs-battery
  wm97xx_battery: Use DEFINE_MUTEX() for work_lock
  max8997_charger: Remove duplicate module.h
  lp8727_charger: Some minor fixes for the header
  lp8727_charger: Add header file
  power_supply: Convert drivers/power/* to use module_platform_driver()
  power_supply: Add "unknown" in power supply type
  ...
2012-01-11 18:53:05 -08:00
Linus Torvalds f62f61917d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits)
  hid-input/battery: add FEATURE quirk
  hid-input/battery: remove battery_val
  hid-input/battery: power-supply type really *is* a battery
  hid-input/battery: make the battery setup common for INPUTs and FEATUREs
  hid-input/battery: deal with both FEATURE and INPUT report batteries
  hid-input/battery: add quirks for battery
  hid-input/battery: remove apparently redundant kmalloc
  hid-input: add support for HID devices reporting Battery Strength
  HID: hid-multitouch: add support 9 new Xiroku devices
  HID: multitouch: add support for 3M 32"
  HID: multitouch: add support of Atmel multitouch panels
  HID: usbhid: defer LED setting to a workqueue
  HID: usbhid: hid-core: submit queued urbs before suspend
  HID: usbhid: remove LED_ON
  HID: emsff: use symbolic name instead of hardcoded PID constant
  HID: Enable HID_QUIRK_MULTI_INPUT for Trio Linker Plus II
  HID: Kconfig: fix syntax
  HID: introduce proper dependency of HID_BATTERY on POWER_SUPPLY
  HID: multitouch: support PixArt optical touch screen
  HID: make parser more verbose about parsing errors by default
  ...

Fix up rename/delete conflict in drivers/hid/hid-hyperv.c (removed in
staging, moved in this branch) and similarly for the rules for same file
in drivers/staging/hv/{Kconfig,Makefile}.
2012-01-10 10:48:28 -08:00
Jiri Kosina 420174afdc Merge branch 'hid-battery' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen into for-linus 2012-01-09 11:24:59 +01:00
Linus Torvalds 98793265b4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
  Kconfig: acpi: Fix typo in comment.
  misc latin1 to utf8 conversions
  devres: Fix a typo in devm_kfree comment
  btrfs: free-space-cache.c: remove extra semicolon.
  fat: Spelling s/obsolate/obsolete/g
  SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
  tools/power turbostat: update fields in manpage
  mac80211: drop spelling fix
  types.h: fix comment spelling for 'architectures'
  typo fixes: aera -> area, exntension -> extension
  devices.txt: Fix typo of 'VMware'.
  sis900: Fix enum typo 'sis900_rx_bufer_status'
  decompress_bunzip2: remove invalid vi modeline
  treewide: Fix comment and string typo 'bufer'
  hyper-v: Update MAINTAINERS
  treewide: Fix typos in various parts of the kernel, and fix some comments.
  clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
  gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
  leds: Kconfig: Fix typo 'D2NET_V2'
  sound: Kconfig: drop unknown symbol ARCH_CLPS7500
  ...

Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
kconfig additions, close to removed commented-out old ones)
2012-01-08 13:21:22 -08:00
Linus Torvalds 972b2c7199 Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
  reiserfs: Properly display mount options in /proc/mounts
  vfs: prevent remount read-only if pending removes
  vfs: count unlinked inodes
  vfs: protect remounting superblock read-only
  vfs: keep list of mounts for each superblock
  vfs: switch ->show_options() to struct dentry *
  vfs: switch ->show_path() to struct dentry *
  vfs: switch ->show_devname() to struct dentry *
  vfs: switch ->show_stats to struct dentry *
  switch security_path_chmod() to struct path *
  vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
  vfs: trim includes a bit
  switch mnt_namespace ->root to struct mount
  vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
  vfs: opencode mntget() mnt_set_mountpoint()
  vfs: spread struct mount - remaining argument of next_mnt()
  vfs: move fsnotify junk to struct mount
  vfs: move mnt_devname
  vfs: move mnt_list to struct mount
  vfs: switch pnode.h macros to struct mount *
  ...
2012-01-08 12:19:57 -08:00
Jeremy Fitzhardinge 652aa6a9ac hid-input/battery: add FEATURE quirk
Apple keyboards require a FEATURE report to query the battery state,
even though they list as an input.  Without this, it returns an error.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:31:25 +11:00
Jeremy Fitzhardinge ce63920b39 hid-input/battery: remove battery_val
hidinput_get_battery_property() now directly polls the device for the
current battery strength, so there's no need for battery_val, or the
code to set it on the input event path.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:31:18 +11:00
Jeremy Fitzhardinge b3ca3839f3 hid-input/battery: power-supply type really *is* a battery
It just isn't a battery which is powering the computer.  upower needs
a more nuanced understanding of this.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:30:39 +11:00
Jeremy Fitzhardinge 2f2e3f6d7a hid-input/battery: make the battery setup common for INPUTs and FEATUREs
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:30:38 +11:00
Jeremy Fitzhardinge fb8ac91b4d hid-input/battery: deal with both FEATURE and INPUT report batteries
Some devices seem to report batteries as FEATUREs, others as INPUTs.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:30:37 +11:00
Jeremy Fitzhardinge bbc21cfd55 hid-input/battery: add quirks for battery
Some devices always report percentage, despite having 0/255 as their
min/max, so add a quirk for them.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:30:37 +11:00
Jeremy Fitzhardinge ef5251993c hid-input/battery: remove apparently redundant kmalloc
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2012-01-08 18:30:36 +11:00
Daniel Nicoletti c5a92aa3eb hid-input: add support for HID devices reporting Battery Strength
I've sent an email earlier asking for help with a GetFeature code, and now I
have a second patch on top of Jeremy's to provide the battery functionality
for devices that support reporting it.

If I understood correctly when talking to Jeremy he said his device
never actually reported the status as an input event (sorry if I didn't
understand it correctly), and after reading HID specs I believe it's
really because it was meant to be probed, I have an Apple Keyboard and
Magic Trackpad both bluetooth batteries operated, so using PacketLogger
I saw that Mac OSX always ask the battery status using the so called
GetFeature.

What my patch does is basically:
- store the report id that matches the battery_strength
- setup the battery if 0x6.0x20 is found, even if that is reported as a feature
  (as it was meant to be but only the MagicTrackpad does)
- when upower or someone access /sys/class/power_supply/hid-*/capacity it
  will probe the device and return it's status.

It works great for both devices, but I have two concerns:
- the report_features function has a duplicated code
- it would be nice if it was possible for specific drivers to provide their own
  probe as there might be some strange devices... (but maybe it's
already possible)

I've talked to the upower dev and he fixed it to be able to show the
right percentage.

Here how the uevent file (in /sys/class/power_supply/hid-*/) looks like:
POWER_SUPPLY_NAME=hid-00:22:41:D9:18:E7-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=66
POWER_SUPPLY_MODEL_NAME=MacAdmin’s keyboard
POWER_SUPPLY_STATUS=Discharging

POWER_SUPPLY_NAME=hid-70:CD:60:F5:FF:3F-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=62
POWER_SUPPLY_MODEL_NAME=nexx’s Trackpad
POWER_SUPPLY_STATUS=Discharging

Signed-off-by: Daniel Nicoletti <dantti12@gmail.com>
2012-01-08 18:30:34 +11:00
Greg Kroah-Hartman ff4b8a57f0 Merge branch 'driver-core-next' into Linux 3.2
This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
and it fixes the build error in the arch/x86/kernel/microcode_core.c
file, that the merge did not catch.

The microcode_core.c patch was provided by Stephen Rothwell
<sfr@canb.auug.org.au> who was invaluable in the merge issues involved
with the large sysdev removal process in the driver-core tree.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-06 11:42:52 -08:00
Jiri Kosina e027372856 Merge branches 'hyperv', 'multitouch', 'roccat', 'upstream', 'upstream-fixes', 'wacom' and 'wiimote' into for-linus 2012-01-05 15:51:02 +01:00
Masatoshi Hoshikawa 11576c6114 HID: hid-multitouch: add support 9 new Xiroku devices
This patch adds support for the Xiroku Inc. panels (SPX/MPX/CSR/etc.).

Signed-off-by: Masatoshi Hoshikawa <hoshikawa@xiroku.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-05 15:49:21 +01:00
Al Viro 2c9ede55ec switch device_get_devnode() and ->devnode() to umode_t *
both callers of device_get_devnode() are only interested in lower 16bits
and nobody tries to return anything wider than 16bit anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-03 22:54:55 -05:00
Al Viro d36b691077 misc latin1 to utf8 conversions
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-02 13:04:55 +01:00
Benjamin Tissoires c4fad877cd HID: multitouch: add support for 3M 32"
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-02 11:10:56 +01:00
Benjamin Tissoires b105712469 HID: multitouch: add support of Atmel multitouch panels
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-01-02 11:10:36 +01:00
Daniel Kurtz 4371ea8202 HID: usbhid: defer LED setting to a workqueue
Defer LED setting action to a workqueue.
This is more likely to send all LED change events in a single URB.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-21 11:18:35 +01:00
Daniel Kurtz f0befcd64b HID: usbhid: hid-core: submit queued urbs before suspend
If any userspace program has opened a keyboard device, the input core
de-activates the keyboard's LEDs upon suspend().  It does this by sending
individual EV_LED[LED_X]=0 events to the underlying device driver by
directly calling the driver's registered event() handler.

The usb-hid driver event() handler processes each request by immediately
attempting to submit a CTRL URB to turn off the LED.  USB URB submission
is asynchronous.  First the URB is added to the head of the ctrl queue.
Then, if the CTRL_RUNNING flag is false, the URB is submitted immediately
(and CTRL_RUNNING is set).  If the CTRL_RUNNING flag was already true,
then the newly queued URB is submitted in the ctrl completion handler when
all previously submitted URBs have completed.  When all queued URBs have
been submitted, the completion handler clears the CTRL_RUNNING flag.

In the 2-LED suspend case, at input suspend(), 2 LED event CTRL URBs get
queued, with only the first actually submitted.  Soon after input
suspend() handler finishes, the usb-hid suspend() handler gets called.
Since this is NOT a PM_EVENT_AUTO suspend, the handler sets
REPORTED_IDLE, then waits for io to complete.

Unfortunately, this usually happens while the first LED request is
actually still being processed.  Thus when the completion handler tries
to submit the second LED request it fails, since REPORTED_IDLE is
already set!  This REPORTED_IDLE check failure causes the completion
handler to complete, however without clearing the CTRL_RUNNING flag.
This, in turn, means that the suspend() handler's wait_io() condition
is never satisfied, and instead it times out after 10 seconds, aborting
the original system suspend.

This patch changes the behavior to the following:
  (1) allow completion handler to finish submitting all queued URBs, even if
      REPORTED_IDLE is set.  This guarantees that all URBs queued before the
      hid-core suspend() call will be submitted before the system is
      suspended.
  (2) if REPORTED_IDLE is set and the URB queue is empty, queue, but
      don't submit, new URB submission requests.  These queued requests get
      submitted when resume() flushes the URB queue. This is similar to the
      existing behavior, however, any requests that arrive while the queue is
      not yet empty will still get submitted before suspend.
  (3) set the RUNNING flag when flushing the URB queue in resume().
      This keeps URBs that were queued in (2) from colliding with any new
      URBs that are being submitted during the resume process.  The new URB
      submission requests upon resume get properly queued behind the ones
      being flushed instead of the current situation where they collide,
      causing memory corruption and oopses.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-21 11:18:35 +01:00
Daniel Kurtz ede6a8b239 HID: usbhid: remove LED_ON
LED_ON was defined in the original version of the hid-core autosuspend patch.
However, during review, the setting and clearing of it was redone
using ledcount.  The test was left in accidentally.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-21 11:18:35 +01:00
Jiri Kosina 05ee283879 HID: emsff: use symbolic name instead of hardcoded PID constant
Use macro instead of 0x118 PID in device table.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-21 00:29:19 +01:00
Ignaz Forster cd07655e73 HID: Enable HID_QUIRK_MULTI_INPUT for Trio Linker Plus II
Add quirk for the Trio Linker Plus II - the adapter supports several
controllers simultaneously, generating a new HID entry for each connected
device.

Signed-off-by: Ignaz Forster <ignaz.forster@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-21 00:25:33 +01:00
Jiri Kosina d66c266ad4 HID: Kconfig: fix syntax
Replace mistakenly used '==' by '='.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-19 09:16:29 +01:00
Jiri Kosina 7e69ba7cae HID: introduce proper dependency of HID_BATTERY on POWER_SUPPLY
ppc6xx_defconfig reveals this:

drivers/built-in.o: In function `hidinput_cleanup_battery': drivers/hid/hid-input.c:351: undefined reference to`power_supply_unregister'
drivers/built-in.o: In function `hidinput_setup_battery': drivers/hid/hid-input.c:338: undefined reference to `power_supply_register'
make[1]: *** [.tmp_vmlinux1] Error 1

The defconfig in question doens't mention either option and kbuild is
genertaing

	CONFIG_HID_BATTERY_STRENGTH=y
	CONFIG_POWER_SUPPLY=m

which is wrong. Put a proper dependency in place.

Reported-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-16 23:35:55 +01:00
Aaron Tian b7ea95ff9b HID: multitouch: support PixArt optical touch screen
This patch modifies hid-multitouch driver for supporting PixArt optical touch
screen.  Because of the device does not have to set initial report, we apply
"HID_QUIRK_NO_INIT_REPORTS" quirk and add the device into hid_blacklist[]

Signed-off-by: Aaron Tian <aaron_tian@pixart.com.tw>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-15 11:13:41 +01:00
Jiri Kosina 8c3d52fc39 HID: make parser more verbose about parsing errors by default
Most of the parsing errors (typically resulting in device not being claimed
by HID subsystem at all) are reported only in debugging mode, which makes
root-causing problems with buggy devices unnecessarily more difficult.

Convert reporting of important HID report descriptor parsing errors to
be reported through hid_err() / hid_warn() instead of dbg_hid().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-15 11:00:38 +01:00
David Herrmann ef6f41157f HID: wiimote: Select INPUT_FF_MEMLESS
We depend on memless force-feedback support, therefore correctly select the
related config options.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-12 00:27:21 +01:00
Jeremy Fitzhardinge 35b4c01e29 power_supply: add "powers" links to self-powered HID devices
Make the relationship between the Wiimote and Wacom self-powered HID
devices and their power supply explicit by adding a "powers" link.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jiri Kosina <jkosina@suse.cz>
2011-12-09 09:54:17 -08:00
Jeremy Fitzhardinge 73db88137b power_supply: add scope properties to some self-powered HID devices
The Wacom and Wiimote HID drivers register power supplies for themselves
to indicate their battery levels.  Make those power supplies device scope.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jiri Kosina <jkosina@suse.cz>
2011-12-09 09:53:42 -08:00
Stefan Achatz d41c2a7011 HID: roccat: Add support for Isku keyboard
This patch adds support for Roccat Isku keyboard.
Userland tools can be found at http://sourceforge.net/projects/roccat

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-06 10:21:10 +01:00
Linus Torvalds 7ed89aed2b Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Correct General touch PID
2011-12-02 08:25:46 -08:00
K. Y. Srinivasan 74c4fb0580 HID: hv_mouse: Properly add the hid device
We need to properly add the hid device to correctly initialize the sysfs state.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Fuzhou Chen <fuzhouch@microsoft.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-01 20:53:57 +01:00
Benjamin Tissoires 545803651d HID: hid-multitouch: add support for new Hanvon panels
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-30 15:38:23 +01:00
Benjamin Tissoires 5e7ea11f60 HID: multitouch: merge quanta driver into hid-multitouch
This patch merge the last old-style hid multitouch driver to
the generic one.
It also adds 2 more quanta pids.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-30 15:32:18 +01:00
Jeremy Fitzhardinge 6720079578 HID: hid-input: fix compile for !HID_BATTERY_STRENGTH
As reported by Stephen Rothwell:
drivers/hid/hid-input.c: In function 'hidinput_hid_event':
drivers/hid/hid-input.c:865:6: error: 'struct hid_device' has no member
named 'battery_val'
drivers/hid/hid-input.c:866:3: error: 'struct hid_device' has no member
named 'battery_min'
drivers/hid/hid-input.c:866:3: error: 'struct hid_device' has no member
named 'battery_max'

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-30 14:42:08 +01:00
Jeremy Fitzhardinge 4f5ca836be HID: hid-input: add support for HID devices reporting Battery Strength
Some HID devices, such as my Bluetooth mouse, report their battery
strength as an event.  Rather than passing it through as a strange
absolute input event, this patch registers it with the power_supply
subsystem as a battery, so that the device's Battery Strength can be
reported to usermode.

The battery appears in sysfs names
/sys/class/power_supply/hid-<UNIQ>-battery, and it is a child of the
battery-containing device, so it should be clear what it's the battery of.

Unfortunately on my current Fedora 16 system, while the battery does
appear in the UI, it is listed as a Laptop Battery with 0% charge (since
it ignores the "capacity" property of the battery and instead computes
it from the "energy*" fields, which we can't supply given the limited
information contained within the HID Report).

Still, this patch is the first step.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-28 11:10:22 +01:00
Benjamin Tissoires b1807719f6 HID: Correct General touch PID
Genera Touch told us that 0001 is their single point device
and 0003 is the multitouch one. Apparently, we made the tests
someone having a prototype, and not the final product.
They said it should be safe to do the switch.

This partially reverts 5572da0 ("HID: hid-mulitouch: add support
for the 'Sensing Win7-TwoFinger'").

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:53:53 +01:00
Benjamin Tissoires 1b723e8dc8 HID: multitouch: correct eGalax a001 protocol
This device use another protocol while sending the events.
It's the same as the one described as "serial" by Microsoft.
We are keeping here the sn_move and sn_pressure parameters for
egalax devices.

CC: Cedric Sodhi <manday@gmx.net>
CC: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:39 +01:00
Benjamin Tissoires 66f06127f3 HID: multitouch: add support for the MSI Windpad 110W
Just another eGalax device.
Please note that adding this device to have_special_driver
in hid-core.c is not required anymore.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:39 +01:00
Marek Vasut bb9ff21072 HID: multitouch: Add egalax ID for Acer Iconia W500
This patch adds USB ID for the touchpanel in Acer Iconia W500. The panel
supports up to five fingers, therefore the need for a new addition of panel
types.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:39 +01:00
Benjamin Tissoires e36f690b37 HID: multitouch: cleanup with eGalax PID definitions
This is just a renaming of USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH{N}
to USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_{PID} to handle more eGalax
devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:38 +01:00
Benjamin Tissoires 26a2abe1e1 HID: multitouch: remove .maxcontacts field for eGalax
Some eGalax devices are 4 or 5 fingers touches, wereas others are 2.
This patch removes the limit in which all eGalax presents 2 touches.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:38 +01:00
Benjamin Tissoires 2261bb9ff0 HID: multitouch: cleanup eGalax quirks
The previous implementation of eGalax protocol was not satisfying as
we had to manually set x/y ranges as they were corrupted after reading
the report descriptor.
Indeed, the report descriptor provided a stylus input interface which
override the correct values.

This patch omits this input, thus leaving the correct value untouched,
and the MT_QUIRK_EGALAX_XYZ_FIXUP not required anymore.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:38 +01:00
Benjamin Tissoires eec29e3dab HID: multitouch: create sysfs attribute to control quirks from user-space
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:38 +01:00
Chris Bagwell 1fd8f04749 HID: hid-multitouch - add another eGalax id
This allows ASUS Eee Slate touchscreens to work.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 14:50:37 +01:00
Willem Penninckx a2b2c20ba2 HID: usbkbd: kill LED URB on disconnect
The LED URB was left unkilled when the USB device is disconnected.

Signed-off-by: Willem Penninckx <willem.penninckx@cs.kuleuven.be>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 12:31:04 +01:00
Willem Penninckx c196adf875 HID: usbkbd: synchronize LED URB submission
usb_kbd_event() and usb_kbd_led() can be called concurrently, but they are not
synchronized. They both readwrite kbd->leds, and usb_kbd_event() originally just
checked the URB status field, while urb.h states that "It [status field] should
not be examined before the URB is returned to the completion handler."

To fix this unsynchronized behavior, this patch introduces a boolean
representing whether the URB is submitted, and a spinlock.

Signed-off-by: Willem Penninckx <willem.penninckx@cs.kuleuven.be>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-23 12:30:25 +01:00
Jiri Kosina f2c4826c68 HID: picolcd: make fb_pending_lock and picolcd_fb_cleanup static
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:25:28 +01:00
Jiri Kosina b3c21d2cad HID: multitouch: make struct mt_classess static
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:23:37 +01:00
David Herrmann 90120d6697 HID: wiimote: Enable NO_INIT_REPORTS quirk
Newer bluetooth stack supports the NO_INIT_REPORTS quirk. The wiimote does not
support report initialization so enable it by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:11:34 +01:00
David Herrmann 130a69b9eb HID: wiimote: Remove module version number
The version number is not needed at all for in-tree drivers. Upstream git is
used to track module versions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:11:19 +01:00
David Herrmann 43d782ae80 HID: wiimote: Allow direct DRM debug access
Keep track of current drm and add new debugfs file which reads or writes the
current DRM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:11:10 +01:00
David Herrmann 1d3452c63d HID: wiimote: Allow direct eeprom access
The wiimote provides direct access to parts of its eeprom. This implements read
support for small chunks of the eeprom. This isn't very fast but prevents the
reader from blocking the wiimote stream for too long.

Write support is not yet supported as the wiimote breaks if we overwrite its
memory. Use hidraw to reverse-engineer the eeprom before implementing write
support here.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:10:58 +01:00
David Herrmann 43e5e7c60e HID: wiimote: Add debugfs support stubs
Add initializer and deinitializer for debugfs support. This will later allow raw
eeprom access and direct DRM modifications to debug wiimote behaviour and
further protocol reverse-engineerings.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:10:26 +01:00
David Herrmann 5906215bab HID: wiimote: Parse classic controller data
Nintendo Classic Controller extension reports lots of keys, two analog sticks
and two analog buttons. We report all data through extension input device to
userspace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:10:10 +01:00
David Herrmann a53535014b HID: wiimote: Parse nunchuck data
The Nintendo Nunchuck extension reports accelerometer values, one analog stick
and two buttons. See inline comments for data layout.
We report all data to userspace through extension input device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:09:56 +01:00
David Herrmann b17b57a5d0 HID: wiimote: Parse motion+ data
Motion+ reports rotation gyro data which we report to userspace as ABS_RX/Y/Z
values. The device reports them either in fast or slow mode. We adjust the
values to get a linear scale so userspace does not need to know about slow and
fast mode.

The motion+ also reports whether an extension is connected to it. We keep track
of this value and reinitialize the extensions if an extension is plugged or
unplugged.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:09:45 +01:00
David Herrmann 0b6815d75d HID: wiimote: Add extension handler stubs
All supported extensions report data as 6 byte block. All DRMs with extension
data provide at least 6 extension bytes. Hence a generic handler for all
extension bytes is sufficient and can be called on all DRMs.

The handler distinguishes the input and passes it to the right handler. Motion+
passes data interleaved so we can have Motion+ and a regular extension enabled
simultaneously.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:09:34 +01:00
David Herrmann 479901ba18 HID: wiimote: Register input devices for extensions
Motion+ and regular extensions are physical adapters for the wiimote so create
one input device for each of them. This also allows to enable only opened
extensions and turn unused extenions off to save battery power.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:09:23 +01:00
David Herrmann c1e51398a1 HID: wiimote: Add extension sysfs attribute
Add new sysfs attribute "extension" which returns the currently connected and
initialized extensions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:09:08 +01:00
David Herrmann 492ba955c1 HID: wiimote: Add extension initializers
The wiimote extension registers are not fully understood, so we always disable
all extensions on extension-port events. Then we reinitialize and reidentify
them and activate all requested extensions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:08:55 +01:00
David Herrmann 82fb1b3958 HID: wiimote: Add extension initializer stubs
Add stub functions to read and identify extensions and then initialize all
connected extensions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:08:40 +01:00
David Herrmann cb99221ba7 HID: wiimote: Add extension support stub
The wiimote supports several extensions. This adds a separate source file which
handles all extensions and can be disabled at compile-time.

The driver reacts on "plug"-events on the extension port and starts a worker
which initializes or deinitializes the extensions.

Currently, the initialization logic is not fully understood and we can only
detect and enable all extensions when all extensions are deactivated. Therefore,
we need to disable all extensions, then detect and activate them again to react
on "plug"-events.
However, deactivating extensions will generate a new "plug"-event and we will
never leave that loop. Hence, we only support extensions if they are plugged
before the wiimote is connected (or before the ext-input device is opened). In
the future we may support full extension hotplug support, but
reverse-engineering this may take a while.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:08:28 +01:00
David Herrmann fad8c0e343 HID: wiimote: Add read-mem helpers
Add helper functions similar to the write-mem helpers but for reading wiimote
memory and eeprom.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:08:09 +01:00
David Herrmann 7e27440062 HID: wiimote: Move common symbols into header
Wiimote extension and sound support need access to several symbols so move them
into a new header.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:07:53 +01:00
David Herrmann 192a1acfbd HID: wiimote: Rename driver to allow multiple source files
Extension and sound support for the wiimote are quite complex and will be
implemented in separate source files. Hence rename the current driver to "-core"
suffix so multiple files can be linked into this module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 23:06:31 +01:00
Jiri Kosina 6cf851d803 HID: hyperv: fixup Kconfig / Makefile entries
Rename the Kconfig entry for hyperv mouse driver so that it has
HID_ prefix as all the other drivers; while at it, place the entry
for this driver to properly ordered place in Makefile and Kconfig.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 22:52:15 +01:00
K. Y. Srinivasan b95f5bcb81 HID: Move the hid-hyperv driver out of staging
The file  hid-hyperv.c implements a hid compliant mouse driver for use on a
Hyper-V based system. This driver is currently in the staging area and as part
of the effort to move this driver out of staging, I had posted the driver code
for community review a few weeks ago. This current patch addresses all the
review comments I have gotten to date. All the relevant patches have already
been submitted to the staging tree as well.

As per Greg's suggestion, this patch does not get rid of the code from
the staging area. Once the mouse driver lands under the hid directory,
we will cleanup the staging directory.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-22 22:48:41 +01:00
Dan Delaney 789aaa2ee0 HID/usbled: add support for Dream Cheeky DL100B Mailbox Friends Alert
Adding support for Dream Cheeky DL1800B Friend Alert device.

Signed-off-by: Dan Delaney <drdelaney@loclhst.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-20 10:21:30 +01:00
Thomas Meyer 4c33a885a5 HID: roccat: Use kmemdup rather than duplicating its implementation
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-20 00:42:42 +01:00
Jeremy Fitzhardinge 1f59169e19 HID: debugfs: decode Generic Device Controls Usage Page
The USB HID Usage Tables spec defines page 6 for Generic Device Controls, the
most useful of which (to me) is Battery Strength.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-19 12:19:00 +01:00
Greg Kroah-Hartman 42f06a1344 USB: convert drivers/hid/* to use module_usb_driver()
This converts the drivers in drivers/hid/* to use the
module_usb_driver() macro which makes the code smaller and a bit
simpler.

Added bonus is that it removes some unneeded kernel log messages about
drivers loading and/or unloading.

Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-18 09:49:34 -08:00
Jiri Kosina b4b583d4e9 HID: be more strict when ignoring out-of-range fields
HID 1.11 specification, section 5.10 tells us:

	HID class devices support the ability to ignore selected fields in a
	report at run- time. This is accomplished by declaring bit field in a
	report that is capable of containing a range of values larger than
	those actually generated by the control. If the host or the device
	receives an out-of-range value then the current value for the
	respective control will not be modified.

So we shouldn't be restricted to EV_ABS only.

Reported-by: Denilson Figueiredo de Sá <denilsonsa@gmail.com>
Tested-by: Denilson Figueiredo de Sá <denilsonsa@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-16 15:00:31 +01:00
Jiri Kosina 6da7066906 HID: ignore absolute values which don't fit between logical min and max
Linux should ignore values outside logical min/max range, as they are not
meaningful. This is what at least some of other OSes do, and it also makes
sense (currently the value gets misinterpreted larger up the stack).

Reported-by: Denilson Figueiredo de Sá <denilsonsa@gmail.com>
Tested-by: Denilson Figueiredo de Sá <denilsonsa@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-16 15:00:31 +01:00
Chase Douglas e46e927b9b HID: bump maximum global item tag report size to 96 bytes
This allows the latest N-Trig devices to function properly.

BugLink: https://bugs.launchpad.net/bugs/724831

Cc: stable@vger.kernel.org
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-16 14:52:10 +01:00
Przemo Firszt 78761ff9bc HID: wacom: Initial driver for Wacom Intuos4 Wireless (Bluetooth)
This is very basic driver for Wacom Intuos4 Wireless tablet. It supports only
position, pressure and pen buttons. More features will be added in the future.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-13 21:32:52 +01:00
Przemo Firszt f6b7efc162 HID: wacom: Move parsing to a separate function
This patch doesn't change the way driver works. Parsing logic is now in a
separate function. It's a first step to add Intuos4 Wireless support to
hid-wacom driver.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-13 21:32:46 +01:00
Thomas Meyer 8383c6bf93 HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless
Casting (void *) value returned by kmalloc is useless
as mentioned in Documentation/CodingStyle, Chap 14.

The semantic patch that makes this change is available
in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-11 15:09:29 +01:00
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Linus Torvalds 21404b772a hid/apple: modern macbook airs use the standard apple function key translations
This removes the use of the special "macbookair_fn_keys" keyboard
translation table for the MacBookAir4,x models (ie the 2011 refresh).
They use the standard apple_fn_keys[] translation.  Apparently only the
old MacBook Air's need a different translation table.

This mirrors the change that commit da617c7cb9 ("HID: consolidate
MacbookAir 4,1 mappings") did for the WELLSPRING6A ones, but does it for
the WELLSPRING6 model used on the MacBookAir4,2.

Reported-and-tested-by: Dirk Hohndel <hohndel@infradead.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Joshua V Dillon <jvdillon@gmail.com>
Cc: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-06 18:34:03 -08:00
Linus Torvalds 30307c69d5 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  Revert "HID: multitouch: decide if hid-multitouch needs to handle mt devices"
  HID: drivers/hid/hid-roccat.c: eliminate a null pointer dereference
  HID: hid-apple: add device ID of another wireless aluminium
  HID: Add device IDs for Macbook Pro 8 keyboards
2011-11-03 07:53:22 -07:00
Henrik Rydberg d682bd7f38 Revert "HID: multitouch: decide if hid-multitouch needs to handle mt devices"
This reverts commit 0db3bfc72a (""HID: multitouch: decide if hid-multitouch
needs to handle mt devices").

The generic detection of hid-mt devices has two major flaws, and was
merged prematurely. Firstly, the hid-multitouch gets loaded even when
the device is handled by a special device. Secondly, the patch only
partially duplicates the device whitelist already present in hid-core,
effectively rendering a number of devices non-functional.

Reported-by: Sean Young <sean@mess.org>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-01 15:26:31 +01:00
Julia Lawall 8052ee5f5f HID: drivers/hid/hid-roccat.c: eliminate a null pointer dereference
It is not possible to take the lock in device if device is NULL.
The mutex_lock is thus moved after the NULL test.  New error handling
labels are added at the end to differentiate between the cases where
different sets of locks should be unlocks, and between whether or not
reader should be freed (only on error).

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

if (E == NULL)
{
  ... when != if (E == NULL || ...) S1 else S2
      when != E = E1
*E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-01 15:13:08 +01:00
Paul Gortmaker ec37d321b9 hid: Fix up files needing export.h for EXPORT_SYMBOL
With module.h being implicitly everywhere via device.h, the absence
of explicitly including something for EXPORT_SYMBOL went unnoticed.
Since we are heading to fix things up and clean module.h from the
device.h file, we need to explicitly include these files now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:18 -04:00
Paul Gortmaker 8f86a2c3cb hid: Add module.h to fix up implicit users of it
A pending cleanup will mean that module.h won't be implicitly
everywhere anymore.  Make sure the modular drivers in clocksource
are actually calling out for <module.h> explicitly in advance.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:17 -04:00
Andreas Krist ad734bc156 HID: hid-apple: add device ID of another wireless aluminium
I've recently bought a Apple wireless aluminum keyboard (model 2011) which is
not yet supported by the kernel - it seems they just changed the device id.
After applying the attached patch, the device is fully functional.

Signed-off-by: Andreas Krist <andreas.krist@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-28 18:54:56 +02:00
Gökçen Eraslan 213f9da805 HID: Add device IDs for Macbook Pro 8 keyboards
This patch adds keyboard support for Macbook Pro 8 models which has
WELLSPRING5A model name and 0x0252, 0x0253 and 0x0254 USB IDs. Trackpad
support for those models are added to bcm5974 in
c331eb580a ("Input: bcm5974 - Add
support for newer MacBookPro8,2).

Signed-off-by: Gökçen Eraslan <gokcen@pardus.org.tr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-28 17:42:49 +02:00
Linus Torvalds 7e0bb71e75 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits)
  PM / Clocks: Remove redundant NULL checks before kfree()
  PM / Documentation: Update docs about suspend and CPU hotplug
  ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist.
  ARM: mach-shmobile: sh7372 A4R support (v4)
  ARM: mach-shmobile: sh7372 A3SP support (v4)
  PM / Sleep: Mark devices involved in wakeup signaling during suspend
  PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image
  PM / Hibernate: Do not initialize static and extern variables to 0
  PM / Freezer: Make fake_signal_wake_up() wake TASK_KILLABLE tasks too
  PM / Hibernate: Add resumedelay kernel param in addition to resumewait
  MAINTAINERS: Update linux-pm list address
  PM / ACPI: Blacklist Vaio VGN-FW520F machine known to require acpi_sleep=nonvs
  PM / ACPI: Blacklist Sony Vaio known to require acpi_sleep=nonvs
  PM / Hibernate: Add resumewait param to support MMC-like devices as resume file
  PM / Hibernate: Fix typo in a kerneldoc comment
  PM / Hibernate: Freeze kernel threads after preallocating memory
  PM: Update the policy on default wakeup settings
  PM / VT: Cleanup #if defined uglyness and fix compile error
  PM / Suspend: Off by one in pm_suspend()
  PM / Hibernate: Include storage keys in hibernation image on s390
  ...
2011-10-25 15:18:39 +02:00
Jiri Kosina b3aec7b686 Merge branch 'upstream' into for-linus
Conflicts:
	drivers/hid/hid-core.c
	drivers/hid/hid-ids.h
2011-10-25 09:59:04 +02:00
Jiri Kosina f6f1242784 Merge branch 'upstream-fixes' into for-linus
Conflicts:
	drivers/hid/hid-wacom.c
2011-10-25 09:58:12 +02:00
Jiri Kosina b0eae38ceb Merge branches 'acrux', 'logitech', 'multitouch', 'roccat' and 'wiimote' into for-linus 2011-10-25 09:54:16 +02:00
Daniel van Vugt bca621421c HID: hid-magicmouse: Magic Trackpad has 1 button, not 2
hid-magicmouse was advertising the Apple Magic Trackpad as having 2
buttons (left and right) when it actually only has 1 button.

Advertising multiple buttons makes Xorg disable all button 2 and 3
emulation (using multi-finger clicks). So Xorg users don't get working
right/middle-click emulation out of the box.

This patch makes hid-magicmouse correctly only report one real button
for Magic Trackpad, which in turn makes Xorg enable multi-finger click
support to emulate right/middle buttons.

[http://launchpad.net/bugs/862094]

Signed-off-by: Daniel van Vugt <vanvugt@gmail.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-21 10:13:55 +02:00
Sean Young 1bcc20675a HID: Add device IDs for more SJOY adapters
Support the following models: Super Joy Box 3 Pro, Super Dual Box Pro
and Super Joy Box 5 Pro. These models have support for pressure
sensitive buttons and they can force the controller to either digital
or analog mode, both of which are not supported yet.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-21 01:01:45 +02:00
Jiri Kosina dfe9a31211 HID: primax: remove spurious dependency
Remove Kconfig dependency for hid-primax driver on CONFIG_EXPERT.
Please see changelog of 73d5e8f77e ("HID: fix up 'EMBEDDED' mess in
Kconfig") for reasoning behind this.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-17 17:04:58 +02:00
Terry Lambert f6a04605f3 HID: support primax keyboards violating USB HID spec
Primax keyboards with the issue this driver addresses report modifier
keys as in band key events instead of as out of band modifier bits,
resulting in the modifier keys generating key up events immediately
before the keys they are intended to modify.  This driver rewrites
the raw report data from such keyboards into USB HID 1.11 compliant
report data.  It only matches the USB vendor and product IDs for the
keyboard it has been tested on. Since there are several keyboards,
notably a number of laptops and folding USB keyboards known to have
similar unresolved problem reports, the list is expected to grow.

Signed-off-by: Terry Lambert <tlambert@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-17 17:04:41 +02:00
Oliver Neukum fad9fbe865 HID: usbhid: cancel timer for retry synchronously
This makes sure IO is never restarted while a reset is going on

In particular there seems to be no protection from hid_retry_timeout() calling
hid_start_in() which would start IO after hid_pre_reset() has already called
hid_cease_io() because that uses del_timer(), not del_timer_sync()

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-13 18:21:58 +02:00
David Herrmann 3797ef6b6b HID: wacom: Set input bits before registration
We shouldn't change the event flags of input devices after they get registered.
Otherwise, udev will not get notified of these flags and cannot setup the
devices properly.
This fixes the probing to set the input event flags on the input_mapped callback
instead of the probe function.

Reported-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-08 23:20:17 +02:00
Rafael J. Wysocki d727b60659 Merge branch 'pm-runtime' into pm-for-linus
* pm-runtime:
  PM / Tracing: build rpm-traces.c only if CONFIG_PM_RUNTIME is set
  PM / Runtime: Replace dev_dbg() with trace_rpm_*()
  PM / Runtime: Introduce trace points for tracing rpm_* functions
  PM / Runtime: Don't run callbacks under lock for power.irq_safe set
  USB: Add wakeup info to debugging messages
  PM / Runtime: pm_runtime_idle() can be called in atomic context
  PM / Runtime: Add macro to test for runtime PM events
  PM / Runtime: Add might_sleep() to runtime PM functions
2011-10-07 23:16:55 +02:00
Jiri Kosina da617c7cb9 HID: consolidate MacbookAir 4,1 mappings
MacbookAir 4,1 doesn't require extra mapping table, as the mappings
are identical to apple_fn_keys[].

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-05 16:54:45 +02:00
Jiri Kosina 4b086910ad HID: MacbookAir4,1 and MacbookAir4,2 need entry in hid_mouse_ignore_list[]
The respective mouse devices are already supported by bcm5974. Now that
Nobuhiro Iwamatsu added support for keyboard to hid-apple driver, we need
to ignore the mouse interfaces of these so that they can still be properly
claimed by bcm5974 driver.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-04 14:01:12 +02:00
Nobuhiro Iwamatsu d762cc290b HID: Add support MacbookAir 4,1 keyboard
Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-03 14:00:05 +02:00
Amit Nagal f554ff8033 HID: hidraw: open count should not increase if error
In hidraw_open, if hid_hw_power returns with error, hidraw device open count
should not increase.

Signed-off-by: Amit Nagal <helloin.amit@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-27 18:42:22 +02:00
Dan Carpenter 9561f7faa4 HID: hiddev: potential info leak in hiddev_ioctl()
Smatch has a new check for Rosenberg type information leaks where
structs are copied to the user with uninitialized stack data in them.

In this case, the hiddev_devinfo struct has a two byte hole.

struct hiddev_devinfo {
        __u32                      bustype;              /*     0     4 */
        __u32                      busnum;               /*     4     4 */
        __u32                      devnum;               /*     8     4 */
        __u32                      ifnum;                /*    12     4 */
        __s16                      vendor;               /*    16     2 */
        __s16                      product;              /*    18     2 */
        __s16                      version;              /*    20     2 */

        /* XXX 2 bytes hole, try to pack */

        __u32                      num_applications;     /*    24     4 */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-27 01:33:10 +02:00
Benjamin Tissoires 0db3bfc72a HID: multitouch: decide if hid-multitouch needs to handle mt devices
Now that hid-generic ignores all win7 compatible multitouch devices, this patch
allows hid-multitouch to catch them.  The idea is to rely on the quirk
HID_QUIRK_MULTITOUCH to drop the device if no ContactID is given.

There is the need for a blacklist here as other devices may need a special
driver (ntrig for instance).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-26 14:19:02 +02:00
Benjamin Tissoires b77c3920e9 HID: add autodetection of multitouch devices
As mentioned by http://www.microsoft.com/whdc/device/input/DigitizerDrvs_touch.mspx
multitouch devices are those that have the input report HID_CONTACTID.

This patch detects this and unloads the generic-usb driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-26 14:18:18 +02:00
Michal Malý e00ddc9b8f HID: "hid-logitech" driver with Logitech Driving Force GT
There's been a small oversight when adding support for Logitech Driving Force
GT. Entry in hid-core was missing so the generic driver instead of hid-logitech
was being used.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-22 11:02:54 +02:00
Nestor Lopez Casado 844580ff63 HID: hid-logitech-dj: fix off by one
There is a bug where a device with index 6 would write out of bounds in
the array of paired devices.
This patch fixes that problem.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Olivier Gay <ogay@logitech.com>
Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-20 16:09:22 +02:00
James Hogan 65b01bd561 HID: hidraw: protect hidraw_disconnect() better
The function hidraw_disconnect() only acquires the hidraw minors_lock
when clearing the entry in hidraw_table. However the device_destroy()
call can cause a userland read/write to return with an error. It may
cause the program to release the file descripter before the disconnect
is finished. hidraw_disconnect() has already set hidraw->exist to 0,
which makes hidraw_release() kfree the hidraw structure, which
hidraw_disconnect() continues to access and even tries to kfree again.
Similarly if a hidraw_release() occurs after setting hidraw->exist to 0,
the same thing can happen.

This is fixed by expanding the mutex critical section to cover the whole
function from setting hidraw->exist to 0 to freeing the hidraw
structure, preventing a hidraw_release() from interfering.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Tested-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-20 15:23:46 +02:00
Stephane Chatty a062cc5a76 HID: hid-multitouch: add support for the IDEACOM 6650 chip
The IDEACOM 6650 multitouch chip, present in various all-in-one computers,
uses the serial version of the HID multitouch protocol. No existing class
supports this.

In principle, the new MT_CLS_SERIAL should work for other
serial panels as well, perhaps including some eGalax panels.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-20 15:14:30 +02:00
Linus Torvalds 279b1e0fd9 Merge branch 'for-linus' of git://github.com/dtor/input
* 'for-linus' of git://github.com/dtor/input:
  Input: wacom - fix touch parsing on newer Bamboos
  Input: bcm5974 - add MacBookAir4,1 trackpad support
  Input: wacom - add POINTER and DIRECT device properties
  Input: adp5588-keys - remove incorrect modalias
  Input: cm109 - fix checking return value of usb_control_msg
  Input: wacom - advertise BTN_TOOL_PEN and BTN_STYLUS for PenPartner
  Input: wacom - remove pressure for touch devices
2011-09-16 14:09:19 -07:00
Nestor Lopez Casado 534a7b8e10 HID: Add full support for Logitech Unifying receivers
With this driver, all the devices paired to a single Unifying
receiver are exposed to user processes in separated /input/dev
nodes.

Keyboards with different layouts can be treated differently,
Multiplayer games on single PC (like home theater PC) can
differentiate input coming from different kbds paired to the
same receiver.

Up to now, when Logitech Unifying receivers are connected to a
Linux based system, a single keyboard and a single mouse are
presented to the HID Layer, even if the Unifying receiver can
pair up to six compatible devices. The Unifying receiver by default
multiplexes all incoming events (from multiple keyboards/mice)
into these two.

Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-15 11:34:49 +02:00
Jason Gerecke 3512069eef Input: wacom - add POINTER and DIRECT device properties
Adds INPUT_PROP_POINTER or INPUT_PROP_DIRECT as necessary to the
hardware supported by the Wacom driver. The DIRECT property is
assigned to devices with an embedded screen (i.e. touchscreens
and display tablets). The POINTER property is assigned to those
without embedded screens.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-08 09:42:28 -07:00
Jiri Kosina 882aba0105 Merge branches 'upstream-fixes' and 'magicmouse' into for-linus 2011-09-07 13:53:17 +02:00
Amit Nagal 1a8962317f HID: hidraw: free list for all error in hidraw_open
In function hidraw_open struct hidraw_list *list should be freed for
all error conditions.

Signed-off-by: Amit Nagal <helloin.amit@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:48:47 +02:00
Stefan Achatz 3200a6a5fa HID: roccat: Kone now reports external profile changes via roccat device
Profile changes were only reported when issued mouse internal. Now all
changes are reported.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:38:28 +02:00
Stefan Achatz bd9c35d0e5 HID: roccat: cleaned up code for Kone and fixed wrong initialization value
Introduced function kone_profile_activated() to reduce code duplication.
This by the way fixes a wrong initialization value.
Also fixes early mutex unlocks.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:38:28 +02:00
Stefan Achatz 6b9a57b9fb HID: roccat: Kovaplus now reports external profile changes via roccat device
Profile changes were only reported when issued mouse internal. Now all
changes are reported.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:38:27 +02:00
Stefan Achatz dc186b661c HID: roccat: Pyra now reports external profile changes via roccat device
Profile changes were only reported when issued mouse internal. Now all
changes are reported.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:38:27 +02:00
Stefan Achatz 1c5784da12 HID: roccat: Fixed false dpi reporting when using osd event
Actual dpi resolution was set on wrong occassion.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:38:27 +02:00
David Herrmann 9086617ea3 HID: wacom: Unregister sysfs attributes on remove
HID devices can be hotplugged so we should unregister all sysfs attributes when
removing a driver. Otherwise, manually unloading the wacom-driver will not
remove the sysfs attributes. Only when the device is disconnected, they are
removed, eventually.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:32:35 +02:00
David Herrmann dde58cfcc3 HID: wacom: Fix error path of power-supply initialization
power_supply_unregister() must not be called if power_supply_register() failed.
The wdata->psy.dev pointer may point to invalid memory after a failed
power_supply_register() and hence wacom_remove() will fail while calling
power_supply_unregister().

This changes the wacom_probe function to fail if it cannot register the
power_supply devices. If we would want to keep the previous behaviour we had to
keep some flag about the power_supply state and check it on wacom_remove, but
this seems inappropriate here. Hence, we simply fail, too, if
power_supply_register fails.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:32:34 +02:00
David Herrmann b22e00f3ec HID: wiimote: Add MAINTAINERS entry
Add entry to MAINTAINERS and also bump version level as the core driver is
feature complete now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:18 +02:00
David Herrmann 6591d758d5 HID: wiimote: Read wiimote battery charge level
This registers a power_supply device for every remote to retrieve the current
battery charge level. Since this information is not sent by the wiimote
continously, we need to explicitely request it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:18 +02:00
David Herrmann e3979a9189 HID: wiimote: Add status request
The wiimote does not send status reports continuously so this adds a helper
function to request a status report and parses the battery charge level.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:18 +02:00
David Herrmann 0370d7cb30 HID: wiimote: Initialize IR cam on request
Initialize the IR cam if the related input device is opened by userspace. Stop
IR cam again if userspace is no longer interested in its data events.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:17 +02:00
David Herrmann fc221cda3b HID: wiimote: Add IR initializer
The wiimote IR cam needs a fairly complex initialization sequence. This adds a
helper function that performs IR initialization synchronously.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:17 +02:00
David Herrmann 33e84013d7 HID: wiimote: Add write-register helpers
Add helpers to synchronously write registers of the wiimote. This is heavily
used by initialization functions for wiimote peripherals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:17 +02:00
David Herrmann 29d28064e2 HID: wiimote: Helper functions for synchronous requests
To initialize wiimote peripherals, the stream to the wiimote must be held
exclusively by the initializer, otherwise the initialization will fail. Many
initializations require multiple memory requests to be sent synchronously so we
need a way to lock the stream and release it when we are done.

This adds several helper functions which allow to lock the stream, then send
requests, wait for the answers and release the stream again.

When holding the lock, the function may sleep and interrupted by signals.
Also it returns after a short timeout so userspace shouldn't notice long
delays.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:17 +02:00
David Herrmann be1ecd62e6 HID: wiimote: Add register/eeprom memory support
The wiimote allows direct access to its memory mapped registers and
internal eeprom. This adds support to access this memory and handle
memory events.

There are two macros which wrap up the memory access functions to avoid
accidentally overwriting sensitive eeprom data because a boolean value
was wrongly set.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:16 +02:00
David Herrmann 7336b9f93a HID: wiimote: Add missing extension DRM handlers
If an extension is connected the wiimote may report data though DRMs that
contain extension data. This adds handlers for these DRMs but discards extension
data since we do not support it, yet.
It prints a warning to kernel log if an unhandled report is catched. Since we
handle all requests now, this should never happen, though.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:16 +02:00
David Herrmann eac39e7eda HID: wiimote: Parse IR data
Parse IR data and report it to IR input-device. IR data is sent in 3 different
formats, but we only support the basic format as there is no way to send the
additional information to userspace.
All three formats are compatible with the basic IR data format so we need only
one parser.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:16 +02:00
David Herrmann f363e4f6ab HID: wiimote: Add IR input device
The IR cam of the wiimote reports 4 trackable lights as absolute values. Since
we can turn the IR cam on and off, we register a separate input device so we can
react on open/close callbacks to save wiimote battery power when IR cam is not
needed.

The cam can be in four states: off, basic, extended and full
The DRM chooser automatically selects a proper DRM that includes all required IR
data so no information is lost.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:16 +02:00
David Herrmann efcf918874 HID: wiimote: Parse accelerometer data
Add parser functions for accelerometer data reported by the wiimote. The data is
almost always reported in the same format, so we can use a single handler.
However, an own handler function is created for each DRM-mode because when IR
and extension support is added, each of them is parsed differently.

Also set the appropriate DRM including accelerometer data on DRM requests to
actually retrieve the accelerometer data.

Data is reported to userspace as ABS_RX/Y/Z values. The values are between -500
and 500 and 0 means no acceleration. See also userspace xwiimote library for
data parsing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:16 +02:00
David Herrmann 98a558ae35 HID: wiimote: Add accelerometer input device
Add new input device for every wiimote which is used to report accelerometer
data to userspace. Only if the input device is currently open, we make the
wiimote send accelerometer data. This saves a whole lot of energy on the wiimote
if an application is only interested in button input reports.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:15 +02:00
David Herrmann d020be9246 HID: wiimote: Add force-feedback support
The wiimote has a single rumble motor. This adds force feedback support for
wiimote devices with FF_RUMBLE. The rumble motor is very simple and only
supports an on/off switch so no complex ff-effects are supported.

This also removes the event callback that was registered before but unused. The
ff-device overwrites this callback, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:25:15 +02:00
David Herrmann c003ec2165 HID: wiimote: Support rumble device
This adds support for the wiimote's rumble device. Every output report can
enable and disable the rumble motor. Hence, every output report must look up our
new RUMBLE flag and make sure that it does not unintentionally toggle the
rumble motor.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-09-07 13:24:37 +02:00
Clemens Werther 6d1db07779 HID: add support for HuiJia USB Gamepad connector
Create each gamepad as a separate joystick

Signed-off-by: Clemens Werther <clemens.werther@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-25 15:35:14 +02:00
Jiri Kosina 35d851df23 HID: magicmouse: ignore 'ivalid report id' while switching modes, v2
This is basically a more generic respin of 23746a6 ("HID: magicmouse: ignore
'ivalid report id' while switching modes") which got reverted later by
c3a492.

It turns out that on some configurations, this is actually still the case
and we are not able to detect in runtime.

The device reponds with 'invalid report id' when feature report switching it
into multitouch mode is sent to it.

This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
on Sent Reports"), but since this commit, it propagates -EIO from the _raw
callback .

So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
how the device reacts in normal mode.

Sad, but following reality.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022

Reported-by: Chase Douglas <chase.douglas@canonical.com>
Reported-by: Jaikumar Ganesh <jaikumarg@android.com>
Tested-by: Chase Douglas <chase.douglas@canonical.com>
Tested-by: Jaikumar Ganesh <jaikumarg@android.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-25 14:21:37 +02:00
Jiri Kosina d446014162 Merge branches 'wiimote' and 'upstream-fixes' into for-linus 2011-08-24 16:41:52 +02:00
Dan Carpenter ba623a774f HID: unlock on error path in hid_device_probe()
We recently introduced locking into this function, but we missed an
error path which needs an unlock.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-24 16:39:23 +02:00
David Herrmann c87019e41d HID: wiimote: Add status and return request handlers
The wiimote resets the current drm when an extension is plugged in.
Fortunately, it also sends a status report in this situation so we just
reset the drm on every status report to keep the drm consistent.

Also handle return reports from the wiimote which indicate success and
failure of requests that we've sent.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:55:45 +02:00
David Herrmann 2cb5e4bc53 HID: wiimote: Add drm request
The wiimote reports data in several data reporting modes (DRM). The DRM
request makes the wiimote send data in the requested drm.

The DRM mode can be set explicitely or can be chosen by the driver. To let
the driver choose the DRM mode, pass WIIPROTO_REQ_NULL placeholder to it. This
is no valid request and is replaced with an appropriate DRM.

Currently, the driver always sets the basic DRM_K mode, but this will be
extended when further peripherals like accelerometer and IR are supported.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:55:34 +02:00
David Herrmann 23a5a4a39e HID: wiimote: Register led class devices
This registers 4 led devices to allow controlling the wiimote leds via standard
LED sysfs API. It removes the four sysfs attributes so we don't have two APIs
for one device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:55:21 +02:00
David Herrmann 26af17484a HID: wiimote: Correctly call HID open/close callbacks
Even though the bluetooth hid backend does not react on open/close callbacks, we
should call them to be consistent with other hid drivers.

Also the new input open/close handlers will be used in future to prepare the
wiimote device for IR/extension input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:55:11 +02:00
David Herrmann 3989ef6cfb HID: wiimote: Simplify synchronization
The new locking scheme in HID core allows us to remove a bit of synchronization.
Since the HID layer acts synchronously we simply register input core last and
there are no synchonization issues anymore.
Also register sysfs files after that to simplify the code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:54:59 +02:00
Dan Carpenter 8f25229026 HID: hid-lg4ff: add a kfree() to an error path
There is a small rare potential memory leak here.  Also Walter Harms
points out that we can do a small cleanup as well by using kstrdup().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:44:44 +02:00
Dan Carpenter 2bbaf771eb HID: hid-lg4ff: silence sparse complaint
Sparse complains that:
drivers/hid/hid-lg4ff.c:288:44: warning: Using plain integer as NULL pointer
drivers/hid/hid-lg4ff.c:311:44: warning: Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 10:43:43 +02:00
Jeremiah Matthey f5e4282586 HID: usbhid: Add support for SiGma Micro chip
Patch to add SiGma Micro-based keyboards (1c4f:0002) to hid-quirks.

These keyboards dont seem to allow the records to be initialized, and hence a
timeout occurs when the usbhid driver attempts to initialize them. The patch
just adds the signature for these keyboards to the hid-quirks list with the
setting HID_QUIRK_NO_INIT_REPORTS. This removes the 5-10 second wait for the
timeout to occur.

Signed-off-by: Jeremiah Matthey <sprg86@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-23 09:44:30 +02:00
Alan Stern 5b1b0b812a PM / Runtime: Add macro to test for runtime PM events
This patch (as1482) adds a macro for testing whether or not a
pm_message value represents an autosuspend or autoresume (i.e., a
runtime PM) event.  Encapsulating this notion seems preferable to
open-coding the test all over the place.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-19 23:49:48 +02:00
Jeff Brown c50bb1a400 HID: hid-multitouch: Add LG Display Multitouch device.
This panel is also known as the Dell ST2220Tc.

Signed-off-by: jeffbrown@android.com
Reviewed-By: Benjamin Tissoires <Benjamin_Tissoires@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-16 11:43:53 +02:00
Jeff Brown 658d4aed59 HID: hid-multitouch: Filter collections by application usage.
This change fixes two problems.

First, it ensures that the hid-multitouch driver does not incorrectly
map GenericDesktop usages that are intended for other applications,
such as a Mouse.

Second, it sets the appropriate input properties so that user-space
can distinguish TouchScreen devices (INPUT_PROP_DIRECT) from
TouchPad devices (INPUT_PROP_POINTER) and configure them accordingly.

Signed-off-by: jeffbrown@android.com
Acked-By: Benjamin Tissoires <Benjamin_Tissoires@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-16 11:38:44 +02:00
Jeff Brown 54d3339ac1 HID: hid-debug: Show application usage for each collection.
Signed-off-by: jeffbrown@android.com
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@logitech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-16 11:37:29 +02:00
Sean Young ad395ccadb IHD: Support force feedback on MP-8866
Support force feedback on the Dual USB Force Feedback Joypad (MP-8866).

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-15 23:36:43 +02:00
Jiri Kosina 70c2cabd6a HID: make CONFIG_LOGIWHEELS_FF default to CONFIG_LOGITECH_FF
Do this for backwards compatibility reasons (LOGIWHEELS_FF has
been split-off from LOGITECH_FF), so that users don't have
regressions with 'default' kernel configs.

Reported-and-tested-by: simon@mungewell.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 18:11:10 +02:00
Jiri Kosina f6f554f09c HID: add MacBookAir4,2 to hid_have_special_driver[]
Otherwise the generic driver wouldn't unbind from it and wouldn't
let hid-apple to automatically take over.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 14:12:52 +02:00
Joshua V. Dillon 5d922baa63 HID: add support for MacBookAir4,2 keyboard.
Added USB device IDs for MacBookAir4,2 keyboard. Device constants were
copied from the MacBookAir3,2 constants. The 4,2 device specification is
reportedly unchanged from the 3,2 predecessor and seems to work well.

Signed-off-by: Joshua V Dillon <jvdillon@gmail.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 14:12:07 +02:00
Chase Douglas 4f6fdf0868 HID: magicmouse: Set resolution of touch surfaces
Add touch surface resolution information. The size of the touch surfaces
has been determined to the hundredth of a mm.

Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Michael Poole <mdpoole@troilus.org>
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
[jkosina@suse.cz: update comments and commit message]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 14:08:46 +02:00
Jiri Kosina 45dc1ac73d HID: propagate return value correctly in hid_input_report()
Fix a return value propagation that was omitted in David Herrmann's
locking fix around hid_input_report().

Reported-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 14:02:59 +02:00
David Herrmann 4ea5454203 HID: Fix race condition between driver core and ll-driver
HID low level drivers register new devices with the HID core which then
adds the devices to the HID bus. The HID bus normally immediately probes
an appropriate driver which then handles HID input for this device.
The ll driver now uses the hid_input_report() function to report input
events for a specific device. However, if the HID bus unloads the driver
at the same time (for instance via a call to
 /sys/bus/hid/devices/<dev>/unbind) then the hdev->driver pointer may be
used by hid_input_report() and hid_device_remove() at the same time
which may cause hdev->driver to point to invalid memory.

This fix adds a semaphore to every hid device which protects
hdev->driver from asynchronous access. This semaphore is locked during
driver *_probe and *_remove and also inside hid_input_report(). The
*_probe and *_remove functions may sleep so the semaphore is good here,
however, hid_input_report() is in atomic context and hence only uses
down_trylock(). If it cannot acquire the lock it simply drops the input
package.

The low-level drivers report input events synchronously so
hid_input_report() should never be entered twice at the same time on the
same device. Hence, the lock should always be available. But if the
driver is currently probed/removed then the lock is not available and
dropping the package should be safe because this is what would have
happened if the package arrived some milliseconds earlier/later.

This also fixes another race condition while probing drivers:
First the *_probe function of the driver is called and only if that
succeeds, the related input device of hidinput is registered. If the low
level driver reports input events after the *_probe function returned
but before the input device is registered, then a NULL pointer
dereference will occur. (Equivalently on driver remove function).
This is not possible anymore, since the semaphore lock drops all
incoming packages until the driver/device is fully initialized.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-10 14:02:07 +02:00
Bojan Prtvar 00b15628b0 HID: prodikeys: kfree() NULL pointer cleanup
No need for freeing pm in case when it's not allocated.

Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 23:51:29 +02:00
Bojan Prtvar 6371fe54b5 HID: zydacron: kfree() NULL pointer cleanup
Checking for NULL pointers before kfree() is redundant.

Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 23:51:29 +02:00
Michal Malý a7ac90f18c HID: lg4ff - Fix misleading info in Kconfig
The description of lg4ff driver has to be changed to reflect the fact that the
driver now handles a lot more Logitech wh the Wii. Entry in Kconfig has been
renamed to LOGIWHEELS_FF

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 16:45:55 +02:00
Michal Malý 6e2de8e0ab HID: lg4ff - Add autocentering command accepted by Formula Force EX
The Logitech driver sends Formula Force EX wheel a different command to
autocenering force. FFEX will accept the standard command used by the rest of
the wheels, but it won't set the centering properly.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 16:45:55 +02:00
Michal Malý 30bb75d71b HID: lg4ff - Add range setting support and sysfs interface
Wheel range of certain Logitech wheels - namely Driving Force GT, Driving Force
Pro, G25 and G27 can be adjusted. Minimu is 40 degrees, maximum 900. DFGT, G25
and G27 all use a common command, DFP uses another one.  Range can be set from
userspace by writing to
"/sys/module/hid_logitech/drivers/hid:logitech/<dev>range". The driver use list
to store range of each connected wheel; it's not possible to use driver_data in
hid_device struct as it's already b hig-lg driver.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 16:45:55 +02:00
Michal Malý 96440c8a00 HID: lg4ff - Add support for native mode switching
This patch allows the lg4ff driver to switch wheels to the native mode. Since
this is specific to Logitech wheels only, it's handled in hid-lg4ff rather than
hid-lg.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 16:45:55 +02:00
Michal Malý 7362cd2286 HID: lg4ff - Move handling of Logitech wheels to lg4ff driver
This is the first out of five patches me and Simon Wood (CC'd) have been
working on. It separates the handling of Logite from the generic lgff driver
and adds additional features specific for the Logitech wheels, namely

- Native mode support for Driving Force GT, Driving Force Pro, G25 and G27
wheels Every Logitech wheel reports itself as generic Logitech Driving Force
wheel (VID 046d, PID c294). This is done to ensu wheel will work on every USB
HID-aware system even when no Logitech driver is available. It however limits
the capabilit wheel - range is limited to 200 degrees, G25/G27 don't report the
clutch pedal and there is only one combined axis for t brake. The switch to
native mode is done via hardware-specific command which is different for each
wheel. When the wheel receives such command, it simulates reconnect and reports
to the OS with its actual PID.

- Adjustable wheel range DFGT, DFP, G25 and G27 have variable range of the
steering wheel. The range is limited by applying a maximum constant when the
wheel is turned beyond the allowed range. The limit as also set by a
hardware-specific command. There is a comm command for DFGT, G25 and G27 and
another one for DFP. It is probably possible to use the DFP command to limit
the range other Logitech wheels too, but this is not supported by the official
Logitech driver for Windows.  The patch adds a sysfs interface which allows for
the range to be set from userspace.

- Fixed autocentering command All Logitech wheels support FF_AUTOCENTER effect.
The original implementation in the lgff driver didn't work well with patch
fixes it. According to USB communication sniffs the Formula Force EX (pretty
much rebranded original Driving Force accept the generic autocentering command,
this issue is also addressed by the patch

There are still some features this patch doesn't cover, but since some of them
will most likely require modifications of memless driver we have decided not to
include them yet.

As first we decided to move the handling of Logitech wheels from hid-lgff
driver to hid-lg4ff driver (originally used fo At also adds PID of Logitech
Driving Force GT.

Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 16:45:55 +02:00
Sergei Kolzun b55ebc27b0 HID: ACRUX - handle gamepads with different report layout
There are gamepads that share the same VID and PID but have different
report structure - instead of having 4 fields with one value they have
one field that can hold all 4 values. Make the driver cope with devices
using both styles.

Signed-off-by: Sergei Kolzun <x0r@dv-life.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 15:25:34 +02:00
Sergei Kolzun 364b936fc3 HID: ACRUX - fix enabling force feedback support
The config option needs to be a 'bool' and not a tristate, otheriwse
force feedback support never makes it into the module.

Signed-off-by: Sergei Kolzun <x0r@dv-life.ru>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-04 15:25:31 +02:00
Dan Bastone 4a4c879904 HID: add support for new revision of Apple aluminum keyboard
Add USB device ids for the new revision (MB110LL/B) of Apple's wired aluminum
keyboard.  I have only confirmed that the ANSI version is correct - it is
assumed that the ISO and JIS versions follow the standard numbering convention.

Signed-off-by: Dan Bastone <dan@pwienterprises.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-01 23:18:26 +02:00
Jiri Kosina a91f423e59 Merge branches 'roccat', 'upstream' and 'wiimote' into for-linus 2011-07-22 22:47:08 +02:00
Jiri Kosina b580169aff HID: fix support for Microsoft comfort mouse 4500
Add forgotten entry into the global blacklist.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-22 12:11:15 +02:00
ice chien bc8a2a9b4e HID: hid-multitouch: add one new multitouch device's VID/PID
This patch adds support for the CSR panel built by XAT.

Signed-off-by: Ice Chien <ice.chien@accupoint.com.tw>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-21 14:12:28 +02:00
Axel Lin d6b8f5819f HID: prodikeys: remove a redundant forward declaration of struct pcmidi_snd
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-21 13:59:08 +02:00
Axel Lin f4c79818ac HID: prodikeys: make needlessly global symbols static
The following symbols are not referenced outside this file so
there's no need for it to be in the global name space.

  pcmidi_sustained_note_release
  init_sustain_timers
  stop_sustain_timers
  pcmidi_handle_report
  pcmidi_setup_extra_keys
  pcmidi_snd_initialise
  pcmidi_snd_terminate

Make them static.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-21 13:58:53 +02:00
Axel Lin 2dcd9543a2 HID: emsff: properly handle emsff_init failure
emsff_init() may fail, let's properly handle the failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-20 11:55:18 +02:00
Axel Lin b30d89d105 HID: ACRUX - add missing hid_hw_stop() in ax_probe() error path
hid_hw_stop() must be called in ax_probe() error path if hid_hw_start()
was successful.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-14 11:42:53 +02:00
Ari Savolainen 23c10becdb HID: fix horizontal wheel for ms comfort mouse 4500
Microsoft comfort mouse 4500 report descriptor contains duplicate
usages for horizontal wheel. This patch fixes the wrong mapping
caused by that.

Signed-off-by: Ari Savolainen <ari.m.savolainen@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-12 10:31:56 +02:00
Nikolai Kondrashov 6be914f11d HID: uclogic: Add support for UC-Logic WP1062
Add support for UC-Logic Tablet WP1062 by fixing its report descriptor.

This tablet is sold as Monoprice 10X6.25 Inches Graphic Drawing Tablet.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:37:24 +02:00
David Herrmann 3c1c2fce64 HID: wiimote: Add sysfs support to wiimote driver
Add sysfs files for each led of the wiimote. Writing 1 to the file
enables the led and 0 disables the led.

We do not need memory barriers when checking wdata->ready since we use
a spinlock directly after it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:24 +02:00
David Herrmann 32a0d9a522 HID: wiimote: Cache wiimote led state
Save the current state of the leds in the wiimote data structure. This
allows us to discard new led requests that wouldn't change anything.
Protect the whole state structure by a spinlock. Every wiiproto_*
function expects this spinlock to be held when called.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:24 +02:00
David Herrmann db3083467f HID: wiimote: Add wiimote led request
Add new request that sets the leds on the target device. Also, per
default, set led1 after initializing a device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:23 +02:00
David Herrmann 1abb9ad389 HID: wiimote: Add wiimote input button parser
Parse input report 0x30 from the wiimote as button input. We need to
send events for all buttons on every input report because the wiimote
does not send events for single buttons but always for all buttons
to us. The input layer, however, filters redundant events.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:23 +02:00
David Herrmann a4d1919762 HID: wiimote: Add wiimote event handler
Create array of all event handlers and call each handler when we
receive the related event.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:23 +02:00
David Herrmann 23c063cb02 HID: wiimote: Add output queue for wiimote driver
The raw hid output function that is supported by bluetooth low-level
hid driver does not provide an output queue and also may sleep. The
wiimote driver, though, may need to send data in atomic context so
this patch adds a buffered output queue for the wiimote driver.

We use the shared workqueue to send our buffer to the hid device.
There is always only one active worker which flushes the whole output
queue to the device. If our queue is full, every further
output is discarded.

Special care is needed in the deinitialization routine. When
wiimote_hid_remove is called, HID input is already disabled, but HID
output may still be used from our worker and is then discarded by the
lower HID layers. Therefore, we can safely disable the input layer since it
is the only layer that still sends input events.
Future sysfs attributes must be freed before unregistering input to
avoid the sysfs handlers to send input events to a non-existing input
layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:23 +02:00
David Herrmann 0c218f1448 HID: wiimote: Add wiimote send function
The wiimote driver needs to send raw output reports to the wiimote
device. Otherwise we could not manage the peripherals of the wiimote
or perform memory operations on the wiimote.
We cannot use hidinput_input_event of the lowlevel hid driver, since
this does not accept raw input. Therefore, we need to use the same
function that hidraw uses to send output. Side effect is, the raw
output function is not buffered and can sleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:23 +02:00
David Herrmann 4d36e9754f HID: wiimote: Synchronize wiimote input and hid event handling
The wiimote first starts HID hardware and then registers the input
device. We need to synchronize the startup so no event handler will
start parsing events when the wiimote device is not ready, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:22 +02:00
David Herrmann 672bc4e090 HID: wiimote: Register input device in wiimote hid driver
Register input device so the wiimote can report input events on
it. We do not use HIDINPUT because the wiimote does not provide any
descriptor table which might be used by HIDINPUT. So we avoid
having HIDINPUT parse the wiimote descriptor and create unrelated
or unknown event flags. Instead we register our own input device
that we have full control of.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:22 +02:00
David Herrmann e894d0e3e0 HID: wiimote: Add wiimote device structure
Allocate wiimote device structure with all wiimote related data
when registering new wiimote devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:22 +02:00
David Herrmann 02fb72a06a HID: wiimote: Register wiimote hid driver stub
The wiimote uses a fake HID protocol. Hence, we need to prevent
HIDINPUT and HIDDEV from parsing wiimote data and instead parse
raw hid events.
Add VID/PID to hid-core so the special driver is loaded on new
wiimotes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:22 +02:00
David Herrmann fb51b44385 HID: wiimote: Add Nintendo Wii Remote driver stub
Add stub driver for the Nintendo Wii Remote. The wii remote uses
the HID protocol to communicate with the host over bluetooth. Hence,
add dependency for HIDP and place driver in hid subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-11 14:30:21 +02:00
Anssi Hannula d946e65e2a HID: add FF support for Holtek On Line Grip based gamepads
Add force feedback support for Holtek On Line Grip based HID devices.

The protocol is more complex than that of most other rumblepads, but the
device still needs to be handled as a memoryless one.

Tested by Cleber de Mattos Casali with a 1241:5015 "Clone Joypad Super
Power Fire" gamepad, with help from Hendrik Iben <hendrik_iben@web.de>.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Cleber de Mattos Casali <clebercasali@yahoo.com.br>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-27 12:40:00 +02:00
Benjamin Tissoires c3ead6de4f HID: hid-multitouch: add support for a new Lumio dual-touch panel
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-24 13:41:11 +02:00
Benjamin Tissoires 85a600825b HID: hid-multitouch: correct VID for Stantum panels
while merging hid-stantum into hid-multitouch, I did not correctly copy/paste
the VIDs for those devices.  This patch fixes it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-24 13:40:51 +02:00
Benjamin Tissoires 50bc03ab5c HID: hid-multitouch: ensure slots are initialized
In case a device does not provide the feature "Maximum Contact Count",
or set it at 0, the maxcontacts field may be at 0 while calling
input_mt_init_slots.

This patch ensures that hid-multitouch will allways report
ABS_MT_SLOT and ABS_MT_TRACKING_ID to the user space.

This corrects a bug found with some Ilitek devices that has been
integrated in 3.0-rc0.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-24 13:39:51 +02:00
Jiri Kosina c3a4924565 Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes"
This reverts commit 23746a66d7.

It turned out that the actual reason for failure is not the device
firmware, but bug in Bluetooth stack, which will be fixed by
patch by Ville Tervo which corrects the mask handling for CSR 1.1
Dongles.

Reported-and-tested-by: Ed Tomlinson <edt@aei.ca>
Reported-and-tested-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-16 12:21:34 +02:00
Jiri Kosina f3b83d71a1 HID: add support for MS Digital Media 3000
The Digital Media 3000 keyboard (USB id: 0x0730) features the same 1-5
Application Launch keys that the Natural Ergonomic 4000 has. Add its
usb id to the list of quirks.

Reported-by: Khelben Blackstaff <eye.of.the.8eholder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-14 10:46:51 +02:00
Simon Wood c9e4d87758 HID: hid-sony: fix endiannes of Sixaxis accel/gyro values
The accelerometers/gyro on the Sixaxis are reported in the wrong
endianness (ie. not compatible with HID), so this patch intercepts
the report and swaps the appropriate bytes over.

Accelerometers are scaled with a nominal value of +/-4000 = 1G,
maximum value would be around +/-32768 = 8G.

Gyro on my device always reports -32768, might need some calibration
set within the controller.

Fix extracted from previous patch submission:
https://patchwork.kernel.org/patch/95212/

Signed-off-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 13:21:30 +02:00
Simon Wood 61ab44bebd HID: hid-sony: amend Sixaxis descriptor to enable accelerometers
Modify the HID descriptor of the Sixaxis controller to allow the
reporting of the accelerometers and gyro via a joystick axis.

Rewrite section from offset 83:
--
0x75, 0x08,         /* Report Size (8),         */
/* all the other data lumped together */
0x95, 0x27,         /* Report Count (39),       */
0x09, 0x01,         /* Usage (Pointer),         */
0x81, 0x02,         /* Input (Variable),        */
0x75, 0x08,         /* Report Size (8),         */
0x95, 0x30,         /* Report Count (48),       */
0x09, 0x01,         /* Usage (Pointer),         */
/* Note Output */
0x91, 0x02,         /* Output (Variable),       */
0x75, 0x08,         /* Report Size (8),         */
0x95, 0x30,         /* Report Count (48),       */
0x09, 0x01,         /* Usage (Pointer),         */
/* Note Feature */
0xB1, 0x02,         /* Feature (Variable),      */
--
with
--
/* last 2 not used... */
0x95, 0x13,         /* Report Count (19),       */
0x09, 0x01,         /* Usage (Pointer),         */
0x81, 0x02,         /* Input (Variable),        */
/* Padding */
0x95, 0x0C,         /* Report Count (12),       */
0x81, 0x01,         /* Input (Constant),        */
0x75, 0x10,         /* Report Size (16),        */
0x95, 0x04,         /* Report Count (4),        */
0x26, 0xFF, 0x03,   /* Logical Maximum (1023),  */
0x46, 0xFF, 0x03,   /* Physical Maximum (1023), */
0x09, 0x01,         /* Usage (Pointer),         */
0x81, 0x02,         /* Input (Variable),        */
--

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 13:20:06 +02:00
Stefan Achatz 901e64dbdb HID: roccat: fix NULL pointer dereference, add range checks
On rare occassions raw events can be triggered before drvdata gets set up
which leads to NULL pointer dereferences. This was only observed with pyra on
2.6.39, but is fixed for all devices now to play it save.
kovaplus returned wrong actual values when profile change was initiated from host.
Added range checks for setting actual profile on all devices.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 13:06:23 +02:00
Stefan Achatz 1edd5b42a6 HID: roccat: correction and cleanup of HID feature reports
Removed analog feature report enums and modified code in roccat_common
to reflect this. Non standard conform Kone got its own copy of the old
code. That helps extracting more generalizations for newer devices.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 12:52:57 +02:00
Stefan Achatz 303f272c1f HID: roccat: chang Kconfig menu to submenu for roccat devices
As module roccat is needed by all devices, it's the toplevel
menu entry with all devices dependent.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 12:51:53 +02:00
Stefan Achatz 6d1dec85af HID: roccat: Add "Roccat Talk" support for koneplus
Added binary sysfs attribute to support new functionality the manufacturer
added to koneplus.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-13 12:50:40 +02:00
Benjamin Tissoires b84bd27fe7 HID: hid-multitouch: fix broken eGalax
Since the inclusion of eGalax devices in 2.6.39, I've got some
bug reports for 480d and other devices.
The problem lies in the reports descriptors: eGalax supports both
pen and fingers, and so the reports descriptors contained both.
But hid-multitouch relies on them to detect the last item in each
field to send the multitouch events. In 480d, the last item is not
Y as it should but Pressure. That means that the fields are not
aligned and X,Y are at 0,0 (the other touch coordinates of the report).

With this patch, the detection is made only when the field ContactID
has been detected inside the collection.

There is still a problem with the detections of the range as stylus
and fingers may not have the same min/max, but it's a start.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-12 23:59:23 +02:00
Stefan Kriwanek 74bc695313 HID: Add driver to fix Speedlink VAD Cezanne support
Speedlink VAD Cezanne have a hardware bug that makes the cursor "jump" from one
place to another every now and then. The issue are relative motion events
erroneously reported by the device, each having a distance value of +256. This
256 can in fact never occur due to real motion, therefore those events can
safely be ignored.  The driver also drops useless EV_REL events with a value of
0, that the device sends every time it sends an "real" EV_REL or EV_KEY event.

Signed-off-by: Stefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-08 09:45:37 +02:00
Michael Bauer dc0a4f0ce2 HID: Fix Logitech Driving Force Pro wheel
- Add the quirk "NOGET" to make the wheel work at all in native mode.
- Replace the somehow broken report descriptor with a custom one to have
  separate throttle and brake axes.

As there are significant differences in the descriptor (original descriptor
"hides" the separate axes in a  24 bit FF00 usagepage, new descripter replaces
that with two individual 8 bit desktop.y and desktop.rz usages) I provided a
complete replacement descriptor instead trying to patch the original one.
Patching the descriptor seems not feasible as the new one is much larger.

Note: To actually test this you have to use the tool "ltwheelconf" to put the
DFP into it's native mode - See below for more info.

Background:
Most Logitech wheels are initially reporting themselves with a "fallback"
deviceID (USB_DEVICE_ID_LOGITECH_WHEEL - 0xc294), in order to make sure they
are working even without having the proper driver installed.

If the Logitech driver is installed it sends a special command to the wheel
which sets the wheel to "native mode", enabling enhance features like:
- Clutch pedal
- extended wheel rotation range (up to 900 degrees)
- H-gate shifter
- separate axis for throttle / brake
- all buttons

When the wheel is set to native mode it basically disconnects and reconnects
with a different deviceID (USB_DEVICE_ID_LOGITECH_DFP_WHEEL - 0xc298 in this
case).

I am working on a userspace tool [1] which does the switching from fallback to
native mode. During development I found out that the Driving Force Pro wheel
is not supported in native mode - quierk NOGET is missing and the throttle and
brake axes are reported in a combined way only.

Signed-off-by: Michael Bauer <michael@m-bauer.org>
Signed-off-by: Simon Wood <simon@mungewell.org>

[1] https://github.com/TripleSpeeder/LTWheelConf
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-07 15:48:05 +02:00
Austin Zhang 942fd4225f HID: hid-multitouch: add support for Chunghwa multi-touch panel
Added Chunghwa hid multitouch panel support into hid-multitouch.

Signed-off-by: Austin Zhang <zhang.austin@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-07 15:43:19 +02:00
Tomoki Sekiyama 6dc1418e13 HID: yurex: recognize GeneralKeys wireless presenter as generic HID
Unfortunately, the device seems to have the same Vendor ID and Product ID
as YUREX leg-shakes sensors, and the commit 6bc235a2e2 ("USB: add driver
for Meywa-Denki & Kayac YUREX") added the ID to hid_ignore_list.

I believe that we can distinguish YUREX and the Wireless Presenter by
device type.  The patch below makes the driver ignore only YUREX
(bInterfaceProtocol==0), and recognize Wireless Presenter
(bInterfaceProtocol is keyboard or mouse) as generic HID.  (I don't have
the Wireless Presenter, so not yet ested.)

** YUREX lsusb information:
Bus 002 Device 007: ID 0c45:1010 Microdia
Device Descriptor:
   bLength                18
   bDescriptorType         1
   bcdUSB               1.10
   bDeviceClass            0 (Defined at Interface level)
   bDeviceSubClass         0
   bDeviceProtocol         0
   bMaxPacketSize0         8
   idVendor           0x0c45 Microdia
   idProduct          0x1010
   bcdDevice            0.03
   iManufacturer           1 JESS
   iProduct                2 YUREX
   iSerial                 3 10000269
   bNumConfigurations      1
   Configuration Descriptor:
     bLength                 9
     bDescriptorType         2
     wTotalLength           34
     bNumInterfaces          1
     bConfigurationValue     1
     iConfiguration          0
     bmAttributes         0xa0
       (Bus Powered)
       Remote Wakeup
     MaxPower              100mA
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        0
       bAlternateSetting       0
       bNumEndpoints           1
       bInterfaceClass         3 Human Interface Device
       bInterfaceSubClass      1 Boot Interface Subclass
       bInterfaceProtocol      0 None
       iInterface              0
         HID Device Descriptor:
           bLength                 9
           bDescriptorType        33
           bcdHID               1.10
           bCountryCode            0 Not supported
           bNumDescriptors         1
           bDescriptorType        34 Report
           wDescriptorLength      31
          Report Descriptors:
            ** UNAVAILABLE **
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x81  EP 1 IN
         bmAttributes            3
           Transfer Type            Interrupt
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0008  1x 8 bytes
         bInterval              10
Device Status:     0x0002
   (Bus Powered)
   Remote Wakeup Enabled

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26922

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Greg KH <gregkh@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
Reported-by: Thomas B?chler <thomas@archlinux.org>
Tested-by: Thomas B?chler <thomas@archlinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-07 15:34:17 +02:00
Dan Carpenter 5c699d7d3f HID: hiddev: fix use after free in hiddev_release
There are a couple use after free bugs here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
[jkosina@suse.cz: removed already fixed hunk]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-26 14:04:40 +02:00
Jimmy Hon e23be0a27d HID: add quirk for HyperPen 10000U
Add 5543:0064 UC-Logic Technology Corp. Aiptek HyperPen 10000U to quirks with
HID_QUIRK_MULTI_INPUT.

Originally the device is reporting the x,y coordinates on Z and RX. By adding
this quirk, there will be two kernel devices. The first one is muted and the
second device will report coordinates on X and Y.

Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-24 13:51:21 +02:00
Jiri Kosina 7f77897ef2 HID: hiddev: fix potential use-after-free
Commit 6cb4b04079 ("HID: hiddev: fix race between hiddev_disconnect
and hiddev_release") made it possible to access hiddev (for unlocking
the existance mutex) once hiddev has been kfreed.

Change the order so that this can not happen (always unlock the mutex first,
it is needed only to protect access to ->exist and ->open).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-24 11:43:18 +02:00
Linus Torvalds c44dead70a Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (205 commits)
  USB: EHCI: Remove SPARC_LEON {read,write}_be definitions from ehci.h
  USB: UHCI: Support big endian GRUSBHC HC
  sparc: add {read,write}*_be routines
  USB: UHCI: Add support for big endian descriptors
  USB: UHCI: Use ACCESS_ONCE rather than using a full compiler barrier
  USB: UHCI: Add support for big endian mmio
  usb-storage: Correct adjust_quirks to include latest flags
  usb/isp1760: Fix possible unlink problems
  usb/isp1760: Move function isp1760_endpoint_disable() within file.
  USB: remove remaining usages of hcd->state from usbcore and fix regression
  usb: musb: ux500: add configuration and build options for ux500 dma
  usb: musb: ux500: add dma glue layer for ux500
  usb: musb: ux500: add dma name for ux500
  usb: musb: ux500: add ux500 specific code for gadget side
  usb: musb: fix compile error
  usb-storage: fix up the unusual_realtek device list
  USB: gadget: f_audio: Fix invalid dereference of initdata
  EHCI: don't rescan interrupt QHs needlessly
  OHCI: fix regression caused by nVidia shutdown workaround
  USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage
  ...
2011-05-23 12:33:02 -07:00
Jiri Kosina 366a2382c6 Merge branches 'doc', 'multitouch', 'upstream' and 'upstream-fixes' into for-linus 2011-05-23 12:49:25 +02:00
Benjamin Tissoires 22408283bc HID: hid-multitouch: cosmetic changes, sort classes and devices
This patch sorts the defs for the MT_CLS. I choose to split
generic classes and device specific ones to be able to add
more generic classes in the future.

It also put eGalax devices at their right place (alphabetically)
in mt_devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-23 11:17:16 +02:00
Benjamin Tissoires bf5af9b5bb HID: hid-multitouch: class MT_CLS_STANTUM is redundant with MT_CLS_CONFIDENCE
Stantum devices used to work with MT_CLS_STANTUM but MT_CLS_CONFIDENCE
is exactly the same. This patch switches them to this generic class,
and remove the unused MT_CLS_STANTUM.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:42 +02:00
Benjamin Tissoires 617b64f977 HID: hid-multitouch: add support for Unitec panels
This patch introduce support for Unitec panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:42 +02:00
Benjamin Tissoires 5e74e56da0 HID: hid-multitouch: add support for Touch International panels
This patch introduce support for Touch International panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:42 +02:00
Benjamin Tissoires ee0fbd1491 HID: hid-multitouch: add support for GoodTouch panels
This patch introduce support for GoodTouch panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:42 +02:00
Benjamin Tissoires 79603dc9a8 HID: hid-multitouch: add support for CVTouch panels
This patch introduce support for CVTouch panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:41 +02:00
Benjamin Tissoires e6aac3427e HID: hid-multitouch: add support for ActionStar panels
This patch introduce support for ActionStar panels.
This device has not been optimized in term of kernel processing
operations (default class), but it will work.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 13:35:41 +02:00
Jiri Kosina 6cb4b04079 HID: hiddev: fix race between hiddev_disconnect and hiddev_release
When hiddev_disconnect() runs with chardev open, it will proceed with
usbhid_close(). When userspace in parallel runs the hiddev_release(),
it sees !hiddev->exists (as it has been already set so by
hiddev_disconnect()) and kfrees hiddev while hiddev_disconnect() hasn't
finished yet.

Serialize the access to hiddev->exists and hiddev->open by existancelock.

Reported-by: mike-@cinci.rr.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 10:50:13 +02:00
Jiri Kosina 23746a66d7 HID: magicmouse: ignore 'ivalid report id' while switching modes
The device reponds with 'invalid report id' when feature report switching it
into multitouch mode is sent to it.

This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
on Sent Reports"), but since this commit, it propagates -EIO from the _raw
callback .

So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
how the device reacts in normal mode.

Sad, but following reality.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022

Tested-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 10:28:00 +02:00
Armando Visconti 966922f26c HID: fix a crash in hid_report_raw_event() function.
I'm using a Data Modul EasyTouch USB multitouch controller,
which is issuing a hid report with a size equals to 0. The rsize
value gets set to 536870912 and Linux is crashing in the memset
because the value is too big.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-20 10:25:23 +02:00
Benjamin Tissoires c04abeeff9 HID: hid-multitouch: add support for Elo TouchSystems 2515 IntelliTouch Plus
This patch adds support for Elo TouchSystems 2515 IntelliTouch Plus
that can be found in Lenovo A700 all-in-one.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-19 11:54:55 +02:00
Jarod Wilson 437f3b199c HID: assorted usage updates from hut 1.12
I've got a Tivo Slide bluetooth remote/dongle, which uses a fair number
of hid usages that aren't currently mapped in hid-input.c. I'd initially
written additions to hid-input.c with just this device in mind,
including some bits that were specific to the device. This go around,
I'm looking at adding/correcting as many generic HID usages from the HID
Usage Tables, version 1.12, as I can -- which also serves to enable all
but four of the buttons on the Tivo Slide remote[*].

Outside of fixing the obviously incorrect mapping of 0xc 0x45 from
KEY_RADIO to KEY_RIGHT, and making use of the new KEY_IMAGES (just added
in 2.6.39-rc4) for AL Image Browser instead of KEY_MEDIA, these are
purely additions, and thus should have no negative impact on any already
functional HID devices. Most of the added mappings seemed to be
perfectly logical to me, but there were a few that were mapped on more
of an "I think this makes the most sense" basis.

[*] I'll handle the last four tivo buttons via an hid-tivo.c follow-up.

CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-18 17:07:34 +02:00
Jiri Kosina 6b7b8e488b Merge branch 'master' into upstream.
This is sync with Linus' tree to receive KEY_IMAGES definition
that went in through input tree.
2011-05-18 17:06:49 +02:00
Stefan Achatz b50f315cbb HID: roccat: fix actual/startup profile sysfs attribute in koneplus
startup_profile and actual_profile didn't work as expected. Also
as the actual profile is persistent, the distinction between the
two was ambiguous, so both use the same code now and startup_profile
has been deprecated. Also the event is now propagated through
chardev. The userland tool has been updated to support this change.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-18 16:34:06 +02:00
Benjamin Tissoires df167c4a0d HID: hid-multitouch: Add support for Lumio panels
This patch enables support for Lumio optical devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-18 15:35:51 +02:00
Daniel Mack dd2ed487fd HID: 'name' and 'phys' in 'struct hid_device' can never be NULL
As they are static members of fix size, there is no need to NULL-check them.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-18 13:23:31 +02:00
Austin Zhang 4e61f0d75a HID: hid-multitouch: add support for Ilitek dual-touch panel
Added ILITEK hid dual touch panel support into hid-multitouch.

Signed-off-by: Austin Zhang <zhang.austin@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-09 17:56:50 +02:00
Bruno Prémont 8c4e708d01 HID: picolcd: Avoid compile warning/error triggered by copy_from_user()
With CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y compilation of PicoLCD
driver fails on copy_from_user(), without it a warning is generated:

  CC [M]  drivers/hid/hid-picolcd.o
In file included from /usr/src/linux-2.6/arch/x86/include/asm/uaccess.h:571,
                 from /usr/src/linux-2.6/arch/x86/include/asm/sections.h:5,
                 from /usr/src/linux-2.6/arch/x86/include/asm/hw_irq.h:26,
                 from /usr/src/linux-2.6/include/linux/irq.h:359,
                 from /usr/src/linux-2.6/arch/x86/include/asm/hardirq.h:5,
                 from /usr/src/linux-2.6/include/linux/hardirq.h:7,
                 from /usr/src/linux-2.6/include/linux/interrupt.h:12,
                 from /usr/src/linux-2.6/include/linux/usb.h:15,
                 from /usr/src/linux-2.6/drivers/hid/hid-picolcd.c:25:
In function 'copy_from_user',
    inlined from 'picolcd_debug_eeprom_write' at drivers/hid/hid-picolcd.c:1592:
arch/x86/include/asm/uaccess_32.h:212: error: call to 'copy_from_user_overflow' declared with attribute error: copy_from_user() buffer size is not provably correct

gcc-4.4.5 is not able to track size calculation when it is stored into
a variable, thus tell copy_from_user() maximum size via
min(*max-size*, *effective-size*) explicitly and inline how much to copy
at most.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-05 13:45:52 +02:00
Michael Hund ce97cac813 USB: ldusb: add several new devices
Added several new devices to ldusb and excluded them from the HID driver.

Signed-off-by: Michael Hund <mhund@ld-didactic.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-03 10:12:00 -07:00
Peter Gundermann fdc6807fcd HID: add support for Logitech G27 wheel
Gere's a small patch to add support for the Logitech G27 wheel, since
the prior patch only added FF support for the Driving Force Pro and G25.
The patch contains the changes from the G25 and DFP, too.

I tested the changes with wine/LFS and got full support for all axes and
buttons.

Signed-off: Peter Gundermann <slim-one@users.sourceforge.net>

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-03 10:15:03 +02:00
Peter Waechtler 06268b2a38 HID: hiddev: fix error path in hiddev_read when interrupted
hiddev_read: in case mutex_lock_interruptible will be interrupted
remove the task from the wait queue.

Signed-off-by: Peter Waechtler <pwaechtler@mac.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-29 13:53:53 +02:00
Jiri Kosina 35dca5b4a6 HID: add support for Sony Navigation Controller
Sony Navigation Controller needs a special report to be sent to it
before it is able to operate, the same way as other Sony controllers
do.

Tested-by: Jacek Lukas Wotka <jlw@team-fatal.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-28 15:43:13 +02:00
Jiri Kosina 4b5730fafb HID: add support for barcode scanners from Symbol Technologies
Barcode handheld scanners produced by Symbol Technologies (0x05e0/0x0800
and 0x05e0/0x1300) need HID_QUIRK_NOGET, otherwise their firmware exposes
trouble during enumeration/initialization.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-26 10:51:28 +02:00
Benjamin Tissoires 4a6ee685fb HID: hid-multitouch: merge hid-mosart into hid-multitouch
This patch include MosArt devices into hid-multitouch.
MosArt devices now support mt-protocol B.

We also need to introduce a new quirk for mosart devices to support
their contactID.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-22 14:14:52 +02:00
John Sung 6ab3a9a63f HID: hid-multitouch: add support for PenMount dual-touch panel
This patch adds PenMount support to hid-multitouch.  A new class
MT_CLS_CONFIDENCE is defined for PenMount, since it uses HID_DG_CONFIDENCE as
the valid flag.

Signed-off-by: John Sung <penmount.touch@gmail.com>
[benjamin.tissoires@enac.fr: rebased on top of last_index_field changes]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-22 11:56:52 +02:00
Benjamin Tissoires 2955caed8b HID: hid-multitouch: refactor last_field_index
the current implementation requires the devices to report
HID_DG_CONTACTCOUNT to set the last_field_index value.
However, devices reporting in serial mode (DWAV and PenMount)
do not send this field.
Other devices (3M) add other fields in the reports descriptor
that are not multitouch related at the end, thus the need to
add a special case in the default case when handling events.

A first work around has been set up but with PenMount devices,
we have reached the limit.

The idea is to calculate the last_field_index by relying only on
multitouch fields the device send. This allows us to remove
the handling of non-multitouch events in hid-multitouch, and
guarantee that the function mt_emit_event is always called.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-and-tested-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-22 11:54:42 +02:00
Linus Torvalds 42933bac11 Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6
* 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6:
  Fix common misspellings
2011-04-07 11:14:49 -07:00
Linus Torvalds 2b9accbee5 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Add support for CH Pro Throttle
  HID: hid-magicmouse: Increase evdev buffer size
  HID: add FF support for Logitech G25/G27
  HID: roccat: Add support for wireless variant of Pyra
  HID: Fix typo Keyoutch -> Keytouch
  HID: add support for Skycable 0x3f07 wireless presenter
2011-04-07 09:42:13 -07:00
Jiri Kosina da60325d83 HID: Add support for CH Pro Throttle
CH Pro Throttle needs NOGET the same way as other products from
the same vendor require.

Reported-by: Unavowed <unavowed@vexillium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-06 07:12:32 -07:00
Chase Douglas cc5e0f08ca HID: hid-magicmouse: Increase evdev buffer size
The evdev buffer isn't big enough when you get many fingers on the
device. Bump up the buffer to a reasonable size, matching what other
multitouch devices use. Without this change, events may be discarded in
the evdev buffer before they are read.

Reported-by: Simon Budig <simon@budig.de>
Cc: Henrik Rydberg <rydberg@euromail.se>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: stable@kernel.org
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-06 06:17:45 -07:00
Simon Wood 1478d82df8 HID: add FF support for Logitech G25/G27
Small patch to add support for the G25/G27 by adding USB ID's
as suggested by Peter.

Boots but otherwise untested as I don't have hardware, .debs for
kernel (2.6.38) here if want to test/run Ubuntu/Debian:
http://www.mungewell.org/Logitech_Wii_Wheel/

Reported-by: Peter Gundermann <slim-one@users.sourceforge.net>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-01 15:51:10 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Jiri Kosina d2a1cfebe3 HID: hidraw: fix comments
Adjust the comments a little bit.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-27 20:30:32 +02:00
Dan Carpenter ac065bf214 HID: hiddev: fix brace indent
There was an extra tab so the close curly brace didn't match up with
the right if statement.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-27 11:14:40 +02:00
Stefan Achatz 3fce224608 HID: roccat: Add support for wireless variant of Pyra
Wireless variant of Roccat Pyra finally has been tested with
existing driver.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-24 12:47:46 +01:00
Benjamin Tissoires f786bba449 HID: hid-multitouch: migrate 3M PCT touch screens to hid-multitouch
This patch merges the hid-3m-pct driver into hid-multitouch.
To keep devices working the same way they used to with hid-3m-pct,
we need to add two signal/noise ratios for width and height.
We also need to work on width/height to send proper
ABS_MT_ORIENTATION flag.

Importing 3M into hid-multitouch also solved the bug in which
devices handling width and height in their report descriptors
did not show ABS_MT_TOUCH_MAJOR and ABS_MT_TOUCH_MINOR.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Stéphane Chatty <chatty@enac.fr>
Reviewed-and-tested-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-24 12:44:45 +01:00
Matthew Garrett bb7ca747f8 backlight: add backlight type
There may be multiple ways of controlling the backlight on a given
machine.  Allow drivers to expose the type of interface they are
providing, making it possible for userspace to make appropriate policy
decisions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22 17:43:59 -07:00
Stephen Boyd 3d366e2860 HID: Fix typo Keyoutch -> Keytouch
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-22 10:34:23 +01:00
Benjamin Tissoires 1e648a1372 HID: hid-multitouch: refactor initialization of ABS_MT_ORIENTATION
The way the input_set_abs_params was called for the new composite field
ABS_MT_ORIENTATION was not very clear at second reading.  We can remove the
non-necessary call to set_abs and use the simple call to input_set_abs_params.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-21 17:07:29 +01:00
Benjamin Tissoires a841b62c5d HID: hid-multitouch: migrate Cando dual touch panels to hid-multitouch
This patch merges hid-cando into the unified multitouch driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Stéphane Chatty <chatty@enac.fr>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-21 17:05:51 +01:00
Benjamin Tissoires 043b403aed HID: hid-multitouch: migrate support for Stantum panels to the unified driver.
This patch merges hid-stantum to the generic multitouch driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Stéphane Chatty <chatty@enac.fr>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-21 17:05:02 +01:00
Benjamin Tissoires 9498f954a4 HID: hid-multitouch: Auto detection of maxcontacts
This patch enables support of autodetection of maxcontacts.
When adding support for a new device, one is now able to let
the device tell how many contacts it supports, or to manually
set the value if the device happens to provide wrong information.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Reviewed-by: Stéphane Chatty <chatty@enac.fr>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-21 17:04:25 +01:00
Jiri Kosina d586dca06a HID: add support for Skycable 0x3f07 wireless presenter
This device contains the very same bug in report descriptor as the
Ortek ones do (i.e. LogicalMinimum == 1, which is wrong for the key
array).

As we have more reports for the Ortek devices, we are keeping the driver
name for now. Apparently there is a chip producer which sells chip with
this buggy descriptor to multiple vendors. Thus if such reports start
to come at highger frequency, we'll either have to rename the driver
accordingly, or come up with more generic workaround.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-21 16:12:23 +01:00
Linus Torvalds a952baa034 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (64 commits)
  Input: tsc2005 - remove 'disable' sysfs attribute
  Input: tsc2005 - add open/close
  Input: tsc2005 - handle read errors from SPI layer
  Input: tsc2005 - do not rearm timer in hardirq handler
  Input: tsc2005 - don't use work for 'pen up' handling
  Input: tsc2005 - do not use 0 in place of NULL
  Input: tsc2005 - use true/false for boolean variables
  Input: tsc2005 - hide selftest attribute if we can't reset
  Input: tsc2005 - rework driver initialization code
  Input: tsc2005 - set up bus type in input device
  Input: tsc2005 - set up parent device
  Input: tsc2005 - clear driver data after unbinding
  Input: tsc2005 - add module description
  Input: tsc2005 - remove driver banner message
  Input: tsc2005 - remove incorrect module alias
  Input: tsc2005 - convert to using dev_pm_ops
  Input: tsc2005 - use spi_get/set_drvdata()
  Input: introduce tsc2005 driver
  Input: xen-kbdfront - move to drivers/input/misc
  Input: xen-kbdfront - add grant reference for shared page
  ...
2011-03-19 22:27:06 -07:00
Linus Torvalds 7fd23a2471 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (48 commits)
  HID: add support for Logitech Driving Force Pro wheel
  HID: hid-ortek: remove spurious reference
  HID: add support for Ortek PKB-1700
  HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor'
  HID: hid-ntrig: init settle and mode check
  HID: merge hid-egalax into hid-multitouch
  HID: hid-multitouch: Send events per slot if CONTACTCOUNT is missing
  HID: ntrig remove if and drop an indent
  HID: ACRUX - activate the device immediately after binding
  HID: ntrig: apply NO_INIT_REPORTS quirk
  HID: hid-magicmouse: Correct touch orientation direction
  HID: ntrig don't dereference unclaimed hidinput
  HID: Do not create input devices for feature reports
  HID: bt hidp: send Output reports using SET_REPORT on the Control channel
  HID: hid-sony.c: Fix sending Output reports to the Sixaxis
  HID: add support for Keytouch IEC 60945
  HID: Add HID Report Descriptor to sysfs
  HID: add IRTOUCH infrared USB to hid_have_special_driver
  HID: kernel oops in out_cleanup in function hidinput_connect
  HID: Add teletext/color keys - gyration remote - EU version (GYAR3101CKDE)
  ...
2011-03-18 10:35:30 -07:00
Jiri Kosina 65b06194c9 Merge branches 'dragonrise', 'hidraw-feature', 'multitouch', 'ntrig', 'roccat', 'upstream' and 'upstream-fixes' into for-linus 2011-03-17 14:31:46 +01:00
Jiri Kosina 5623a24a80 HID: add support for Logitech Driving Force Pro wheel
Add force feedback support for Logitech Driving Force Pro wheel.

Device IDs reported by Michal Malý.

Reported-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-17 00:43:23 +01:00
Jiri Kosina e96838df55 HID: hid-ortek: remove spurious reference
Remove spurious bugzilla reference from the source comment header.

Also fix the comment to be more correct (it's HID report descriptor
rather than USB).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-17 00:39:33 +01:00
Herton Ronaldo Krzesinski 270fdc0748 HID: add support for Ortek PKB-1700
As reported on http://ubuntuforums.org/showthread.php?t=1594007 the
PKB-1700 needs same special handling as WKB-2000. This change is
originally based on patch posted by user asmoore82 on the Ubuntu
forums.

Cc: stable@kernel.org
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-17 00:32:42 +01:00
Stefan Achatz 61c29f5b18 HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor'
Mode of sysfs attribute 'sensor' was wrongly set to writeonly.
Corrected this to readwrite.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-15 15:41:20 +01:00
Rafi Rubin 7b2a64c96a HID: hid-ntrig: init settle and mode check
Adding a wait before the wakeup signal.

As a precautionary measure sanity check the current sensor mode.  If
needed reset it to "dual".

When the device is responding poorly and needs the wakeup call, it was
missing it.  Giving it a chance to settle first improves the chances
that signal gets through.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-14 13:10:13 +01:00
Richard Nauber 4875ac114d HID: merge hid-egalax into hid-multitouch
This patch merges the hid-egalax driver into hid-multitouch.  There
are two types of devices support by the hid-egalax driver: resistive
and capacitive. Here, they are implicitly distinguished by the absence
of a HID_DG_CONTACTCOUNT field in the latter, so no special code path
needs to be introduced.

As a side effect, this patch fixes the broken suspend/resume behavior
in the old driver.

[rydberg@euromail.se: minor fixups]
Signed-off-by: Richard Nauber <Richard.Nauber@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-14 13:05:08 +01:00
Henrik Rydberg f153fc3990 HID: hid-multitouch: Send events per slot if CONTACTCOUNT is missing
The recent capacitive DWAV firmwares do not use the CONTACTCOUNT
field, and the touch frame boundary can therefore not be determined.
This patch makes the driver report the touch frame at each completed
slot instead.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-14 13:05:07 +01:00
Rafi Rubin ff4046294b HID: ntrig remove if and drop an indent
Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-14 12:58:15 +01:00
Andy Botting 47340bd9fe Input: bcm5974 - add support for MacBookPro8
This patch add multitouch support for the MacBookPro8,1 and
MacBookPro8,2 models.

Cc: stable@kernel.org
Signed-off-by: Andy Botting <andy@andybotting.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-03-12 20:37:30 -08:00
Dmitry Torokhov 0ae4381097 HID: ACRUX - activate the device immediately after binding
This device does not tolerate delayed opening and goes into a coma if
we try to that. Ubuntu even has a crutch for udev that opened the device
upon seeing it for the first time, but it did not work if we happened to
boot with the device attached, since by the time userspace got around
opening the device it was too late. Let's start the device immediately
to deal with this issue.

Reported-by: Sergei Kolzun <x0r@dv-life.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-12 21:47:18 +01:00
Rafi Rubin 6638dedaec HID: ntrig: apply NO_INIT_REPORTS quirk
Probing reports does bad things with some ntrig firmwares, better to
just leave them alone.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-10 11:37:55 +01:00
Henrik Rydberg 2d9ca4e9f3 HID: hid-magicmouse: Correct touch orientation direction
The magic trackpad and mouse both report touch orientation in opposite
direction to the bcm5974 driver and what is written in
Documents/input/multi-touch-protocol.txt. This patch reverts the
direction, so that all in-kernel devices with this feature behave the
same way.

Since no known application has been utilizing this information yet, it
seems appropriate also for stable.

Cc: stable@kernel.org
Cc: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-10 00:05:59 +01:00
Rafi Rubin f41a52d301 HID: ntrig don't dereference unclaimed hidinput
Check before dereferencing field->hidinput to fix a reported invalid
deference bug.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-08 14:36:31 +01:00
Henrik Rydberg f635bd11c8 HID: Do not create input devices for feature reports
When the multi input quirk is set, there is a new input device
created for every feature report. Since the idea is to present
features per hid device, not per input device, revert back to
the original report loop and change the feature_mapping() callback
to not take the input device as argument.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Benjamin Tissoires <benjmain.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-03-01 17:25:39 +01:00
Antonio Ospite 5710fabf31 HID: hid-sony.c: Fix sending Output reports to the Sixaxis
The Sixaxis does not want the report_id as part of the data packet in
Output reports, so we have to discard buf[0] when sending the actual
control message.

Add also some documentation about that and about why
hdev->hid_output_raw_report needs to be overridden.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-02-21 13:48:50 +01:00