Commit Graph

842 Commits (dc00c8b6940aa10ab1ce6a4d10b1bfe7b848781b)

Author SHA1 Message Date
Stefan Achatz 00237bc520 HID: roccat: Correctly mark init and exit functions
Added the __init and __exit hints for module functions.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18 14:03:39 +02:00
Alan Ott a8ab5d58b0 HID: hidraw: Use Interrupt Endpoint for OUT Transfers if Available
This patch makes the hidraw driver use the first Interrupt OUT endpoint for
HID transfers to the device if such an endpoint exists. This is consistent
with the behavior of the hiddev driver, and the logic is similar.

From the USB HID specification:

   The Interrupt Out pipe is optional. If a device declares an Interrupt Out
   endpoint then Output reports are transmitted by the host to the device
   through the Interrupt Out endpoint. If no Interrupt Out endpoint is
   declared then Output reports are transmitted to a device through the
   Control endpoint, using Set_Report(Output) requests.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18 10:43:23 +02:00
Don Prince 117ea33a18 HID: hid-samsung: remove redundant key mappings
Remove 7 redundant key mappings from Desktop Wireless 6000 that are
already handled by the default hid code.

Reported-by: Robert Schedel <r.schedel@yahoo.de>
Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18 10:41:19 +02:00
Jiri Kosina d0742abaa1 HID: add omitted hid-zydacron.c file
Commit a9885c8f7b ("HID: Zydacron Remote Control driver") added
hid-zydracon driver by Don Prince, but mistakenly omitted hid-zydracon.c
file itself. Properly add the file.

Reported-by: Don Prince <dhprince.devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 20:58:47 +02:00
Don Prince b355850ba3 HID: hid-samsung: add support for Creative Desktop Wireless 6000
Add support for the multimedia buttons of the Creative Desktop Wireless 6000
keyboard/mouse combo which are not currently handled by the default/samsung HID
driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 13:36:44 +02:00
Julia Lawall aeacb6fd30 HID: picolcd: Eliminate use after free
The skip label frees resp, which has not been allocated at the point of
this goto and then does a break, based on the fact that err is non-zero.
This is replaced by a break directly.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@free@
expression E;
position p;
@@
kfree@p(E)

@@
expression free.E, subE<=free.E, E1;
position free.p;
@@

  kfree@p(E)
  ...
(
  subE = E1
|
* E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 10:42:37 +02:00
Don Prince a9885c8f7b HID: Zydacron Remote Control driver
A specialised HID driver for the Zydacron Remote Control (usb id: 13ec:0006).

The specialised HID driver adds support for the buttons which are not

currently handled by the default HID driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 10:37:04 +02:00
Julia Lawall 1721a238ba HID: Use kmemdup
Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 10:25:41 +02:00
Jiri Kosina 23d021167e HID: magicmouse: fix input registration
When HIDRAW is not set, hid_hw_start() returns ENODEV as no subsystem has
claimed the magicmouse device, and probe routine bails out. Which is not what we want.

This happens because magicmouse driver is instantiating the connection to
Input subsystem itself, and since commit 28918c211d ("HID: magicmouse: fix
oops after device removal") the HID core is not registering input device
itself.

Fix this by letting HID core register the input device (so that hid_hw_start()
succeeds, as the device is claimed by at least one subsystem) and de-register
it again later before proceeding with proper input setup.

Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-12 16:01:31 +02:00
Jiri Kosina 95736de984 HID: make Prodikeys driver standalone config option
Analogically for other full-fledged HID drivers, make the Prodikeys
driver independent on EMBEDDED.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-12 15:43:14 +02:00
Don Prince 3a370ca1dc HID: Prodikeys PC-MIDI HID Driver
A specialised HID driver for the Creative Prodikeys PC-MIDI USB Keyboard.

The Prodikeys PC-MIDI is a multifunction keyboard comprising a qwerty keyboard,
multimedia keys and a touch sensitive musical keyboard.

The specialised HID driver adds full support for the musical keyboard and extra
multimedia keys which are not currently handled by the default HID driver.

The specialised HID driver interfaces with ALSA, and presents the midi keyboard
as a rawmidi device. Sustain duration, octave shifting and the midi output
channel can be read/written form userspace via sysfs.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
ALSA parts:
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-12 15:18:59 +02:00
Antonio Ospite 81cd584394 HID: hidraw: fix indentation
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-11 10:47:55 +02:00
Rafi Rubin ab3f4980ec HID: ntrig: add filtering module parameters
Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-11 10:45:22 +02:00
Rafi Rubin eab32f5f65 HID: ntrig: add sysfs access to filter parameters
This should make it a little more convenient to tweak the filtering
parameters on the fly.  Also unlike load-time parameters, this provides
independent tuning for each device conntected.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-11 10:45:22 +02:00
Rafi Rubin 369db2a600 HID: ntrig: add sensitivity and responsiveness support
The old rejection size thresholds were too high for the 12" devices.
Larger surfaces like the Dell Studio17 exacerbated the problem since
contact size is reported on the same logical scale, making a contact
look smaller to the larger screen.

Since we have observed erroneous ghost events from these devices we
still need to filter the incoming stream.

The prior size threshold filter is still in place, though with
defaults set to leave it off.

This patch adds the two new classes of filters, those that reject
live frames before activation, and those that reject empty frames
until deactivation.  These filters are expressed in terms of a
simple state machine for clarity (I hope).

The activation filter has two components, slack and size, events
are discarded until either is satisfied.  Slack is defined as
the number of seemingly good contacts to read before accepting the
stream as valid (if the threshold is reached in the middle of a frame
the remainder of that frame is still discarded).

The deactivation filter discards empty frames until hitting a
deactivate slack.  This time measured in frames.  N-Trig devices
emit 5-8 (observed so far) empty frames at the end of multitouch
activity.  Ignoring the first few enables us to safely and gracefully
handle erroneous empty frames, thus preventing a change in the tool
state which would otherwise result in things like broken lines or
dragged objects being dropped in bad places.

Also, now that devices with different logical densities have
been observed, the aforementioned sizes are scaled from physical
to logical scales once those scales are identified.  Hopefully this
should mean that a given threshold value means the same thing across
differing devices.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-11 10:45:22 +02:00
Peter Hutterer fe6065dc30 HID: add multi-input quirk for eGalax Touchcontroller
I've got one of these devices on my desk and it seems that it suffers from
the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch
uses the same reasoning as 9db630b48 ("HID: add multi-input quirk for NextWindow
Touchscreen").

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-10 08:48:07 +02:00
Alan Stern fde4e2f732 HID: fix suspend crash by moving initializations earlier
Although the usbhid driver allocates its usbhid structure in the probe
routine, several critical fields in that structure don't get
initialized until usbhid_start().  However if report descriptor
parsing fails then usbhid_start() is never called.  This leads to
problems during system suspend -- the system will freeze.

This patch (as1378) fixes the bug by moving the initialization
statements up into usbhid_probe().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-By: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-07 23:33:52 +02:00
Antonio Ospite fddb33f2e8 HID: sony: fix sony_set_operational_bt
Don't send the report type as part of the data, this prevents the
controller from going into the operational state at all.

This is completely equivalent to what the code originally meant to accomplish:
as per in net/bluetooth/hidp/core.c::hidp_output_raw_report(), by using
HID_FEATURE_REPORT here, what will be actually sent is
(HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE) which is exactly 0x53.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-03 17:19:03 +02:00
Bruno Prémont 9d71ea057b HID: add PM support to PicoLCD device
Add PM support in order to turn off backlight on suspend, restore
it on resume and especially restore complete state on reset-resume.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-03 15:25:52 +02:00
Jiri Kosina d6d53cbc6b Merge branch 'hid-suspend' into picolcd 2010-05-03 15:25:35 +02:00
Rafi Rubin ed7e2ca24b HID: ntrig: Remove unused macro, TripleTap and QuadTap
Removing the higher number taps.  Their usage was incorrect
and even if correct they should not be used for a touch screen.
_MT_ events should be used to communicate multiple fingers.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-03 15:23:11 +02:00
Rafi Rubin 250d377522 HID: ntrig: TipSwitch for single touch mode touch.
Include TipSwitch in the touch detection decision for some single touch
firmwares.  Confidence and InRange are high for all finger events
including those used to indicate the finger is no longer in contact with
the sensor.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-03 15:23:11 +02:00
Wayne Thomas bf280628fc HID: add support for BTC Emprex 3009URF III Vista MCE Remote
The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex 3009URF III
Vista Remote Controller" uses non-standard mappings for all of its 'special
purpose' keys (0xffbc usage page).  This patch modifies the existing
hid-topseed quirky driver to support both remotes in order to prevent
proliferation of in-kernel quirky drivers until such a time that udev remapping
works with these devices.  Tested successfully with both the "Emprex" remote
and the "CyberLink" remote originally supported by the hid-topseed driver.

Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-29 00:45:01 +02:00
Bruno Prémont 0b5adf92ec HID: split picolcd's operation_mode sysfs attribute
Original operation_mode sysfs attribute accepts the operation mode
as main value with an option delay as second value to change
the start-up delay on mode change.

As it is preferred to have exactly one value per sysfs attribute,
extract this delay into a separate sysfs attribute called
operation_mode_delay.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-27 15:31:26 +02:00
Bruno Prémont 6a740aa4f4 HID: add suspend/resume hooks for hid drivers
Add suspend/resume hooks for HID drivers so these can do some
additional state adjustment when device gets suspended/resumed.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-27 15:22:00 +02:00
Alan Ott 5a38f2c7c4 HID: hidraw: fix numbered reports
Make hidraw not stick an extra byte on the beginning of an IN transfer
when a HID device contains multiple reports.

Signed-off-by: Alan Ott <alan@signal11.us>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-27 10:22:53 +02:00
Bruno Prémont 76d17e6ca3 HID: fix picolcd's version parsing
During grouping of version checking code bootloader mode's version
bytes got swapped. Fix their order.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-26 11:44:09 +02:00
Jiri Kosina 96a7813736 HID: fix build failure
Fix build failure introduced by 4afb032068 ("HID: fix
support for Wacom Intuos 4 wireless") due to missing coma.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-23 00:22:07 +02:00
Stephane Chatty ba4d8abb31 HID: Support for the 11.6" Cando panel
Added support for the 11.6" Cando panel found on the Acer Timeline 1825PTZ.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Johannes Klug <johannesklug@room2web.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-23 00:19:08 +02:00
Cory Fields c85b86a6dc HID: wacom: remove annoying non-error printk
This is the only line printed on my "quiet" boot and seems completely
unnecessary.

Signed-off-by: Cory Fields <FOSS@AtlasTechnologiesInc.com>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-21 23:29:02 +02:00
Jiri Kosina 4afb032068 HID: fix support for Wacom Intuos 4 wireless
Commit ed9eac5b49 ("HID: add support for the Wacom Intuos 4 wireles")
forgot to add VID/PID to hid_blacklist[]. Fix that up.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-21 16:22:30 +02:00
Bastien Nocera ed9eac5b49 HID: add support for the Wacom Intuos 4 wireless
Same command set as the Graphire Bluetooth tablet.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-21 16:22:03 +02:00
Lorenzo Castelli 1839221293 HID: add mappings for a few keys found on Logitech MX3200
The keys are added to the generic wireless mappings in case other
keyboards use them. Note that the product ID for the MX3200 is the same
as USB_DEVICE_ID_S510_RECEIVER_2.

Signed-off-by: Lorenzo Castelli <lcastelli@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-19 13:26:28 +02:00
Stephane Chatty 653efbb4b2 HID: fixed missing inits in hid-cando.c
With flags non initialized, the single touch emulation has an erratic
behavior. Fixed this.

Signed-off-by: Stephane Chatty <chatty@lii-enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-19 13:20:13 +02:00
Bastien Nocera b5e5a37e36 HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE
Add two quirks to make it possible for usbhid module options to
override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).

Passing HID_QUIRK_NO_IGNORE for your device means that it will
not be ignored by the HID layer, even if present in a blacklist.

HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
device, making it accessible from user-space.

Tested with an Apple IR Receiver, switching it from using appleir
to using lirc's macmini driver.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-19 13:11:43 +02:00
Stephane Chatty 36213e1e40 HID: added support for the Cando dual touch panel
Added support for the Cando dual touch panels, found in the Lenovo S10-3t.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Priya Vijayan <priya.vijayan@intel.com>
Tested-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-15 00:28:11 +02:00
Pete Zaitcev 75c28df87e HID: non-overlapping zeroing of extra bits
From my review of the way the unused bits of report are being zeroed,
it seems like there must be a bug. Currently, the zeroing is done
in hid_output_field and it covers any bits between the last used bit
and the end of the byte. But in case of, say, my keyboard, NumLock is
mask 0x01 and CapsLock is 0x02. Invoking hid_output_field for NumLock
definitely zeroes across CapsLock. The only reason this works is that
the fields are sorted by the offset.

It would be more correct and simpler to zero-fill the buffer into
which the fields are set.

The patch is tested with an IBM keyboard that is improperly sensitive
to out-of-report pad bits, the extra bits are still zeroed and the
fields continue to work as expected. It is also tested with good
keyboards.

In case, a related bug in RHEL 5 is tracked with Red Hat bug 513934.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-13 15:55:49 +02:00
Rafi Rubin 2170c5a8ae HID: ntrig: Emit TOUCH with DOUBLETAP for single touch
I squelched TipSwitch in a recent patch which resulted in the loss
of Touch events for single touch firmwares.  This patch just puts Touch back
in for single touch, and bundles it with DoubleTap (like the multitouch code).
The two events are used to convey the same message to different drivers.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-13 15:22:59 +02:00
Stephane Chatty 6dec143a50 HID: add support for 3M multitouch 22" display
Now support the 22" display and its updated firmware, including touch
width and height.

The number of touches can now go up to 60, and our single touch emulation
will fail when there are more than 6-7 touches; further work is needed on
this.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-11 20:34:50 +02:00
Bruno Prémont 5435f2818e HID: hid-picolcd depends on LCD_CLASS_DEVICE
HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:

hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'

Same applies to FB, BACKLIGHT_CLASS_DEVICE and LEDS_CLASS.

Add suboptions for those features to handle the deps on kbuild side
and just check HID_PICOLCD_* in the code.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-11 20:26:46 +02:00
Jiri Kosina c872b0fccc HID: egalax: update slab.h include
Implicit slab.h inclusion via percpu.h is about to go away.  Make sure
slab.h is included as necessary.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-10 21:29:09 +02:00
Stephane Chatty 0c3910c255 HID: add support for the eGalax dual-touch panel
Added support for the eGalax dual-touch panel, found on the Asus EeePC T101MT

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Philipp Merkel <linux@philmerk.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-10 21:28:35 +02:00
Raphaël Doursenaud 1ce31b255c HID: add support for cymotion master solar keyboard
Support the solar version of the Cherry's cymotion keyboard line using
existing cherry driver.

Signed-off-by: Raphaël Doursenaud <rdoursenaud@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-08 13:40:52 +02:00
Jiri Kosina c0858552c0 HID: ntrig: explain firmware quirk
Commit 6549981bc5 ("HID: fix N-trig touch panel with recent firmware")
adds a quirk that is needed for devices with more recent firmware so that
they become operational.

As it's not directly obvious from the code why is it needed, a comment
is worthwile.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-07 12:10:29 +02:00
Stephane Chatty 6549981bc5 HID: fix N-trig touch panel with recent firmware
Added an init message that avoids device freeze with recent firmware.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-06 23:14:07 +02:00
Tejun Heo 336f5899d2 Merge branch 'master' into export-slabh 2010-04-05 11:37:28 +09:00
Alan Stern 3d61510f4e HID: usbhid: enable remote wakeup for keyboards
This patch (as1365) enables remote wakeup by default for USB keyboard
devices.  Keyboards in general are supposed to be wakeup devices, but
the correct place to enable it depends on the device's bus; no single
approach will work for all keyboard devices.  In particular, this
covers only USB keyboards (and then only those supporting the boot
protocol).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-03 01:36:03 +02:00
Jiri Kosina eb741103f1 HID: picolcd: fix build failure
Using copy_{to,from}_user requires the include of linux/uaccess.h.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-01 08:24:42 +02:00
Bruno Prémont 9bbf2b98ba HID: add experimental access to PicoLCD device's EEPROM and FLASH
The PicoLCD device has a small amount of EEPROM and also provides access
to its FLASH where firmware and splash image are saved.
In flasher mode FLASH access is the only active feature.

Give read/write access to both via debugfs files.

NOTE: EEPROM and FLASH access should be switched to better suited API,
      until then the will reside in debugfs

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:32:31 +02:00
Bruno Prémont 467d652306 HID: add GPO (leds) support to PicoLCD device
Add leds support to PicoLCD device to drive the GPO pins.

GPO support depends on leds class and is only being
compiled if leds class has been selected.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:32:29 +02:00
Bruno Prémont e8d931bb59 HID: add lcd support to PicoLCD device
Add lcd support to PicoLCD device.

LCD support depends on lcd class and is only being
compiled if lcd class has been selected.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:32:26 +02:00
Bruno Prémont f1c2176140 HID: add backlight support to PicoLCD device
Add backlight support to PicoLCD device.

Backlight support depends on backlight class and is only being
compiled if backlight class has been selected.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:32:11 +02:00
Bruno Prémont b8c21cf697 HID: add framebuffer support to PicoLCD device
Add framebuffer support to PicoLCD device with use of deferred-io.

Only changed areas of framebuffer get sent to device in order to
save USB bandwidth and especially resources on PicoLCD device or
allow higher refresh rate for a small area. Changed tiles are
determined while updating shadow framebuffer.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:21:29 +02:00
Bruno Prémont 236db47c2b HID: new driver for PicoLCD device
Add basic driver for PicoLCD graphics device.
Initially support keypad with input device and provide support
for debugging communication via events file from debugfs.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-31 11:20:59 +02:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Jiri Kosina da54a0ced4 HID: update BKL comment in hiddev
Update comment explaining BKL usage in legacy hiddev driver.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-30 10:16:33 +02:00
Tejun Heo ed28f04b27 HID: update gfp/slab.h includes
Implicit slab.h inclusion via percpu.h is about to go away.  Make sure
gfp.h or slab.h is included as necessary.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-30 00:41:35 +02:00
Anisse Astier c565c54d9b HID: Add NOGET quirk for Quanta Pixart touchscreen
Add the NOGET quirk for the Quanta optical touchscreen present on MSI AE2220,
Otherwise, the hid-quanta driver timeouts at load time:

drivers/hid/usbhid/hid-core.c: usb_submit_urb(ctrl) failed
quanta-touch 0003:0408:3001.0003: timeout initializing reports
input: PixArt Imaging Inc. Optical Touch Screen as /class/input/input7
quanta-touch 0003:0408:3001.0003: input: USB HID v1.10 Device [PixArt Imaging Inc. Optical Touch Screen] on usb-0000:00:06.0-2/input0

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-29 16:32:57 +02:00
Jiri Kosina 0a504541b3 HID: remove excessive _EMERG messages from hidraw
We don't need to shout loudly when device gets disconnected
while hidraw node has been open, as this is properly handled
in disconnect() and protected by minors_lock already.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-25 15:20:01 +01:00
Jiri Kosina 2e57480b2a HID: remove BKL from hidraw
Remove BKL from hidraw, which is possible through fixing the
locking of minors_lock mutex properly -- it is now used to
guard all accessess to hidraw_table[], preventing it to becoming
NULL unexpectedly by unregistering the device.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-25 14:29:14 +01:00
Jiri Kosina d8e4ebf8b6 HID: fix oops in gyration_event()
Fix oops caused by dereferencing field->hidinput in cases where
the device hasn't been claimed by hid-input.

Reported-by: Andreas Demmer <mail@andreas-demmer.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-23 16:32:37 +01:00
Jiri Kosina 23d386d85a HID: fixup Kconfig entry for Roccat Kone
Make it independent on CONFIG_EMBEDDED (to be in sync with other
"full-fledged" HID drivers which are not simple quirks) and provide
a little bit better text description.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 16:33:15 +01:00
Stefan Achatz 14bf62cde7 HID: add driver for Roccat Kone gaming mouse
This Patch adds support for Kone gaming mouse from Roccat.
It provides access to profiles, settings, firmware, weight,
actual settings etc. through sysfs attributes.
Event handling of this mouse differs from standard hid behaviour
in that tilt button press is reported in each move event which
results in strange behaviour if not handled by the driver.

This is a heavily reworked version of the previously introduced driver.
The changes include most of the previously raised concerns,
memory leak and other fixes, code cleanups, adoption of additional
achieved knowlege about the hardware and is (IMHO) a much better version
than before even when I exchanged reduced USB-IO with a bigger memory
consumption.

I refused to implement one mentioned point:
Removing the 'just-because-we-can' attributes. Motivation:
Reading the clipped in weight: I'm no gamer and can't determine the
usefulness of this feature but if the manufacturer implements such a
feature it might make sense to someone and I would unwillingly limit the
functionality besides its such a small feature.
Reading the actual profile and dpi settings: Here I can testify that one
can get lost of the actual settings when switching back and forth.
The manufacturers windows driver has the ability for on-screen-display
of the values and there is a mouse in the market that has an lcd on the
underside of it to show these values. So I think this feature makes sense
not only for me and shouldn't be removed.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 16:31:42 +01:00
Przemo Firszt 20a3ce7e49 HID: add sysfs speed attribute for wacom bluetooth tablet
The attribute allows to change reporting speed of tablet from userspace through
sysfs file. The attribute is RW, valid values: 0 is low speed, 1 is high speed.
High speed is the default setting. Using low speed is a workaround if you
experience lag when using the tablet.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 09:55:26 +01:00
Przemo Firszt 06c7c313b5 HID: separate mode switching function for wacom bluetooth driver
wacom_poke function allows to switch tablet reporting speed. The patch
dosen't add any new functionality, but it's preparation for user-space
speed switching through sysfs.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 09:55:04 +01:00
Linus Torvalds c6b9e73f2f 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: avoid '\0' in hid debugfs events file
  HID: Add RGT Clutch Wheel clutch device id
  HID: ntrig: fix touch events
  HID: add quirk for UC-Logik WP4030 tablet
  HID: magicmouse: fix oops after device removal
2010-03-18 16:52:31 -07:00
Jiri Kosina f77e347bd4 HID: simplify error handling in hid_input_report()
The handling of failed debugging buffer allocation got overly
complicated. We simply want to skip the debugging code if allocation
fails and go on with event processing.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-18 14:11:53 +01:00
Jiri Kosina 1caea61eda HID: output event in debugfs even if hid_get_report() fails
if hid_get_report() fails for whatever reason, the raw output of
the report doesn't make it into 'events' file in debugfs at all, because
we leave hid_input_report() too soon.

We want the report to be always present for debugging reasons. Move the
code around, so that the event makes it to 'events' file all the time,
even if we are going to discard the report.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-18 12:09:53 +01:00
Bruno Prémont e639ba481b HID: avoid '\0' in hid debugfs events file
When dumping /sys/kernel/debug/hid/$device/events '\0' characters show up
(invisible if cat to console but shown by less or while looking at a dump
 file).  These are due to hid_debug_event() adding strlen()+1 bytes to the ring
buffer (e.g. including the trailing '\0').  Any roll-over causes a '\0' as well
as hid_debug_event() handles the ring buffers with HID_DEBUG_BUFSIZE-1 size
while hid_debug_events_read() handles it with full HID_DEBUG_BUFSIZE size.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-16 13:36:01 +01:00
Przemo Firszt 59d2334ac9 HID: expose wacom pen tablet battery through power_supply class
This patch exposes wacom pen tablet battery capacity and ac state thru
power_supply class is sysfs.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-16 11:55:43 +01:00
Bruno Prémont 4da361b691 HID: register debugfs entries before adding device
Register debugfs entries before calling device_add() so debugfs entries are
already present when HID driver's probe function gets called on device hotplug.

Also undo debugfs entry registration if device_add() fails so status
HID_STAT_ADDED and debugfs registration status remain consistent and we don't
leak the debugfs entries.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-15 14:55:40 +01:00
Markus Rathgeb 3ee8f0a2b1 HID: Add RGT Clutch Wheel clutch device id
This patch enables force feedback for the "RGT Force Feedback CLUTCH Racing Wheel".
It only modifies hid-core.c (hid_blacklist) and hid-tmff.c to add the new USB IDs.

Signed-off-by: Markus Rathgeb <rathgeb.markus@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-13 23:30:02 +01:00
Rafi Rubin 2886539d5e HID: ntrig: fix touch events
This reinstates the lost unpressing of BTN_TOUCH.  To prevent undesireably
touch toggles this also deals with tip switch events.

Added a trap to prevent going out of bounds for hidinputs with empty reports.

Clear bits of unused buttons which result in misidentification.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-10 16:10:28 +01:00
Andrej Gelenberg eff7f270e9 HID: add quirk for UC-Logik WP4030 tablet
Add HID_QUIRK_MULTI_INPUT for UC-Logik tablet.

$ lsusb
...
Bus 004 Device 002: ID 5543:0003 UC-Logic Technology Corp. Genius MousePen 4x3 Tablet/Aquila L1 Tablet

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-09 13:49:54 +01:00
Michael Poole 28918c211d HID: magicmouse: fix oops after device removal
Ask the HID core not to register an input device for the mouse.
Fix an oops after removing the device, due to leaving the new
input device registered.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-09 13:42:19 +01:00
Dmitry Torokhov 58b939959d Input: scancode in get/set_keycodes should be unsigned
The HID layer has some scan codes of the form 0xffbc0000 for logitech
devices which do not work if scancode is typed as signed int, so we need
to switch to unsigned it instead. While at it keycode being signed does
not make much sense either.

Acked-by: Márton Németh <nm127@freemail.hu>
Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-03-08 23:19:15 -08:00
Oliver Neukum 86266452f8 USB: Push BKL on open down into the drivers
Straightforward push into the drivers to allow
auditing individual drivers separately

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-02 14:54:23 -08:00
Jiri Kosina 14ef2b0c02 Merge branches 'upstream', 'raw_report_modifications' and 'apple_magic_mouse' into for-linus
Conflicts:
	drivers/hid/Kconfig
2010-02-25 17:39:16 +01:00
Jiri Kosina 57ab12e418 HID: usbhid: initialize interface pointers early enough
Move the initialization of USB interface pointers from _start()
over to _probe() callback, which is where it belongs.

This fixes case where interface is NULL when parsing of report
descriptor fails.

LKML-Reference: <20100213135720.603e5f64@neptune.home>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-17 14:25:01 +01:00
Jiri Kosina 7f978b9bf5 HID: extend mask for BUTTON usage page
Now that joystick button usages can expand over 15 buttons, we
have to properly mask out the code from hid usage to cover the
whole 0xffff available space.

Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-17 09:36:35 +01:00
Rafi Rubin ff5cf34c80 HID: hid-ntrig: Single touch mode tap
Add DOUBLETAP to events emitted when in single touch only mode.

Users with a single touch firmware report not seeing the DOUBLETAP events; this
is a side effect of dropping old mapping for confidence. The confidence mapping
may be fine for singletouch mode but causes problems in multitouch mode.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-16 17:56:20 +01:00
Rafi Rubin dbf2b17de5 HID: hid-ntrig: multitouch cleanup and fix
This cleans up the identification of multitouch groups and enables
the end of group sync.

Taps are now explicitly handled to adjust for the changes in the
event stream in multitouch mode.  Added triple and quad tap for the
benefit of tools that recognize different tap types but do not have
full multi touch support.

This cleans up the behavior particularly for the latest firmware, which
didn't work particularly well with the older version of the driver.

In this form, when multitouch is active, both mt and st events will come out of
the "N-Trig MultiTouch" device.  And when its not st events will come out of
"N-Trig Touchscreen".

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-16 13:54:23 +01:00
Rafi Rubin b0549cf1a3 HID: n-trig: remove unnecessary tool switching
With the pen and touch split apart, we no longer need to inject
additional tool switching events.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-16 13:53:52 +01:00
Rafi Rubin 943ed464f3 HID: hid-ntrig add multi input quirk and clean up
Added a quirk to enable distinct input devices.  The digitizer utilizes
three inputs to represent pen, multitouch and a normal touch screen.

With the Pen partitioned, it behaves well and does not need special
handling.

Also, I set names to the input devices to clarify the functions of the
various inputs.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-16 13:53:22 +01:00
Oliver Neukum 858155fbcc HID: usbhid: introduce timeout for stuck ctrl/out URBs
Some devices do not react to a control request (seen on APC UPS's) resulting in
a slow stream of messages, "generic-usb ... control queue full".  Therefore
request needs a timeout.

Cc: stable@kernel.org
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-12 13:07:51 +01:00
Michael Poole 71b38bd4c1 HID: magicmouse: coding style and probe failure fixes
Use proper values to initialize bool configuration variables, tabs rather than
spaces, no braces for one-line else clause, __set_bit() when the operation
doesn't have to be atomic, input_set_abs_params() rather than writing the
fields directly, and call hid_hw_stop() when appropriate to handle failures in
the probe.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-11 11:22:35 +01:00
Jiri Kosina c8a8602b76 HID: remove MODULE_VERSION from new drivers
MODULE_VERSION doesn't make too much sense for drivers merged
into main tree, as git is much better tracking revisions than
any developer might ever be.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 15:29:02 +01:00
Jiri Kosina 9f52314723 HID: fix up Kconfig entry for MagicMouse
Make Apple MagicMouse Kconfig entry consistent with other dirvers.
Also expand the tristate text a little bit more, so that it doesn't
clash with already existing HID_APPLE.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 14:59:03 +01:00
Michael Poole 128537cea4 HID: add a device driver for the Apple Magic Mouse.
The Magic Mouse requires that a driver send an unlock Report(Feature) command,
similar to the Wacom wireless tablet and Sixaxis controller quirks.  This turns
on an Input Report that isn't published in the input Report descriptor that
contains touch data (and usually overrides the normal motion and click Report).

Because the mouse has only one switch and no scroll wheel, the driver
(under control of parameters) emulates a middle button and scroll wheel.
User space could also ignore and/or re-synthesize those events based on
the reported events.

Some user-space tools to talk to the mouse directly (that is, when it is not
associated with the host's HIDP stack) are at
http://github.com/entrope/linux-magicmouse

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 14:57:33 +01:00
Michael Poole 90a006abf8 HID: Export hid_register_report
The Apple Magic Mouse (and probably other devices) publish reports that are not
called out in their HID report descriptors -- they only send them when enabled
through other writes to the device.  This allows a driver to handle these
unlisted reports.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 14:57:30 +01:00
Stephane Chatty 77f720b71d HID: Support for MosArt multitouch panel
Added support for MosArt dual-touch panels, present in the Asus T91MT notebook.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 14:52:12 +01:00
Stephane Chatty 580363db92 HID: add pressure support for the Stantum multitouch panel
Added pressure handling for Stantum multitouch panels

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 12:12:43 +01:00
Stephane Chatty b32758c721 HID: fixed bug in single-touch emulation on the stantum panel
Fixed stupid copy-paste bug in touchscreen emulation for the Stantum multitouch
panel: a flag was reset just before being tested.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-10 12:09:17 +01:00
Bastien Nocera eabe5c9058 HID: fix typo in error message
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-09 11:43:19 +01:00
Leo P White 0690535d6b HID: add mapping for "AL Network Chat" usage
Adding a mapping for the 'AL Network Chat' usage from the 'Consumer' usage
page (USB HID Usage Tables v1.11). This usage is used by some keyboards for
a multimedia key.

Signed-off-by: Leo P White <lpw25@cam.ac.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-09 11:23:00 +01:00
Thadeu Lima de Souza Cascardo c2c3489c5b HID: use multi input quirk for TouchPack touchscreen
This device generates ABS_Z and ABS_RX events, while it should be
generating ABS_X and ABS_Y instead. Using the MULTI_INPUT quirk solves
this issue.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Daniel Oliveira Nascimento <don@syst.com.br>
[jkosina@suse.cz: fixed blacklist ordering while resolving conflict]
[jkosina@suse.cz: fixed typo to make it compile]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-04 18:50:23 +01:00
Jiri Kosina 2dbf209d7a HID: make full-fledged hid-bus drivers properly selectable
For historical reasons, we don't have most of the in-tree
drivers residing on hid-bus properly selectable in kernel
configuration unless CONFIG_EMBEDDED is set.

This has been introduced on Linus' request from 14 Oct

===
As to the Kconfig options - do they really add so much space that you need to
ask for the quirks? You didn't use to. Can you make the questions depend on
EMBEDDED, or at least on the HID_COMPAT thing or whatever?
===

This still makes perfect sense for small and tiny drivers, which
just fix report descriptors, fix up HID->input mappings that slightly
violates HUT standard, send one extra packet to the device that is
needed before it becomes functional, etc.

Since then, we have been gathering more and more HID-bus drivers,
which are full-fledged drivers. For these, the size argument becomes
more valid. Plus the devices are much more special than "just violates
HID specification in this one or two tiny unimportant points".

Therefore I am marking such drivers as properly selectable no matter
the setting of CONFIG_EMBEDDED, while keeping all the small and tiny
ones compiled by default.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 16:23:45 +01:00
Jiri Kosina 342f31e84e HID: make Wacom modesetting failures non-fatal
With Wacom tablet mode-setting moved from userspace into kernel,
we don't have to consider failures of device queries through the
_raw callback as hard failure, as the driver can safely continue
anyway.

This is consistent with the current USB driver in wacom_sys.c

Reported-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 15:52:31 +01:00
Bastien Nocera f9ce7c283c HID: Enable Sixaxis controller over Bluetooth
Now that hid_output_raw_report works, port the PS3 Sixaxis
Bluetooth quirk from user-space, into kernel-space.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 15:47:53 +01:00
Bastien Nocera 46a709b900 HID: Implement Wacom quirk in the kernel
The hid-wacom driver required user-space to poke at the tablet
to make it send data about the cursor location.

This patch makes it do the same thing but in the kernel.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 15:45:49 +01:00
Jiri Kosina d4bfa033ed HID: make raw reports possible for both feature and output reports
In commit 2da31939a4 ("Bluetooth: Implement raw output support for HIDP
layer"), support for Bluetooth hid_output_raw_report was added, but it
pushes the data to the intr socket instead of the ctrl one. This has been
fixed by 6bf8268f9a ("Bluetooth: Use the control channel for raw HID reports")

Still, it is necessary to distinguish whether the report in question should be
either FEATURE or OUTPUT. For this, we have to extend the generic HID API,
so that hid_output_raw_report() callback provides means to specify this
value so that it can be passed down to lower level hardware drivers (currently
Bluetooth and USB).

Based on original patch by Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 15:41:52 +01:00
Alex Neblett f54405db66 HID: add support for Pixart Imaging Optical Touch Screen
Added support for the Pixart Imaging Inc. Optical Touch Screen found in the MSI
AE2220 and other new all in one computers to the Quanta Optical Touch
dual-touch panel driver found in the latest git clone
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git.

Signed-off-by: Alex Neblett <alexneblett01@yahoo.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03 12:03:26 +01:00
Jiri Kosina e1a0bdd802 Merge branch 'master' into upstream
Conflicts:
	drivers/hid/hid-ids.h
2010-02-02 23:10:39 +01:00
Thadeu Lima de Souza Cascardo 8127f4e883 HID: use multi input quirk for eTurboTouch touchscreen
This device generates ABS_Z and ABS_RX events, while it should be
generating ABS_X and ABS_Y instead. Using the MULTI_INPUT quirk solves
this issue.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Daniel Oliveira Nascimento <don@syst.com.br>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-02 23:05:38 +01:00
Alexander Shishkin 1c3a02c215 HID: add NOGET quirk for Prodige Cordless Combo
I happen to own a keyboard identified as 05af:3062 which is labeled as
"FlatX Coldless Combo" by "Prodige", which exhibits input problems without
NOGET quirk. For some reason, lsusb reports this device as "Jing-Mold
Enterprise Co., Ltd", which is not mentioned anywhere on the package.
A quick search on the intenet shows that there a other people who have
this in their lsusb output, but apparently they don't have the problem
I am seeing (or they are not such furious typists as myself).

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-02 21:30:34 +01:00
Jiri Kosina 7d39e84991 HID: update copyright
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-02 20:46:34 +01:00
Johnathon Harris cd9ec30da5 HID: add support for Ortek WKB-2000
This patch adds a new USB HID driver for the Ortek WKB-2000, working around an
incorrect LogicalMaximum value in the USB resource descriptor.

Tracked by http://bugzilla.kernel.org/show_bug.cgi?id=14787
Bug originally reported by Ubuntu users: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/405390

Signed-off-by: Johnathon Harris <jmharris@gmail.com>
Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-26 01:57:35 +01:00
H Hartley Sweeten 62e62da856 HID: hid-debug.c: make local symbols static
hid-debug.c: make local symbols static

The symbols hid_resolv_event and hid_dump_input_mapping
are only used locally in this file. Make them static to prevent
the following sparse warnings:

warning: symbol 'hid_resolv_event' was not declared. Should it be static?
warning: symbol 'hid_dump_input_mapping' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-15 11:38:51 +01:00
Linus Torvalds 8866f9df4a 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: wacom: Add BTN_TOOL_FINGER for pad button reporting
  HID: add device IDs for new model of Apple Wireless Keyboard
  HID: fix pad button definition in hid-wacom
  HID: Support 171 byte variant of Samsung USB IR receiver
  HID: blacklist ET&T TC5UH touchscreen controller
2010-01-13 16:10:13 -08:00
Jiri Kosina 4bb9508bbb HID: remove TENX iBuddy from blacklist
There were multiple reports which indicate that vendor messed up horribly
and the same VID/PID combination is used for completely different devices,
some of them requiring the blacklist entry and other not.

Remove the blacklist entry for this combination of VID/PID completely, and let
the user decide and unbind the driver via sysfs eventually, if needed. Proper
fix would be fixing the vendor.

References:

http://lkml.org/lkml/2009/2/10/434
http://bugzilla.kernel.org/show_bug.cgi?id=13411

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 12:00:43 +01:00
Przemo Firszt 0e253fdb3b HID: wacom: Add BTN_TOOL_FINGER for pad button reporting
Without this patch xf86-input-wacom driver wasn't able to properly recognise
pad button events. It was also causing some problems with button mapping.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 12:00:33 +01:00
Christian Schuerer-Waldheim 23aeb61e7e HID: add device IDs for new model of Apple Wireless Keyboard
Added device IDs for the new model of the Apple Wireless Keyboard
(November 2009).

Signed-off-by: Christian Schuerer-Waldheim <csw@xray.at>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 12:00:33 +01:00
Przemo Firszt d01799b2f3 HID: fix pad button definition in hid-wacom
This fix is required for xorg driver to recognise 2 pad buttons

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 12:00:32 +01:00
Stephane Chatty 49e4739a0c HID: add support for Acer T230H multitouch
Add support for the Quanta Optical Touch dual-touch panel, present in the Acer
T230H monitor, HP L2105tm, and Packard-Bell Video 200t.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Jerome Vidal <jerom3@free.fr>
Tested-by: Cedric Berthier <berthiec@gmail.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 00:29:16 +01:00
Gary Stein 74f292ca8c HID: add driver for the Logitech Flight System G940
Implements a new USB-HID for Force Feedback based on the normal
Logitech Force Feedback code and FF-Memless.

Currently only supports the FF_CONSTANT effect although the joystick
appears to support additional non-standard ones.

Signed-off-by: Gary Stein <LordCnidarian@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-13 00:26:31 +01:00
Márton Németh d67dec5b2c HID: make USB device id constant
The id_table field of the struct usb_device_id is constant in <linux/usb.h>
so it is worth to make the initialization data also constant.

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

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
	struct I1 {
	  ...
	  const struct I2 *x;
	  ...
	};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
	struct I1 y = {
	  .x = E,
	};
@c@
identifier r.I2;
identifier s.E;
@@
	const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+	const
	struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-12 14:34:43 +01:00
Stefan Glasenhardt 54a6593d65 HID: allow disabling hard-coded ISO-layout for Apple keyboards
This patch adds a new option named "iso_layout" to the driver
"hid-apple.ko", to allow disabling of the hard-coded ISO-layout.

Disabling the hard-coded layout solves the problem that the kernel-module only
works perfectly for the english/american version of the Apple aluminum
keyboard. Other versions have swapped keys, e.g. the "<"-key  is swapped with
"^"-key on the german keyboard. There is a very long bug-entry on Launchpad to
this problem:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/214786

Signed-off-by: Stefan Glasenhardt <stefan@glasen-hardt.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-06 11:21:37 +01:00
Jiri Kosina 722612cd51 HID: fix parsing of local delimiter with size 0
Acording to HID standard 1.11, value 0 allows for size being 0.
Local delimiter tag has has 0 one of the possible values.

Therefore we need to handle this case properly, to be fully compliant
with the specification.

Reported-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-05 11:45:52 +01:00
Jiri Kosina cf2f765f18 HID: handle joysticks with large number of buttons
Current HID code doesn't properly handle HID joysticks which have
larger number of buttons than what fits into current range reserved
for BTN_JOYSTICK.

One such joystick reported to not work properly is Saitek X52 Pro
Flight System.

We can't extend the range to fit more buttons in, because of backwards
compatibility reasons.

Therefore this patch introduces a new BTN_TRIGGER_HAPPY range, and
uses these to map the buttons which are over BTN_JOYSTICK limit.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [for the input.h part]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-04 12:20:56 +01:00
Jiri Kosina 92688c0c3c HID: make Stantum driver standalone config option
Analogically to commit "HID: make 3M PCT touchscreen driver
standalone config option", remove the dependency of Stantum
driver on CONFIG_EMBEDDED, as it is a standalone driver rather
than device quirk.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-04 12:04:59 +01:00
Stephane Chatty d3fb5454a8 HID: add support for Stantum multitouch panel
Added support for the Stantum multitouch panel.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-04 12:04:08 +01:00
Jiri Kosina 4b186f7203 HID: make 3M PCT touchscreen driver standalone config option
The point behind 'default !EMBEDDED' for certain HID drivers that simple and
straightforward quirks for HID devices (which are implemented as drivers on
HID bus) wouldn't have to be enabled separately, if the device is otherwise
more-or-less HID standard compliant.

But this driver is rather standalone driver, so we'd want to have it normally
selectable.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-23 13:21:34 +01:00
Stephane Chatty b6353f4f36 HID: Support for 3M multitouch panel
Add support for 3M multitouch panels.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
[jkosina@suse.cz: fix build failure because of inconsistent 3M/MMM defines]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-23 01:28:37 +01:00
Sam Ravnborg 98b8788ae9 drop explicit include of autoconf.h
kbuild.h forces include of autoconf.h on the
commandline using -include - so we do not need to
include the file explicit.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-12 13:08:15 +01:00
Alan Stern fb34d53752 USB: remove the auto_pm flag
This patch (as1302) removes the auto_pm flag from struct usb_device.
The flag's only purpose was to distinguish between autosuspends and
external suspends, but that information is now available in the
pm_message_t argument passed to suspend methods.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:21 -08:00
Robert Schedel 3975bc5630 HID: Support 171 byte variant of Samsung USB IR receiver
Extends the existing Samsung USB IrDA (0419:0001) quirk with newly reported 171
byte variant. It needs the same quirk as the other devices already supported
by hid-samsung (wrong logical range)

Refactors duplicate trace call into local helper function.

The original bug report for the new variant is available at the second half of
this ticket page:

  https://bugs.launchpad.net/bugs/326986

Signed-off-by: Robert Schedel <r.schedel@yahoo.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-11 10:59:02 +01:00
Petr Å tetiar 70c66567d1 HID: blacklist ET&T TC5UH touchscreen controller
This patch adds ET&T TC5UH touchscreen controller to HID blacklist,
because this device is handled by input/usbtouchscreen driver.

Signed-off-by: Petr Å tetiar <ynezz@true.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-10 12:19:39 +01:00
Linus Torvalds fa395aaec8 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: (51 commits)
  Input: appletouch - give up maintainership
  Input: dm355evm_kbd - switch to using sparse keymap library
  Input: wistron_btns - switch to using sparse keymap library
  Input: add generic support for sparse keymaps
  Input: fix memory leak in force feedback core
  Input: wistron - remove identification strings from DMI table
  Input: psmouse - remove identification strings from DMI tables
  Input: atkbd - remove identification strings from DMI table
  Input: i8042 - remove identification strings from DMI tables
  DMI: allow omitting ident strings in DMI tables
  Input: psmouse - do not carry DMI data around
  Input: matrix-keypad - switch to using dev_pm_ops
  Input: keyboard - fix lack of locking when traversing handler->h_list
  Input: gpio_keys - scan gpio state at probe and resume time
  Input: keyboard - add locking around event handling
  Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller
  Input: xpad - add two new Xbox 360 devices
  Input: polled device - do not start polling if interval is zero
  Input: polled device - schedule first poll immediately
  Input: add S3C24XX touchscreen driver
  ...
2009-12-09 19:52:01 -08:00
Jiri Kosina 447753d977 Merge branches 'bkl-removal', 'upstream' and 'upstream-fixes' into for-linus 2009-12-07 18:30:49 +01:00
Peter Hutterer 9db630b48a HID: add multi-input quirk for NextWindow Touchscreen.
These touchscreens are mounted onto HP TouchSmart and the Dell Studio One
19. Without a quirk they report a wrong button set and the x/y coordinates
through ABS_Z/ABS_RX, confusing the higher levels (most notably X.Org's
evdev driver).

Device id 0x003 covers models 1900, 2150, and 2700 [1] though testing could
only be performed on a model 1900.

[1] http://www.nextwindow.com/nextwindow_support/latest_tech_info.html

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-03 10:51:32 +01:00
Jiri Kosina e8d0eab4d9 HID: add support for Acan FG-8100 barcode reader
Acan FG-8100 barcode reader (0x04b4/0xbca1) has vendor ID of
cypress and requires the same MIN/MAX swap descriptor quirk
as other barcode readers from cypress.

Reported-by: Stijn Ghesquiere <stijn@applesnail.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-02 22:54:11 +01:00
Jiri Kosina 66d61bec69 HID: make Media key on Logitech DiNovo Mini work
Put proper mapping of Media key on Logitech DiNovo Mini.

According to the specification from Logitech webpage, this
key is intended to launch a Media center.

Reported-by: Stefan Plattner <Stefan.Plattner@ilogs.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-25 16:20:52 +01:00
Márton Németh 6236dfaa90 Input: do not overwrite the first part of phys string
Use strlcat() to append a string to the previously created first part.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-23 08:50:52 -08:00
Jiri Kosina 24985cf686 HID: support Logitech/3DConnexion SpaceTraveler and SpaceNavigator
These devices wrongly report their axes as relative instead of absolute.

Fix this in up report descriptor of the device before it enters the parser.

Reported-by: simon.windows@gmail.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-13 10:45:53 +01:00
Jiri Kosina 6c85773043 HID: remove BKL from hiddev_ioctl_usage()
The race between ioctl and disconnect is guarded by low level
hiddev device mutex (existancelock) since the commit
07903407 ("HID: hiddev cleanup -- handle all error conditions
properly"), therefore we can remove the lock_kernel() from
hiddev_ioctl_usage().

Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-05 18:59:03 +01:00
Jiri Kosina 5b915d9e6d HID: fixup quirk for NCR devices
NCR devices are terminally broken by design -- they claim themselves to contain
proper input applications in their HID report descriptor, but behave very badly
if treated in standard way.

According to NCR developers, the devices get confused when queried for reports
in a standard way, rendering them unusable.

NCR is shipping application called "RPSL" that can be used to drive these
devices through hiddev, under the assumption that in-kernel driver doesn't
perform initial report query.
If it does, neither in-kernel nor hiddev-based driver can operate with these
devices any more.

Introduce a quirk that skips the report query for all NCR devices. The previous
NOGET quirk was wrong and had been introduced because I misunderstood the nature
of brokenness of these devices.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-05 14:08:03 +01:00
Anssi Hannula 1168df7e1c HID: pidff - fix unnecessary loop iterations on reset
When encountering a strange value in the pool report, pidff_reset
will always refetch the report 20 times, even if one of the retries
results in a sane value. This is because a temporary variable being
used to store the value is not being updated inside the loop.

Fix it by using the value directly in the loop.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-04 10:04:08 +01:00
Keith Rutkowski 73cdcf567a HID: add NOGET quirk for another device from CH Products
This patch was applied to Fedora 11's 2.6.30.8-64 kernel and adds the
NOGET quirk for CH Products industrial class joystick(s).  It is like
the previous CH Products NOGET quirk patch for their consumer class
joysticks.  Without the quirk, the joystick would only be detected and
would not function at all in kernels >= 2.6.29.  It was tested with a CH
Products 3-axis 5-button industrial joystick, product #HG-434IS000-U-217.

Signed-off-by: Keith Rutkowski <rutkowski@signatureresearchinc.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-20 02:33:10 +02:00
Jiri Kosina ccabcd2dbe HID: remove useless DRIVER_VERSION macro
DRIVER_VERSION has no use whatosoever, it has been set to "2.6"
for ages. Remove it.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-13 22:36:57 +02:00
Jiri Kosina 88adb72bcf HID: fix MODULE_AUTHOR usage in HID modules
Remove unused (in usbhid module) DRIVER_AUTHOR macrco and properly
use multiple MODULE_AUTHOR() instances in both modules.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-13 22:36:57 +02:00
Lamarque Vieira Souza eb8141ccd3 HID: blacklist Acer Ferrari 4005 optical mouse
Marks Acer Bluetooth Optical Rechargeable Mouse from Ferrari 4005 notebook to
be ignored by hid core. This change makes hid core to use input session instead
of hid session with that mouse. With hid session the mouse cursor moves too
laggy, using input session corrects this problem.

Signed-off-by: Lamarque V. Souza <lamarque@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-13 22:36:56 +02:00
Linus Torvalds 03266d28ca 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: fix possible deadlock in hidraw_read
  HID: fix kerneldoc comment for hid_input_report()
  HID: add __init/__exit macros to twinhan.c
2009-10-13 10:10:33 -07:00
Jiri Kosina b0e14951ee HID: fix possible deadlock in hidraw_read
If the loop in hidraw_read() loops more than once, then we might
end up trying to acquire already locked mutex, casuing a deadlock.

Reported-by: iceberg <iceberg@ispras.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-12 11:25:56 +02:00
Alexey Dobriyan a99bbaf5ee headers: remove sched.h from poll.h
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-04 15:05:10 -07:00
Jiri Kosina ff9b00a226 HID: fix kerneldoc comment for hid_input_report()
The kerneldoc comment for 'interrupt' has already confused a lot
of people, as it is simply wrong. It doesn't carry the information
about the context, but is used to distinguish between two fundamental
types of low-level transport transfers -- interrupt vs. control.

Make this clear in the comment.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-01 16:03:13 +02:00
Peter Huewe fa59530267 HID: add __init/__exit macros to twinhan.c
Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of the twinhan driver in hid.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-29 13:58:20 +02:00
Linus Torvalds 50223e486c 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: Remove duplicate Kconfig entry
  HID: consolidate connect and disconnect into core code
  HID: fix non-atomic allocation in hid_input_report
2009-09-22 07:51:28 -07:00
Kay Sievers e454cea20b Driver-Core: extend devnode callbacks to provide permissions
This allows subsytems to provide devtmpfs with non-default permissions
for the device node. Instead of the default mode of 0600, null, zero,
random, urandom, full, tty, ptmx now have a mode of 0666, which allows
non-privileged processes to access standard device nodes in case no
other userspace process applies the expected permissions.

This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-19 12:50:38 -07:00
Alessandro Guido a2d693cf65 HID: Remove duplicate Kconfig entry
Signed-off-by: Alessandro Guido <ag@alessandroguido.name>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-17 15:47:26 +02:00
Jiri Kosina c4c259bcc2 HID: consolidate connect and disconnect into core code
HID core registers input, hidraw and hiddev devices, but leaves
unregistering it up to the individual driver, which is not really nice.
Let's move all the logic to the core.

Reported-by: Marcel Holtmann <marcel@holtmann.org>
Reported-by: Brian Rogers <brian@xyzw.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-17 15:15:11 +02:00
Jiri Kosina d1ff65226c HID: fix non-atomic allocation in hid_input_report
'interrupt' variable can't be used to safely determine whether
we are running in atomic context or not, as we might be called from
during control transfer completion through hid_ctrl() in atomic
context with interrupt == 0.

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-15 12:31:06 +02:00
Jiri Kosina 8123e8f7c8 Merge branches 'upstream', 'upstream-fixes' and 'debugfs' into for-linus 2009-09-13 20:09:41 +02:00
Jan Scholz 42960a1300 HID: completely remove apple mightymouse from blacklist
Commit fa047e4f6f "HID: fix inverted
wheel for bluetooth version of apple mighty mouse" is incomplete. If
we remove Apple MightyMouse (bluetooth version) from the list of
apple_devices in drivers/hid/hid-apple.c we have to remove it from
hid_blacklist in drivers/hid/hid-core.c as well.

Signed-off-by: Jan Scholz <Scholz@fias.uni-frankfurt.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-26 13:18:51 +02:00
Jiri Kosina affbb8c6e6 HID: support larger reports than 64 bytes in hiddev
hiddev userspace driver uses a rignbuffer to store the parsed usages
that should be returned through read(). This buffer is 64 bytes long,
which is sufficient for queueing single USB 1.0 low-speed report, which
is of maximum size 48 bytes.

There are however USB HID devices which are full-speed USB devices, and
therefore they are free to produce reports 64 bytes long. This is correctly
handled by HID core, but read() on hiddev node gets stuck forever, because
the ring buffer loops infinitely (as it is exactly 64 bytes long as well),
never advancing the buffer pointer.

Plus, the core driver is ready to handle highspeed devices, so we should be
able to handle reports from such devices in the hiddev driver as well, which
means we need larger ringbuffer.

Reported-by: Michael Zeisel <michael.zeisel@philips.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-20 12:04:14 +02:00
H Hartley Sweeten 52cfc61bf9 HID: local function should be static
__usbhid_submit_report() is a local function wrapped by the exported
symbol usbhid_submit_report(). As such, it should be static.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc:  Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-18 13:57:10 +02:00
Henning Glawe 4cfae3e804 HID: ignore Philips IEEE802.15.4 RF Dongle
This usb device claims to be of HID class, but is in fact a 802.15.4
lowpan transceiver, therefore the generic HID driver cannot operate this
device. A separate driver for this device will be written for this using
the new 802.15.4 stack.

Signed-off-by: Henning Glawe <glaweh@debian.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-08 11:56:11 +02:00
Jarod Wilson 31f7fd795d HID: ignore all recent SoundGraph iMON devices
After some inspection of the Windows iMON driver, several additional
device IDs were added to the lirc_imon driver. At least a few of these
have been seen in the wild, and require manual quirking to keep the
usbhid driver from binding to them. Rather than list out every single
device, ignore the entire device ID range, 0x0034 - 0x0046. Some of
these may not advertise themselves as HID devices, but no harm done to
such devices anyway. Does the right thing in brief testing w/my 0x0045
device.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-08 11:55:46 +02:00
Julia Lawall a809dda036 HID: fix memory leak on error patch in debug code
Error handling code following a kzalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-08 02:26:10 +02:00
Roel Kluin 44cb2db10d HID: fix overrun in quirks initialization
Check whether index is within bounds before testing the element.

declared in drivers/hid/usbhid/hid-core.c:62:
static char *quirks_param[MAX_USBHID_BOOT_QUIRKS] = ...

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-08 02:17:32 +02:00
Julia Lawall 3040c8203d HID: Drop NULL test on list_entry result
list_entry, which is an alias for container_of, cannot return NULL, as
there is no way to add a NULL value to a doubly linked list.

A simplified version of the semantic match that findds this problem is as
follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r@
expression x,E;
statement S1,S2;
position p,p1;
@@

*x = list_entry@p(...)
... when != x = E
*if@p1 (x == NULL) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:02 +02:00
Bruno Premont 711a680e35 HID: driver for Twinhan USB 6253:0100 remote control
Add explicit key mappings for TwinHan USB HID remote control.

All dummy Ctrl, Alt, Meta, ... key press/release events generated
by the remote are silenced by "unmapping" them. This makes Power and
Volume keys single-key and strips the regular (even while idle) key
release events for Ctrl, Alt, Meta, ...

Signed-off-by: Bruno Premont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:01 +02:00
Peter Huewe a24f423bdf HID: adding __init/__exit macros to module init/exit functions
Trivial patch which adds the __init and __exit macros to the module_init /
module_exit functions of several HID drivers from drivers/hid/

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:01 +02:00
Ruben Aos Garralda 7a84b1336a HID: add rumble support for Thrustmaster Dual Trigger 3-in-1
This patch enables rumble in Thrustmaster Dual 3-in-1 trigger gamepads (in both
PC and PS3 modes).  It uses the same code as Thrustmaster FireStorm Dual Power 2,
so it only adds new USB IDs to hid-core.c and hid-tmff.c

Signed-off-by: Ruben Aos Garralda <rubenatch@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:01 +02:00
Rafi Rubin 837b47533a HID: ntrig tool separation and pen usages
When both touch and pen are active send a tool announcement before
sending any status changes so that event users may differentiate
which tool is changing.

Restored three usage codes used by the pen.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Acked-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:01 +02:00
Sergey Senozhatsky 8b424887b6 HID: Avoid double spin_lock_init on usbhid->lock
Avoid double spin_lock_init on usbhid->lock.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:00 +02:00
Jiri Kosina fd30ea8c87 HID: add force feedback support for Logitech WingMan Formula Force GP
Add force feedback support for Logitech WingMan Formula Force GP
(0x046d/0xc293).

Reported-by: wylda@volny.cz
Tested-by: wylda@volny.cz
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:28:00 +02:00
Robert Schedel 0810b51170 HID: Support new variants of Samsung USB IR receiver (0419:0001)
This patch extends the existing Samsung IrDA (0419:0001) quirk file with newly
reported variants:

* New device variants with 203 byte and 135 byte report descriptors were
  reported to be recognized incorrectly. This patch adds an autodetection for
  those two, using report descriptor size to enable new quirks.

* Any other unknown 0419:0001 variants will now be treated without any quirk
  flags (i.e. IGNORE_HIDINPUT/HIDDEV_FORCE will not be set by default anymore).

More details:

1. Descriptor size 184 bytes ("Satelco bundled remote")
Already supported since kernel 2.6.25 (my old patch).

2. Descriptor size 203 bytes ("Optronix remote")
This receiver mostly works with the regular HID input driver. Only when some
keys are released, another spurious key press event is interpreted due to
incorrect array ranges. According to HID 1.11, section 6.2.2.5, arrays should
return a 0 value when no control is asserted, and ranges should go from 1 to
the number of elements. The patch clips the value with a logical range from
1..15 (instead of originally 0..18).

Ticket with more information available at
https://bugs.launchpad.net/bugs/326986

3. Descriptor size 135 bytes ("Gotview remote")
This receiver has a similar issue than the previous one, i.e. it mostly works
with regular HID input, except some key press events get stuck on key release.
The patch clips the array value from 1..14 (instead of originally 0..17).

Ticket with more information available at
http://bugs.archlinux.org/task/15216

4. Other unknown variants (found one report with 218 bytes,
   but no further information about issues)

For such unknown variants we should refrain from changing any device flags.
Currently, HIDINPUT is suppressed and HIDDEV is enforced (because in 2.6.25 the
quirk table did not yet allow differentiating variants and we
did not expect variants either). Now we should be as strict as
possible and enable it only for the first variant above.

Signed-off-by: Robert Schedel <r.schedel@yahoo.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-23 01:27:59 +02:00
Linus Torvalds 1fd1f28536 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: Move dereferences below a NULL test
  HID: hiddev, fix lock imbalance
2009-07-22 09:30:07 -07:00
Julia Lawall 76c317d6e5 HID: Move dereferences below a NULL test
If the NULL test is necessary, then the dereferences should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E,E1;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E=E1
      when != i
  if (E == NULL||...) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-07-20 00:03:35 +02:00
Alexey Dobriyan 405f55712d headers: smp_lock.h redux
* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
  It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

  This will make hardirq.h inclusion cheaper for every PREEMPT=n config
  (which includes allmodconfig/allyesconfig, BTW)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-12 12:22:34 -07:00
Jiri Kosina 55dba52458 HID: fix memory leak on error path in debug code
If hid_get_report() fails, we forgot to free the already allocated buffer
for debugging messages on error path. Fix that up.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-26 10:50:12 +02:00
Jiri Slaby 4859484b09 HID: hiddev, fix lock imbalance
Add omitted BKL to one switch/case.

Cc: Stable <stable@kernel.org>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-22 11:01:06 +02:00
Kay Sievers f7a386c5b8 Driver Core: usb: add nodename support for usb drivers.
This adds support for USB drivers to report their requested nodename to
userspace.  It also updates a number of USB drivers to provide the
needed subdirectory and device name to be used for them.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:30:25 -07:00
Jiri Kosina 6341de0527 Merge branches 'upstream' and 'ntrig-multitouch' into for-linus 2009-06-12 17:42:13 +02:00
Jiri Kosina cd667ce247 HID: use debugfs for events/reports dumping
This is a followup patch to the one implemeting rdesc representation in debugfs
rather than being dependent on compile-time CONFIG_HID_DEBUG setting.

The API of the appropriate formatting functions is slightly modified -- if
they are passed seq_file pointer, the one-shot output for 'rdesc' file mode
is used, and therefore the message is formatted into the corresponding seq_file
immediately.

Otherwise the called function allocated a new buffer, formats the text into the
buffer and returns the pointer to it, so that it can be queued into the ring-buffer
of the processess blocked waiting on input on 'events' file in debugfs.

'debug' parameter to the 'hid' module is now used solely for the prupose of inetrnal
driver state debugging (parser, transport, etc).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 15:20:57 +02:00
Jiri Kosina a635f9dd83 HID: use debugfs for report dumping descriptor
It is a little bit inconvenient for people who have some non-standard
HID hardware (usually violating the HID specification) to have to
recompile kernel with CONFIG_HID_DEBUG to be able to see kernel's perspective
of the HID report descriptor and observe the parsed events. Plus the messages
are then mixed up inconveniently with the rest of the dmesg stuff.

This patch implements /sys/kernel/debug/hid/<device>/rdesc file, which
represents the kernel's view of report descriptor (both the raw report
descriptor data and parsed contents).

With all the device-specific debug data being available through debugfs, there
is no need for keeping CONFIG_HID_DEBUG, as the 'debug' parameter to the
hid module will now only output only driver-specific debugging options, which has
absolutely minimal memory footprint, just a few error messages and one global
flag (hid_debug).

We use the current set of output formatting functions. The ones that need to be
used both for one-shot rdesc seq_file and also for continuous flow of data
(individual reports, as being sent by the device) distinguish according to the
passed seq_file parameter, and if it is NULL, it still output to kernel ringbuffer,
otherwise the corresponding seq_file is used for output.

The format of the output is preserved.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 15:20:55 +02:00
Jiri Kosina fa047e4f6f HID: fix inverted wheel for bluetooth version of apple mighty mouse
Bluetooth version of Apple Mighty mouse (0x05ac/0x030c) doesn't, according to
multiple reports on linux-input@, need the same quirk as the USB version of
this mouse (0x05ac/0x0304) does.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-10 10:25:56 +02:00
Jiri Kosina 70fa9f2ead HID: no more reinitializtion is needed in post_reset
No more reinitialization is needed in the post reset hook, remove
the FIXME comment.

While at it, clean up whitespaces in the immediate surrounding.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-04 15:48:38 +02:00
Jiri Kosina bbe281fad6 HID: hidraw -- fix comment about accepted devices
hidraw accepts any devices, no matter if the device has
already been claimed by other HID driver (hid-input, hidraw), and
this is intended to stay. Fix up the comment to reflect reality.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-04 15:44:25 +02:00
Stephane Chatty 57fd637ad9 HID: Multitouch support for the N-Trig touchscreen
Adds support for multitouch interaction on the N-Trig touchscreen, using the
new ABS_MT_* input constants. Single touch support works as previously. This
code was tested against two versions of the N- Trig firmware: one that supports
dual pen/finger single touch, and one that supports finger multitouch but no
pen at all. Copyright notices that looked wrong were removed, as it seems that
there is only code written in 2009 by Rafin Rubin and Stephane Chatty in this
file.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-20 15:49:35 +02:00
Stephane Chatty 89f536ccfa HID: add new multitouch and digitizer contants
Added constants to hid.h for all digitizer usages (including the new multitouch
ones that are not yet in the official USB spec but are being pushed by Microsft
as described in their paper "Digitizer Drivers for Windows Touch and Pen-Based
Computers"). Updated hid-debug.c to support the new MT input constants such as
ABS_MT_POSITION_X.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-20 15:48:35 +02:00
Sergey Belyashov f0bca45982 HID: autocentering support for Logitech Force 3D Pro
This patch adds autocentering support for Logitech Force 3D Pro.

Signed-off-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-15 16:05:57 +02:00
Jiri Kosina 0f6f4319a7 HID: fix hid-ff drivers so that devices work even without ff support
Currently, the hid-*ff force feedback drivers, which claim the blacklisted
device on a HID bus, are only compiled in if the user selects force feedback
support.

However we want the device to be supported even when the kernel is configured
without force feedback.

This patch fixes the drivers in a way that they get compiled even if force
feedback is turned off; all the force feedback support code is compiled out in
such case, and the driver works as a usual driver on HID bus, claiming and
initializing the device, making it operational without FF effects.

Reported-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-15 15:51:36 +02:00
Jussi Kivilinna fac733f029 HID: force feedback support for SmartJoy PLUS PS2/USB adapter
This driver adds force feedback support for SmartJoy PLUS PS2/USB adapter. I
made this driver one device spesific instead of making generic 'wisegroup-ff'
because I have another Wisegroup PS2/USB adapter that doesn't work same way as
SmartJoy PLUS. If another device that is compatible pops up, this driver could
be then renamed to something more generic.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-15 14:28:44 +02:00
Bastien Nocera ca2dcd40f5 HID: Wacom Graphire Bluetooth driver
Based on the work by Andrew Zabolotny, an HID driver for the Bluetooth
Wacom tablet. This is required as it uses a slightly different
protocols from what's currently support by the drivers/input/wacom*
driver, and those only support USB.

A user-space patch is required to activate mode 2 of the Wacom tablet,
as hidp does not support hid_output_raw_report.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-13 11:42:11 +02:00
Sergey Belyashov 92e0d896ce HID: autocentering support for Logitech G25 Racing Wheel
Some months ago I send patch which adds autocentering for Logitech MOMO Wheel.
Now I have access to Logitech G25 Racing Wheel and test autocentering for it. I
write patch for current kernel to support autocentering for G25 in legacy mode
(this device supports other modes, but after switching device reconnects with
ID 0xc299 and FF support comes out) and others Logitech (Driving Force,
Formula Force Ex etc) wheels with ID 046d:c294.

Signed-off-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-13 11:42:11 +02:00
Alan Stern b820aabf6c HID: add NOGET quirk for devices from CH Products
This patch (as1240) adds the NOGET quirk for three devices from CH
Products: the Pro pedals, the Combatstick joystick, and the Flight-Sim
yoke.  Without these quirks, the devices haven't worked for many
kernel releases.  Sometimes replugging them after boot-up would get
them to work and sometimes they wouldn't work at all.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Sean Hildebrand <silverwraithii@gmail.com>
Reported-by: Sid Boyce <sboyce@blueyonder.co.uk>
Tested-by: Sean Hildebrand <silverwraithii@gmail.com>
Tested-by: Sid Boyce <sboyce@blueyonder.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-11 17:09:21 +02:00
Zoltan Karcagi f520899708 HID: fix dropped device-specific quirks
Device-specific quirks are set up correctly in their respective vendor-specific
driver, then get overwritten in usbhid_parse().

This is only issue for device-specific NOGET quirks being set by driver for a
few devices out there.

Signed-off-by: Zoltan Karcagi <zkr@freemail.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-11 17:09:17 +02:00
Jiri Kosina e5288eb5ea HID: fix oops in hid_check_keys_pressed()
If the device is not claimed by hid-input (i.e devices driver by userspace
hiddev/hidraw-based drivers, or completely detached from HID
and driver by libusb), we must not check the hid->inptus, as it
is not guaranteed to be initialized, as this is performed only for devices
handled by hid-input.

Reported-by: Guillaume Chazarain <guichaz@gmail.com>
Tested-by: Guillaume Chazarain <guichaz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-02 00:02:57 +02:00
Oliver Neukum 89092ddd7a HID: fix possible deadlock in usbhid_close()
This patch switches usbhid_close() from flush_scheduled_work() to canceling
the outstanding work. This fixes a possible deadlock due to work taking
the mutex usbhid_close() holds. Lockdep reported the problem.

Signed-off-by: Oliver Neukum <oliver@neukum.org>

--
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-04-29 17:25:01 +02:00
Ulrich Dangel 2feaace40e HID: Fix the support for apple mini aluminium keyboard
Quirks for the apple mini keyboard was recently added but keyboard
was recognized as a powerbook keyboard. Adjusted boundary to the lowest
product id for the apple mini keyboard to get the right translation.

Signed-off-by: Ulrich Dangel <uli@spamt.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-04-29 11:55:18 +02:00
Christophe Borivant 243b706d8a HID: Add support for the G25 force feedback wheel in native mode
Add Product Id 0xc299 for the Logitech G25 force feedback wheel
The Logitech G25 force feedback wheel, is first recognize by the kernel
with the product id "0xc294". In this mode, we can't use all the axes
and buttons of the wheel.

Using a userland utility, it is possible to make the wheel switch to native
mode -- http://svn.vdrift.net/viewvc.cgi/trunk/tools/G25manage/?root=VDrift
In native mode, the wheel change its id number to "0xc299".

The packet that needs to be sent to the wheel to swtich to native mode and
change its PID is

	{ 0xf8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }

Signed-off-by: Christophe Borivant <christophe.borivant@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-04-17 11:39:39 +02:00
Dan Carpenter 38089c658b HID: hidraw -- fix missing unlocks in unlocked_ioctl
There were 2 places that returned directly instead of releasing their
locks.  I sent a fix for this file earlier but ended up missing these
spots.  I think what happened is that I have improved my checker script
since then...  Or maybe I just screwed up.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-04-07 16:35:56 +02:00
Linus Torvalds 5fba0925fd 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: remove compat stuff
  HID: constify arrays of struct apple_key_translation
  HID: add support for Kye/Genius Ergo 525V
  HID: Support Apple mini aluminum keyboard
  HID: support for Kensington slimblade device
  HID: DragonRise game controller force feedback driver
  HID: add support for another version of 0e8f:0003 device in hid-pl
  HID: fix race between usb_register_dev() and hiddev_open()
  HID: bring back possibility to specify vid/pid ignore on module load
  HID: make HID_DEBUG defaults consistent
  HID: autosuspend -- fix lockup of hid on reset
  HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set
  HID: fix USB HID devices after STD with autosuspend
  HID: do not try to compile PM code with CONFIG_PM unset
  HID: autosuspend support for USB HID
2009-04-03 15:25:44 -07:00
Matt LaPlante 692105b8ac trivial: fix typos/grammar errors in Kconfig texts
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:22:01 +02:00
Jiri Kosina 621de59308 Merge branch 'autosuspend' into for-next
Conflicts:

	drivers/hid/hid-core.c
2009-03-30 15:14:53 +02:00
Jiri Slaby afa5eb7c68 HID: remove compat stuff
This removal was scheduled and there is no problem with later
distros to adapt for the new bus, thanks to aliases.

module-init-tools map files are deprecated nowadays, so that
the patch which introduced hid ones into the m-i-t won't be
accepted and hence there is no reason for leaving compat stuff in.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:54 +02:00
Paul Collins b2ddd54e19 HID: constify arrays of struct apple_key_translation
Mark arrays of struct apple_key_translation const so that they may be placed in
.rodata, and adjust users to suit.

Signed-off-by: Paul Collins <paul@ondioline.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:54 +02:00
Jiri Kosina 794227415f HID: add support for Kye/Genius Ergo 525V
This device sends several buttons in a separate field, which is
wrongly described in the report descriptor. Fix it in the following
way:

- change led usage page to button
- report size 8 count 1 becomes report size 1 count 8
- the button usage range changed to 4-7 (the mouse has three buttons in
  a different field already).

Reported-by: Tomas Hanak <tomas.hanak@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:54 +02:00
Ryan Finnie fef3f571ec HID: Support Apple mini aluminum keyboard
New USB device ids and quirks for the "mini" Apple USB aluminum
keyboards released Tuesday, model A1242.  Note that while I own the ANSI
(0x021d) version and cannot verify that the ISO (0x021e) and JIS
(0x021f) versions exist, previous releases have followed the triple id
convention for awhile now, and the device ids fit perfectly between
USB_DEVICE_ID_APPLE_GEYSER4_* and USB_DEVICE_ID_APPLE_ALU_*.

Signed-off-by: Ryan Finnie <ryan@finnie.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:53 +02:00
Jiri Kosina fdf93aa332 HID: support for Kensington slimblade device
0x47d/0x2041 device sends two extra buttons in 0xff00 usage
page and therefore requires special handling.

Reported-by: Jason Noble <nobleja@polezero.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:53 +02:00
Richard Walmsley 3f866fbd52 HID: DragonRise game controller force feedback driver
Adds force feedback support for USB DragonRise Inc. game controllers.
These devices are mass produced in China and distributed under several vendors.

Signed-off-by: Richard Walmsley <richwalm@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:53 +02:00
Anssi Hannula 27a9c17930 HID: add support for another version of 0e8f:0003 device in hid-pl
Add support for another version of 0e8f:0003 device into hid-pl driver.
This device has the values in separate fields and resembles devices
handled by hid-zpff.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Tested-by: Pantelis Koukousoulas <pktoss@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:52 +02:00
Oliver Neukum e43bd67d72 HID: fix race between usb_register_dev() and hiddev_open()
upon further thought this code is still racy.

	retval = usb_register_dev(usbhid->intf, &hiddev_class);

here you open a window during which open can happen

	if (retval) {
		err_hid("Not able to get a minor for this device.");
		hid->hiddev = NULL;
		kfree(hiddev);
		return -1;
	} else {
		hid->minor = usbhid->intf->minor;
		hiddev_table[usbhid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;

and will fail because hiddev_table hasn't been updated

The obvious fix of using a mutex to guard hiddev_table doesn't work because
usb_open() and usb_register_dev() take minor_rwsem and we'd have an AB-BA
deadlock. We need a lock usb_open() also takes in the right order and that leaves
only one option, BKL. I don't like it but I see no alternative.

Once the usb_open() implements something better than lock_kernel(), we could also
do so.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:52 +02:00
Jiri Kosina 6f4303fb2e HID: bring back possibility to specify vid/pid ignore on module load
When hid quirks were converted to specialized driver, the HID_QUIRK_IGNORE
has been moved completely, as the hid_ignore_list[] has been moved into the
generic code.

However userspace already got used to the possibility that modprobing
usbhid with

	'quirks=vid:pid:0x4'

makes the device ignored by usbhid driver. So keep this quirk flag in place
for backwards compatibility.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:52 +02:00
Pavel Machek 205adbec0d HID: make HID_DEBUG defaults consistent
Make defaults consistent with help text suggestions for HID_DEBUG.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:12:51 +02:00
Linus Torvalds 8e9d208972 Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6:
  Rationalize fasync return values
  Move FASYNC bit handling to f_op->fasync()
  Use f_lock to protect f_flags
  Rename struct file->f_ep_lock
2009-03-26 16:14:02 -07:00
Oliver Neukum 6d77976800 HID: autosuspend -- fix lockup of hid on reset
This fixes a use of flush_scheduled_work() in USB HID's reset logic that can
deadlock.

Tested-by: Valdis Kletniks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-25 17:57:58 +01:00
Jiri Kosina ae2f007468 HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set
There is no point of having hid_reset_resume() when CONFIG_PM is
not set, and even the corresponding .reset_resume pointer in hid_driver
struct is properly ifdefed.

Move the definition into the ifdef CONFIG_PM part of the source to avoid

drivers/hid/usbhid/hid-core.c:1337: warning: 'hid_reset_resume' defined but not used

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-25 17:57:58 +01:00
Oliver Neukum 378a0ede12 HID: fix USB HID devices after STD with autosuspend
This patch fixes a bug caused by reset_resume not changing the internal
status flags for a device that is resumed via reset_resume. To do so the
reset handlers, which correctly assume that a device is awake, can no longer
do all the work of reset_resume handling.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-25 17:57:58 +01:00
Jiri Kosina 0f6f1407e3 HID: do not try to compile PM code with CONFIG_PM unset
Fixes this build breakage in case when CONFIG_PM is not set

drivers/hid/usbhid/hid-core.c: In function 'hid_suspend':
drivers/hid/usbhid/hid-core.c:1220: error: 'struct usb_device' has no member named 'auto_pm'
drivers/hid/usbhid/hid-core.c:1245: error: 'struct usb_device' has no member named 'auto_pm'
drivers/hid/usbhid/hid-core.c:1258: error: 'struct usb_device' has no member named 'auto_pm'

by throwing both the hid_suspend() and hid_resume() away completely
in such case, as they won't be used anyway.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-25 17:57:58 +01:00
Oliver Neukum 0361a28d3f HID: autosuspend support for USB HID
This uses the USB busy mechanism for aggessive autosuspend of USB
HID devices. It autosuspends all opened devices supporting remote wakeup
after a timeout unless

- output is being done to the device
- a key is being held down (remote wakeup isn't triggered upon key release)
- LED(s) are lit
- hiddev is opened

As in the current driver closed devices will be autosuspended even if they
don't support remote wakeup.

The patch is quite large because output to devices is done in hard interrupt
context meaning a lot a queuing and locking had to be touched. The LED stuff
has been solved by means of a simple counter. Additions to the generic HID code
could be avoided. In addition it now covers hidraw. It contains an embryonic
version of an API to let the generic HID code tell the lower levels which
capabilities with respect to power management are needed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-25 17:57:57 +01:00
Linus Torvalds 2d8620cb88 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: fix waitqueue usage in hiddev
  HID: fix incorrect free in hiddev
2009-03-19 14:50:15 -07:00
Jonathan Corbet 60aa49243d Rationalize fasync return values
Most fasync implementations do something like:

     return fasync_helper(...);

But fasync_helper() will return a positive value at times - a feature used
in at least one place.  Thus, a number of other drivers do:

     err = fasync_helper(...);
     if (err < 0)
             return err;
     return 0;

In the interests of consistency and more concise code, it makes sense to
map positive return values onto zero where ->fasync() is called.

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2009-03-16 08:34:35 -06:00
Johannes Weiner 96fe2ab830 HID: fix waitqueue usage in hiddev
DECLARE_WAITQUEUE doesn't initialize the wait descriptor's task_list
to 'empty' but to zero.

prepare_to_wait() will not enqueue the descriptor to the waitqueue and
finish_wait() will do list_del_init() on a list head that contains
NULL pointers, which oopses.

This was introduced by 079034073 "HID: hiddev cleanup -- handle all
error conditions properly".

The prior code used an unconditional add_to_waitqueue() which didn't
care about the wait descriptor's list head and enqueued the thing
unconditionally.

The new code uses prepare_to_wait() which DOES check the prior list
state, so use DEFINE_WAIT instead.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-10 22:44:01 +01:00
Johannes Weiner 48e7a3c95c HID: fix incorrect free in hiddev
If hiddev_open() fails, it wrongly frees the shared hiddev structure
kept in hiddev_table instead of the hiddev_list structure allocated
for the opened file descriptor.  Existing references to this structure
will then accessed free memory.

This was introduced by 079034073 "HID: hiddev cleanup -- handle all
error conditions properly".

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-10 22:43:56 +01:00
Anssi Hannula daedb3d6a9 HID: move tmff and zpff devices from ignore_list to blacklist
The devices handled by hid-tmff and hid-zpff were added in the
hid_ignore_list[] instead of hid_blacklist[] in hid-core.c, thus
disabling them completely.

hid_ignore_list[] causes hid layer to skip the device, while
hid_blacklist[] indicates there is a specific driver in hid bus.

Re-enable the devices by moving them to the correct list.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-02-17 13:25:01 +01:00
Dan Carpenter dfd395aff4 HID: unlock properly on error paths in hidraw_ioctl()
We can't return immediately because lock_kernel() is held.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-02-17 13:25:01 +01:00
Michael Tokarev 35cfd1d964 HID: blacklist Powercom USB UPS
For quite some time users with various UPSes from Powercom were forced to play
magic with bind/unbind in /sys in order to be able to see the UPSes.  The
beasts does not work as HID devices, even if claims to do so.  cypress_m8
driver works with the devices instead, creating a normal serial port with which
normal UPS controlling software works.

The manufacturer confirmed the upcoming models with proper HID support will
have different device IDs.  In any way, it's wrong to have two completely
different modules for one device in kernel.

Blacklist the device in HID (add it to hid_ignore_list) to stop this mess,
finally.

Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-02-17 13:25:01 +01:00
Jiri Kosina bae7eb33b2 HID: document difference between hid_blacklist and hid_ignore_list
Many people get it wrong and add device IDs into hid_blacklist instead
of hid_ignore_list. Let's put a little comment in place.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-29 11:23:12 +01:00
Jarod Wilson 656f1fb90a HID: add antec-branded soundgraph imon devices to blacklist
hid_ignore_list additions for the Antec-branded SoundGraph iMon VFD and LCD
devices (0x15c2:0x0044 and 0x0045).

These devices are driven by lirc.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-29 11:23:12 +01:00
Oliver Neukum be5d0c837c HID: fix reversed logic in disconnect testing of hiddev
The logic for testing for disconnection is reversed in an ioctl leading
to false reports of disconnection.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Folkert van Heusden <folkert@vanheusden.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-29 11:23:12 +01:00
Jiri Kosina 0fb21de079 HID: adjust report descriptor fixup for MS 1028 receiver
Report descriptor fixup for MS 1028 receiver changes also values for
Keyboard and Consumer, which incorrectly trims the range, causing correct
events being thrown away before passing to userspace.

We need to keep the GenDesk usage fixup though, as it reports totally bogus
values about axis.

Reported-by: Lucas Gadani <lgadani@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-29 11:23:11 +01:00
Linus Torvalds 7c7758f99d Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (123 commits)
  wimax/i2400m: add CREDITS and MAINTAINERS entries
  wimax: export linux/wimax.h and linux/wimax/i2400m.h with headers_install
  i2400m: Makefile and Kconfig
  i2400m/SDIO: TX and RX path backends
  i2400m/SDIO: firmware upload backend
  i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends
  i2400m/SDIO: header for the SDIO subdriver
  i2400m/USB: TX and RX path backends
  i2400m/USB: firmware upload backend
  i2400m/USB: probe/disconnect, dev init/shutdown and reset backends
  i2400m/USB: header for the USB bus driver
  i2400m: debugfs controls
  i2400m: various functions for device management
  i2400m: RX and TX data/control paths
  i2400m: firmware loading and bootrom initialization
  i2400m: linkage to the networking stack
  i2400m: Generic probe/disconnect, reset and message passing
  i2400m: host/device procotol and core driver definitions
  i2400m: documentation and instructions for usage
  wimax: Makefile, Kconfig and docbook linkage for the stack
  ...
2009-01-07 15:37:24 -08:00
Jiri Kosina 7605274914 HID: fix hid->hiddev initialization in hiddev_connect()
Commit 079034073f ("HID: hiddev cleanup -- handle all error conditions
properly") by mistake removed proper initialization of hid->hiddev pointer
in hiddev_connect() in case usb_register_dev() succeeds for the hiddev node.
Put it properly back in place.

Reported-and-tested-by: Gabriel C <nix.or.die@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-07 11:30:57 -08:00
Alan Stern 011b15df46 USB: change interface to usb_lock_device_for_reset()
This patch (as1161) changes the interface to
usb_lock_device_for_reset().  The existing interface is apparently not
very clear, judging from the fact that several of its callers don't
use it correctly.  The new interface always returns 0 for success and
it always requires the caller to unlock the device afterward.

The new routine will not return immediately if it is called while the
driver's probe method is running.  Instead it will wait until the
probe is over and the device has been unlocked.  This shouldn't cause
any problems; I don't know of any cases where drivers call
usb_lock_device_for_reset() during probe.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:52 -08:00
Jiri Kosina ed42350e02 Merge branch 'upstream-fixes' into for-next
Conflicts:

	drivers/hid/hid-ids.h
2009-01-04 01:04:09 +01:00
Jiri Kosina 4dfdc46468 HID: fix error condition propagation in hid-sony driver
sony_set_operational() only propagates return value from
usb_control_msg(), which returns negative on error and number
of transferred bytes otherwise.

Reported-by: Marcin Tolysz <tolysz@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:01:43 +01:00
Oliver Neukum b8a832b1c0 HID: fix reference count leak hidraw
The hidraw subsystem has a bug that prevents the close syscall from ever
reaching the low level driver, leading to a resource leak. Fix by replacing
postdecrement with predecrement.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:01:43 +01:00
Matt Helsley 25e61613cf HID: add proper support for pensketch 12x9 tablet
The Genius PenSketch 12x9 tablet has a puck (labeled a
"Tablet Mouse") in addition to a pen. Without registering a quirk
the tablet appears to be a single input device that reports the
wrong axis information in /proc/bus/input/devices, and sends
incorrect events (e.g. ABS_Z instead of ABS_Y). This information
confuses the X evdev driver and makes the device impossible to
use.

The quirk fixes events and splits the device into multiple input
event devices so that at least the puck is useful.

Signed-off-by: Matt Helsley <matt.helsley@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:01:43 +01:00
Alexey Klimov 5f6108cf9b HID: don't allow DealExtreme usb-radio be handled by usb hid driver
This device is already handled by radio-si470x driver, and we therefore
want usbhid to ignore it.  Patch places usb ids of that device in
ignore section of hid-core.c

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:01:43 +01:00
Jiri Kosina 1db489b295 HID: fix default Kconfig setting for TopSpeed driver
Make default setting for TopSpeed driver compliant with the defaults
of the other specialized HID drivers.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:54 +01:00
Lev Babiev f14f526d02 HID: driver for TopSeed Cyberlink quirky remote
I recently picked up a Cyberlink branded remote control produced
by TopSeed Tech Corp. Alas, it appears that this device is using
non-standard mappings for some of it's keys (Usage page 0xffbc).

Signed-off-by: Lev Babiev <harley@hosers.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:53 +01:00
Parag Warudkar ac09952bab HID: make boot protocol drivers depend on EMBEDDED
The usbmouse and usbkbd modules are not supposed to be used with regular USB
mice and keyboards. Make them depend on EMBEDDED to prevent them from being
built and loaded on non-EMBEDDED configs.

Signed-off-by: Parag Warudkar <parag.lkml@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:53 +01:00
Oliver Neukum 079034073f HID: hiddev cleanup -- handle all error conditions properly
This is a cleanup of hiddev and fixes the following issues:

- thread safety by locking in read & ioctl, introducing a per device mutex
- race between ioctl and disconnect, introducing a flag and locking
  in form of a per low level device mutex
- race between open and other methods, making sure only successfully
  opened devices are put on the list, changing order of events
- range checking both upper and lower limits of the minor range
- make sure further calls to open fail for unplugged devices even if
  the device still has opened files
- error checking for low level open
- possible loss of wakeup events, using standard waiting macros
- race in initialisation by moving registration after full initialisation

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:53 +01:00
Lukasz Lubojanski 42859e0bd2 HID: force feedback driver for GreenAsia 0x12 PID
I have implemented Force Feedback driver for another "GreeAsia" based device
(0e8f:0012 "GreenAsia Inc. USB Joystick"). The functionality was tested with
MANTA Warior MM816 and SpeedLink Strike2 SL-6635 and fftest software -
everything seems to work right.

Signed-off-by: Lukasz Lubojanski <lukasz@lubojanski.info>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:53 +01:00
David Brownell d04b431e3d HID: switch specialized drivers from "default y" to !EMBEDDED
Fix the obnoxious "default y" for all the "special" HID code, which forces folk
with EMBEDDED defined to manually override that inappropriate default for
almost 20 choices.  The general policy is against "default y"; it should apply
here too.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:52 +01:00
Jiri Kosina aae6c286da HID: set proper dev.parent in hidraw
We need to properly set parent of the hidraw device (which is the
corresponding physical device itself) in order to hidraw devices not
end up under virtual device tree.

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:52 +01:00
Jiri Slaby 3a6f82f7a2 HID: add dynids facility
Allow adding new devices to the hid drivers on the fly without
a need of kernel recompilation.

Now, one can test a driver e.g. by:
echo 0003:045E:00F0.0003 > ../generic-usb/unbind
echo 0003 045E 00F0 > new_id
from some driver subdir.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:52 +01:00
Jiri Slaby 898089d08f HID: use GFP_KERNEL in hid_alloc_buffers
We might sleep, so no problem to use GFP_KERNEL.

While at it bring the function to coding style.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:52 +01:00
Jiri Slaby 581a273960 HID: usbhid, use usb_endpoint_xfer_int
Use usb_endpoint_xfer_int() instead of direct use of constants.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:51 +01:00
Jiri Slaby 0ed94b3342 HID: move usbhid flags to usbhid.h
Move usbhid specific flags from global hid.h into local usbhid.h.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:51 +01:00
Rafi Rubin 94011f93f2 HID: add n-trig digitizer support
Added quirks for the N-Trig digitizer.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:51 +01:00
Jiri Kosina 9188e79ec3 HID: add phys and name ioctls to hidraw
The hiddev interface provides ioctl() calls which can be used
to obtain phys and raw name of the underlying device.

Add the corresponding support also into hidraw.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:51 +01:00
Kay Sievers 6bbe586fd4 HID: struct device - replace bus_id with dev_name(), dev_set_name()
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.

CC: Jiri Kosina <jkosina@suse.cz>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:51 +01:00
Alan Stern 08ef08ee8c HID: automatically call usbhid_set_leds in usbhid driver
This patch (as1146c) makes usbhid automatically call usbhid_set_leds()
for any device that supports the keyboard boot protocol.

In theory this should be perfectly safe.  BIOSes send the LED output
report as part of their normal device initialization, so any keyboard
device supporting the boot protocol has to be able to handle it.

As a side effect, the hid-dell and hid-bright drivers are no longer
needed, and the Logitech keyboard driver can be removed from hid-lg.

CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:50 +01:00
Jiri Kosina efc7ce18d9 HID: non-input reports can also be numbered
When computing the maximal buffer size needed, we must take into
account that not only input reports can be numbered.

Pointed out in bugzilla #10467

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:50 +01:00
Jiri Kosina ac26fca3e1 HID: ignore mouse interface for unibody macbooks
The mouse interface on unibody macbooks is going to be handled by
bcm59743 driver in 2.6.29.

Reported-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-04 01:00:50 +01:00
Jan Scholz ee8a1a0a1a HID: Apple ALU wireless keyboards are bluetooth devices
While parsing 'hid_blacklist' in the apple alu wireless keyboard is not found.
This happens because in the blacklist it is declared with HID_USB_DEVICE
although the keyboards are really bluetooth devices.  The same holds for
'apple_devices' list.

This patch fixes it by changing HID_USB_DEVICE to HID_BLUETOOTH_DEVICE in those
two lists.

Signed-off-by: Jan Scholz <Scholz@fias.uni-frankfurt.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-28 15:09:26 +01:00
Jiri Slaby fde5be353e HID: remove setup mutex, fix possible deadlock
It causes recursive locking warning and is unneeded after
introduction of STARTED flag.

* Resume vs. stop is effectively solved by DISCONNECT flag.
* No problem in suspend vs. start -- urb is submitted even after open
  which is possible after connect which is called after start.
* Resume vs. start solved by STARTED flag.
* Suspend vs. stop -- no problem in killing urb and timer twice.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-23 12:03:20 +01:00
Jiri Kosina 578f3a35fe HID: add USB ID for another dual gameron adapter
0x0810/0x0002 needs the very same handling as 0x0001.

Reported-by: Steve Conklin <sconklin@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-20 15:55:38 +01:00
Jiri Kosina 06d2148ed3 HID: unignore mouse on unibody macbooks
In commit a96d6ef34, the mouse interfaces on the unibody macbooks were
put into hid mouse ignore list. This was a little bit too premature
though, as the corresponding bcm5974 changes are scheduled for 2.6.29.

Remove these devices from the ignore list for now, in order to provide at
least basic functionality with the HID driver.

Will be reintroduced in 2.6.29

Reported-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-20 11:22:17 +01:00
Jiri Kosina 5181e59451 HID: fix blacklist entries for greenasia/pantherlord
Fix misplaced quirk entries for devices driven by hid-pl driver. The
devices shouls be only blacklisted by generic HID driver, not completely
ignored.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-17 01:44:38 +01:00
Jiri Slaby 131d3a7a00 HID: don't grab devices with no input
Some devices have no input interrupt endpoint. These won't be handled
by usbhid, but currently they are not refused and reside on hid bus.

Perform this checking earlier so that we refuse to control such
a device early enough (and not pass it to the hid bus at all).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-14 14:10:01 +01:00
Alexey Klimov 62a56582e0 HID: fix radio-mr800 hidquirks
This patch fixes radio-mr800 hidqurks. Removes it from blacklist entry
and places it in ignore entry in hid/hid-core.c

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:36:39 +01:00
Alexey Klimov c91c21c5a6 HID: fix kworld fm700 radio hidquirks
This patch fixes kworld fm700 usb-radio hidqurks that handled by
radio-si470x. Removes it from blacklist entry and places it in ignore
entry in hid/hid-core.c

The bug went in through the V4L/DVB tree by commit 6a13378a without
HID maintainer being involved at all.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:36:11 +01:00
Jiri Slaby e3e14de50d HID: fix start/stop cycle in usbhid driver
`stop' left out usbhid->urb* pointers and so the next `start' thought
it needs to allocate nothing and used the memory pointers previously
pointed to. This led to memory corruption and device malfunction.

Also don't forget to clear disconnect flag on start which was left set
by the previous `stop'.

This fixes

	echo DEVICE > /sys/bus/hid/drivers/DRIVER/unbind
	echo DEVICE > /sys/bus/hid/drivers/DRIVER/bind

failures.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:31:36 +01:00
Andi Kleen 43ff3a48c1 HID: use single threaded work queue for hid_compat
Use single threaded work queue for hid_compat

I doubt HID really needs to scale over multiple CPUs. So only use a
single threaded workqueue for HID_COMPAT. This avoids some excessive
thread use on systems with a larger number of CPUs.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:31:36 +01:00
Henrik Rydberg 437184ae8b HID: map macbook keys for "Expose" and "Dashboard"
On macbooks there are specific keys for the user-space functions Expose
and Dashboard, which currently has no counterpart in input.h. This patch
adds KEY_SCALE and KEY_DASHBOARD, and maps the keyboard accordingly.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:31:36 +01:00
Henrik Rydberg a96d6ef347 HID: support for new unibody macbooks
The unibody MacBook 5 and MacBook Pro 5 come with a new version of
the bcm5974 trackpad. This patch adds the USB device ids and all
the appropriate quirks, including hid_blacklist.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:31:36 +01:00
Oliver Neukum 7d672cd750 HID: fix locking in hidraw_open()
As open needs to sleep hidraw was wrong to call it with a spinlock held.
Furthermore, open can of course fail which needs to be handled.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-11-13 10:31:35 +01:00
Alexey Klimov 6a13378a56 V4L/DVB (9337a): HID: Don't allow KWorld radio fm700 be handled by usb hid drivers
This device is already handled by radio-si470x driver, and we
therefore want usbhid to ignore it.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:09:43 -02:00
Al Viro 233e70f422 saner FASYNC handling on file close
As it is, all instances of ->release() for files that have ->fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.

So let's keep our lives simple - let __fput() check FASYNC in
file->f_flags and call ->fasync() there if it's been set.  And lose that
crap in ->release() instances - leaving it there is still valid, but we
don't have to bother anymore.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01 09:49:46 -07:00
Alan Stern fa157bdfe8 HID: add quirk entry for no-name keyboard (0x13ba/0x0017)
This patch (as1157) adds a no-name PS/2-to-USB keyboard+mouse adapter
to the hid-dell driver.  (The device shows up with a Product string
saying "Generic USB K/B", nothing more.)  This will force an initial
"Set-LEDs" report to be sent to the device, without which it won't
send any keystroke information.  Several bug reports mentioning this
device have been filed in various forums; the patch should resolve
them.

This is just a temporary stop-gap for 2.6.28.  A later patch for
2.6.29 will introduce a more generic mechanism for "Set-LEDs", making
this change (and the entire hid-dell driver) unnecessary.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-30 01:06:13 +01:00
Jiri Slaby b170060c6c HID: sync on deleted io_retry timer in usbhid driver
When suspending, make sure that the timer is not running
any more.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-27 15:07:08 +01:00
Jiri Slaby 3d5afd324a HID: fix oops during suspend of unbound HID devices
Usbhid structure is allocated on start invoked only from probe
of some driver. When there is no driver, the structure is null
and causes null-dereference oopses.

Fix it by allocating the structure on probe and disconnect of
the device itself. Also make sure we won't race between start
and resume or stop and suspend respectively.

References: http://bugzilla.kernel.org/show_bug.cgi?id=11827

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Andreas Schwab <schwab@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-27 15:06:01 +01:00
Linus Torvalds ecc96e7920 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 Sony Vaio VGX-TP1E
  HID: fix lock imbalance in hiddev
  HID: fix lock imbalance in hidraw
  HID: fix hidbus/appletouch device binding regression
  HID: add hid_type to general hid struct
  HID: quirk for OLED devices present in ASUS G50/G70/G71
  HID: Remove "default m" for Thrustmaster and Zeroplus
  HID: fix hidraw_exit section mismatch
  HID: add support for another Gyration remote control
  Revert "HID: Invert HWHEEL mappings for some Logitech mice"
2008-10-26 16:34:14 -07:00
Jiri Kosina cc6e0bbb47 HID: Add support for Sony Vaio VGX-TP1E
The Sony Vaio VGX-TP1E multimedia PC has a wireless keyboard with
a touchpad.

The mouse pointer is wrongly declared as constant non-data variable, which make
HID code to completely ignore all the "Pointer" usages.
Fix the report descriptor before it enters the parser to contain touchpad
pointer description that is correctly parsable (declaring data rather than
constant).

Reported-by: Stefan Hundhammer <sh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-23 12:58:38 +02:00
Jiri Slaby eb9910894d HID: fix lock imbalance in hiddev
Don't forget to unlock_kernel() in hiddev_ioctl_usage().
Added in 7961df1681
(HID: Switch hiddev to unlocked_ioctl).

Corresponing sparse warning:
drivers/hid/usbhid/hiddev.c:515:10: warning: context imbalance in 'hiddev_ioctl_usage': wrong count at exit
drivers/hid/usbhid/hiddev.c:515:10:    context 'kernel_lock': wanted 0, got 1

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-23 01:47:34 +02:00
Jiri Slaby 0f2c5945a9 HID: fix lock imbalance in hidraw
Add omitted unlock_kernel() to hidraw_ioctl().
Added in 979c407e3b
(HID: Push down BKL into ioctl handler in hidraw).

Corresponing sparse warning:
drivers/hid/hidraw.c:267:9: warning: context imbalance in 'hidraw_ioctl': wrong count at exit
drivers/hid/hidraw.c:267:9:    context 'kernel_lock': wanted 0, got 1

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-23 01:47:30 +02:00
Jiri Slaby b4d8e4736c HID: fix hidbus/appletouch device binding regression
The appletouch mouse devices are grabbed by the hid bus and not
released even if apple driver says ENODEV (as expected) -- these
are composite USB devices, for which we only ignore the mouse
interface. This is currently not handled by hidbus code properly.

Move the ignoring one level upper to forbid the hid layer to grab the
device.

Reported-by: Justin Mattock <justinmattock@gmail.com>
Reported-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-22 14:47:18 +02:00
Jiri Slaby a73a63701f HID: add hid_type to general hid struct
Add type to the hid structure to distinguish to which device type
(now only mouse) we are talking to. Needed for per device type ignore
list support.

Note: this patch leaves the type as unknown for bluetooth devices,
there is not support for this in the hidp code.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-22 14:45:11 +02:00
Jiri Kosina ac2d98998c HID: quirk for OLED devices present in ASUS G50/G70/G71
The new revision of OLED device (0x0b05/0x175b) found in ASUS G50/G70/G71
should be ignored the same way we currently do for 0x1726, so that asus_oled
driver can make use of the device.

Reported-by: Costin Grigoras <costin.grigoras@cern.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-20 12:37:43 +02:00
Andi Kleen 550cb3c3c1 HID: Remove "default m" for Thrustmaster and Zeroplus
No reason at all to make these obscure drivers default m

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-19 20:34:31 +02:00
Greg Kroah-Hartman 46fcaec505 USB: remove warn macro from HID core
There were two stragglers that got missed in the last merge of the HID tree that forgot to change the warn() calls to dev_warn().  This patch fixes them up.

Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:41:09 -07:00
Jiri Slaby 140ae3eb6f HID: fix hidraw_exit section mismatch
hidraw_exit() marked as __exit is called from __init function
from HID core. Remove the section placement from that function.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-17 18:08:22 +02:00
Jiri Kosina 1e09320673 HID: add support for another Gyration remote control
There is a slightly different Gyration remote control, which
requires the quirks we already have in place for the 0x0002 PID,
plus KEY_MEDIA mapping is different.

Reported-by: Marc Randolph <mrand@pobox.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-17 15:51:35 +02:00
Dan Nicholson 022b7024d4 Revert "HID: Invert HWHEEL mappings for some Logitech mice"
This reverts commit 740f370dc6.

It turned out to be correct in the first place: a positive value should
be sent when the wheel is moved to the right, and a negative value when
moved to the left. This is the behavior expected by the Xorg evdev
driver. I must have had a remapping somewhere else in my system when
originally testing this. Testing on another system shows that the
unpatched kernel is correct.

Here is a bug report from Mandriva that brought the problem to my
attention:

    https://qa.mandriva.com/show_bug.cgi?id=44309#c19

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-17 11:55:44 +02:00
Linus Torvalds c813b4e16e Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits)
  UIO: Fix mapping of logical and virtual memory
  UIO: add automata sercos3 pci card support
  UIO: Change driver name of uio_pdrv
  UIO: Add alignment warnings for uio-mem
  Driver core: add bus_sort_breadthfirst() function
  NET: convert the phy_device file to use bus_find_device_by_name
  kobject: Cleanup kobject_rename and !CONFIG_SYSFS
  kobject: Fix kobject_rename and !CONFIG_SYSFS
  sysfs: Make dir and name args to sysfs_notify() const
  platform: add new device registration helper
  sysfs: use ilookup5() instead of ilookup5_nowait()
  PNP: create device attributes via default device attributes
  Driver core: make bus_find_device_by_name() more robust
  usb: turn dev_warn+WARN_ON combos into dev_WARN
  debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
  debug: Introduce a dev_WARN() function
  sysfs: fix deadlock
  device model: Do a quickcheck for driver binding before doing an expensive check
  Driver core: Fix cleanup in device_create_vargs().
  Driver core: Clarify device cleanup.
  ...
2008-10-16 12:40:26 -07:00
Greg Kroah-Hartman a9b12619f7 device create: misc: convert device_create_drvdata to device_create
Now that device_create() has been audited, rename things back to the
original call to be sane.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-16 09:24:43 -07:00
Jarod Wilson 24c88eb671 HID: blacklist additional SoundGraph iMon LCD models
hid_ignore_list additions for more SoundGraph iMon LCD devices

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-16 01:26:43 +02:00
Jiri Kosina f0bd8e4326 HID: fix/improve help texts for quirk drivers
Update the help texts for the HID-quirk drivers, so that they are a little
bit more descriptive.

Also make some obsolete help descriptions up to date.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-16 01:25:15 +02:00
Jiri Kosina b36299bcc0 HID: fix default building of HID-quirk drivers
Commit 9be7bbd54d
(HID: build drivers for all quirky devices by default)
made a wrong assumption about select/depends interaction in Kconfig,
resulting in possibility of link failure with certain configuration
options.

Fix this by explicitly having all the quirk-drivers depend on
USB_HID, default to y and make the possibility to alter the
settings dependent on EBMEDDED.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-16 01:18:54 +02:00
Jiri Kosina 9be7bbd54d HID: build drivers for all quirky devices by default
Once kernel configuration has CONFIG_HID turned on, let also all the
specialized drivers for quirky devices to be built (unless CONFIG_EMBEDDED is
specified), as usually users don't care that much which driver
gives them the functionality, but when they want generic support, they
probably want to have support for all the quirky devices as well.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:05 +02:00
Jiri Kosina df9bcace7b HID: add missing blacklist entry for Apple ATV ircontrol
This device is already handled by hid-apple driver, but the blacklist entry
was missing in generic driver.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:04 +02:00
Mauro Carvalho Chehab a48c65b35a HID: add support for Bright ABNT2 brazilian device
This keyboard needs to reset the LEDS during probe.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:04 +02:00
Mauro Carvalho Chehab ffcf70fb06 HID: Don't let Avermedia Radio FM800 be handled by usb hid drivers
Based on an original patch from Alexey Klimov <klimov.linux@gmail.com>,
against kernel version 2.6.27.

This device is already handled by radio-mr800 driver, and we therefore
want usbhid not to touch it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:04 +02:00
Mauro Carvalho Chehab 0dc491682f HID: fix numlock led on Dell device 0x413c/0x2105
This keyboard needs to re-sync numlock after probing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:03 +02:00
From: Greg Kroah-Hartman 7d89fe12bd HID: remove warn() macro from usb hid drivers
USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:03 +02:00
Greg Kroah-Hartman ddbe324919 HID: remove info() macro from usb HID drivers
USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:03 +02:00
Peter Korsgaard 0f492f2aa9 HID: add appletv IR receiver quirk
Similar to the existing IRCONTROL4 handling

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:02 +02:00
Anssi Hannula f129ea6d1e HID: fix a lockup regression when using force feedback on a PID device
Commit 8006479c9b introduced a spinlock in
input_dev->event_lock, which is locked when handling input events.
However, the hid-pidff driver sleeps when handling events as it waits for
reports being sent to the device before changing the report contents
again.
This causes a system lockup when trying to use force feedback with a PID
device, a regression introduced in 2.6.24 and 2.6.23.15.

Fix it by extracting the raw report data from struct hid_report
immediately when hid_submit_report() is called, therefore allowing
drivers to change the contents of struct hid_report immediately without
affecting the already-queued transfer.

In hid-pidff, re-add the removed usbhid_wait_io() to
pidff_erase_effect() instead, to prevent a full report queue from causing
the submission to fail, thus not freeing up device memory.
pidff_erase_effect() is not called while dev->event_lock is held.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:02 +02:00
Jiri Slaby 795750197f HID: convert to dev_* prints
Since we have a real device bound to a driver, we may use struct
device for printing. Use dev_* functions instead of printks in
4 drivers.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:01 +02:00
Jiri Slaby 76483cf4d0 HID: remove hid-ff
hid-ff.c now calls only pidff (generic driver), the special ones are now
in separate drivers. Invoke pidff on all non-special directly.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:01 +02:00
Jiri Slaby 987fbc1f7d HID: move zeroplus FF processing
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:01 +02:00
Jiri Slaby 10e41a711e HID: move thrustmaster FF processing
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:00 +02:00
Jiri Slaby 5f022298aa HID: move pantherlord FF processing
Move the force feedback processing into a separate module.

[jkosina@suse.cz: fix Kconfig texts a little bit]

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:00 +02:00
Jiri Kosina 2b107d629d HID: fix incorrent length condition in hidraw_write()
The bound check on the buffer length

	if (count > HID_MIN_BUFFER_SIZE)

is of course incorrent, the proper check is

	if (count > HID_MAX_BUFFER_SIZE)

Fix it.

Reported-by: Jerry Ryle <jerry@mindtribe.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:51:00 +02:00
Jiri Slaby d92870ddd2 HID: fix tty<->hid deadlock
hid_compat_load() runs on the default workqueue, it request_module(), it
execs modprobe, it exits, tty flushes default workqueue, it hangs, because
we are still in it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Tested-by: <Valdis.Kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:59 +02:00
Remi Cattiau d1d3a5f6ea HID: ignore iBuddy devices
iBuddy devices claim to be HID devices, but they are not.
Add them to the blacklist.

Signed-off-by: Remi Cattiau <remi@cattiau.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:59 +02:00
Tomoya Adachi 1f93445182 HID: report descriptor fix for remaining MacBook JIS keyboards
This patch fixes a problem that MacBook JIS keyboard sends wrong report
descriptors. Although it has already been fixed in the first Core 2 Duo model,
it still remains in other models of MacBook.

Signed-off-by: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:59 +02:00
Randy Dunlap e36153f5a4 HID: fix gyration build error
Fix config symbol name in ifdef to fix build error:

ERROR: "hid_compat_gyration" [drivers/hid/hid-dummy.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:58 +02:00
Sergey Belyashov 2bea94db87 HID: Autocentering support for Logitech MOMO Racing Wheel
Current kernel has no support for autocentering for Logitech wheels.  By
default autocentering enabled in wheel and constant effect does not work
properly. Using USB sniffer I found command which change autocentering
settings: 0xFE, 0x0D, 0x0R, 0x0L, 0x80, 0x00, 0x00, where R - clockwise force,
L - counter-clockwise (0x0-0xF, 0xC = 100%).

Signed-off-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:58 +02:00
Alex Chiang 6f3c0e5096 HID: fix grammo in HID_COMPAT Kconfig help text
The Kconfig option for HID_COMPAT should read "lose", not "loose".

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:58 +02:00
Jiri Kosina 66ebf66e49 HID: add support for Super Dual Box Pro USB PS2/PS2 adapter
This seems to be the very same device, as already supported Smartjoy
dual Plus, but with slightly different vendor ID. Let's support this
one too.

Reported-by: David Ashley <dashxdr@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:57 +02:00
Richard Hughes c0bd6a4298 HID: remove ignore quirk for MGE UPS devices
This patch reverts the change made four years ago here:
http://www.vg.kernel.org/pub/linux/kernel/people/gregkh/usb/2.4/usb-hid-2.4.25-pre7.patch

UPS's made by MGE can be used with usbhid just fine, and by removing the
ignore quirk allows them to be used with HAL so they just work when plugged
in, without needing to be manually configured.

With the ignore quirk in place a user would have to configure NUT before the
UPS could be used, as NUT uses it's own internal USB matching framework
to match against the USB devices, do low level control messages on the
device and then parse the HID tables all in userspace.

This is not needed, as allowing the device to be claimed as a usbhid device
allows it to be used like any other USB UPS device. The devices correctly
advertise the power device page which can be queried for the device state.

I assume the quirk was changed so that people using < libusb 0.1.8 could
still use NUT's internal HID code to manage the UPS.
libusb 0.1.8 was released quite some time ago: 2004-02-11.

This patch does not break NUT as in drivers/libusb.c the device is force
unbound from the kernel driver using usb_detach_kernel_driver_np () where
it can be controlled like normal.

[jkosina@suse.cz: adapt to the new hidbus code]

Signed-off-by: Richard Hughes <rhughes@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:57 +02:00
Jiri Kosina 0f37cd0306 HID: introduce list for hiddev creation forcing
Introduce a list of devices for which there is need to
force a creation of the hiddev interface, but still they
are operated by generic driver (i.e. certain UPS).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:57 +02:00
Jiri Slaby 606bd0a861 HID: move logitech FF processing
Merge the logitech force feedback processing directly into logitech
driver from the usbhid core.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:56 +02:00
Jiri Slaby 6edfa8dc33 HID: move reset leds quirk
Move the handling of the leds resetting from the core to
the dell and logitech drivers.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:56 +02:00
Jiri Slaby 93c10132a7 HID: move connect quirks
Move connecting from usbhid to the hid layer and fix also hidp in
that manner.
This removes all the ignore/force hidinput/hiddev connecting quirks.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:56 +02:00
Jiri Slaby fea6f1833b HID: move dell quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:55 +02:00
Jiri Slaby bd28ce008b HID: move sony quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:55 +02:00
Jiri Slaby 2b88b80301 HID: remove rdesc quirk support
Remove support for both dynamic and static report descriptor
quirks. There is no longer rdesc code which it would support,
so it's useless.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:55 +02:00
Jiri Slaby 3715ade981 HID: remove hid-input-quirks
Remove the file since these is no user now.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:54 +02:00
Jiri Slaby 980a3da6ac HID: move samsung quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:54 +02:00
Jiri Slaby 949f8fef77 HID: move gyration quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:54 +02:00
Jiri Slaby 3b8006e510 HID: move monterey quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:53 +02:00
Jiri Slaby 1e76253220 HID: move petalynx quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:53 +02:00
Jiri Slaby b5635b129b HID: move belkin quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:53 +02:00
Jiri Slaby fcfacfd359 HID: move chicony quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:53 +02:00
Jiri Slaby 1f243e302c HID: move ezkey quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:52 +02:00
Jiri Slaby 3b239cd739 HID: move cherry quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:52 +02:00
Jiri Slaby 14a21cd459 HID: move a4tech quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:51 +02:00
Jiri Slaby 0f2213208f HID: move cypress quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:51 +02:00
Jiri Slaby 90231e7eaf HID: move sunplus quirks
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:51 +02:00
Jiri Slaby 78a849a682 HID: move microsoft quirks
Move them from the core code to a separate driver.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:50 +02:00
Jiri Slaby 880d29f109 HID: indent switches/cases
Bring switch and cases into coding style and save thus some
indentation to make the code tighter.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:50 +02:00
Jiri Slaby 02ae9a1a8b HID: add compat support
Add compat option to hid code to allow loading of all modules on
systems which don't allow autoloading because of old userspace.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:50 +02:00
Jiri Slaby 8c19a51591 HID: move apple quirks
Move them from the core code to a separate driver.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:49 +02:00
Jiri Slaby d458a9dfc4 HID: move ignore quirks
Move ignore quirks from usbhid-quirks into hid-core code. Also don't output
warning when ENODEV is error code in usbhid and try ordinal input in hidp
when that error is returned.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:49 +02:00
Jiri Slaby 5f22a79923 HID: move logitech quirks
Move them from the core and input code to a separate driver.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:49 +02:00
Jiri Slaby 022e8c4d08 HID: move usage input mapping to hid.h
This mapping are currently used on 2 placces and will be needed by more
quirk drivers, so move them to hid.h to allow them to use it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:49 +02:00
Jiri Slaby 990436a7c9 HID: move ids into separate file
Move ids from hid-quirks.c into separate file, since it will be needed in
more than one place.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:48 +02:00
Jiri Slaby c500c97140 HID: hid, make parsing event driven
Next step for complete hid bus, this patch includes:
- call parser either from probe or from hid-core if there is no probe.
- add ll_driver structure and centralize some stuff there (open, close...)
- split and merge usb_hid_configure and hid_probe into several functions
  to allow hooks/fixes between them

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:48 +02:00
Jiri Slaby 85cdaf524b HID: make a bus from hid code
Make a bus from hid core. This is the first step for converting all the
quirks and separate almost-drivers into real drivers attached to this bus.

It's implemented to change behaviour in very tiny manner, so that no driver
needs to be changed this time.

Also add generic drivers for both usb and bt into usbhid or hidp
respectively which will bind all non-blacklisted device. Those blacklisted
will be either grabbed by special drivers or by nobody if they are broken at
the very rude base.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-10-14 23:50:48 +02:00
Henrik Rydberg f89bd95c5c Input: bcm5974 - add driver for Macbook Air and Pro Penryn touchpads
This driver adds support for the multitouch trackpad on the new
Apple Macbook Air and Macbook Pro Penryn laptops. It replaces the
appletouch driver on those computers, and integrates well with the
synaptics driver of the Xorg system.

[dtor@mail.ru: various cleanups]
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-08-08 16:23:01 -04:00
Jiri Kosina b22d837006 Merge branches 'upstream' and 'upstream-fixes' into for-linus 2008-07-23 15:26:10 +02:00
Henrik Rydberg 6a250778c7 HID: apple_fn_keys F5 and F6
In drivers/hid/hid-input.c, the apple_fn_keys translation table
contains no entries for the F5 and F6 keys. This patch maps the F5 and
F6 keys to KBDILLUMDOWN and KBDILLUMUP, respektively, which make them
work as keyboard backlight control keys.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:22 +02:00
Jiri Kosina acc0b7c409 HID: remove quirk lookup from usbkbd/usbmouse
This patch completely removes the dependency of usbkbd and usbmouse drivers
on usbhid code.

usbkbd/usbmouse drivers are not needed in the vast majority of cases anyway,
and they shouldn't be loaded in standard configurations at all. They are supposed
to be as trivial as possible, and searching for HID_QUIRK_IGNORE can even be
bad in some cases.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:22 +02:00
Dmitry Torokhov 094403ce3e HID: Add mapping of new KEY_MEDIA_REPEAT keycode
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:22 +02:00
Daniel Walker a7f32697ed HID: gyration remote support
This adds in a quirk for the additional un-mapped buttons on the
gyration MCE remote.

Defines are now alphabetical.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:22 +02:00
Jiri Kosina 32146dc908 HID: gyration sleep button quirk
This patch is based on one provided by Jiri Kosina to handle the sleep
button. I just added some cleanup and integrated it into my series.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Jiri Kosina 2c3e3bfbb6 HID: add quirk for Logitech DiNovo desktop
Logitech DiNovo desktop needs the same quirk as other DiNovo
devices.

Reported-by: Farid Benamrouche <farid.benamrouche@free.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Jiri Slaby dc25b78f21 HID: fix quirk handling in usbmouse/kbd
When usbmouse/kbd is set to build, USB_HID is never defined due to
the USB_HID!=y Kconfig rule. Test CONFIG_USB_HID_MODULE in both
drivers instead.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Jiri Kosina 4db1c62c99 HID: fix memory leak in hidraw_release
hidraw_release() forgot to free the linked list structure, causing memory
leak.

Reported-by: Juan Marcos Diez Esteban <juan_m_diez@yahoo.es>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Dan Nicholson 740f370dc6 HID: Invert HWHEEL mappings for some Logitech mice
Some Logitech mice have a tilt wheel which register as HWHEEL buttons.
The events are positive for a click to the right and negative for a
click to the left. Applications expect the opposite, though.

I suspect this affects a lot more Logitech mice, but these are the only
two I have. I tested this using evtest and a GTK application. A similar
Microsoft Intellimouse I have works correctly.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Ming Lei a44ebccea8 HID:usbkbd:mark usb_kbd_keycode array as const
mark it as const because it is read only

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:21 +02:00
Alexandre Karpenko 37cdffdadf HID: add fn key support on Macbook Pro 4,1 and Macbook Air
Added device ids to hid-quriks for detection of keyboards on 4th
generation Macbook Pro and Macbook Air

The naming scheme is consistent with past Apple keyboards in hid-quirks;
as defined by Apple (including device ids) in:
/System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/Co
ntents/Info.plist
Patch was originally posted and tested at:
https://bugs.launchpad.net/mactel-support/+bug/207127

Signed-off-by: Alexandre Karpenko <alexander@comm.utoronto.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:25:20 +02:00
Jiri Kosina 00b33277fa HID: remove unused variable from hiddev compat ioctl
Remove unused inode variable from hiddev compat ioctl handler.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:21:55 +02:00
Jiri Kosina 88af45bafd HID: fix compile issue in hiddev ioctl
Fix build failure introduced by Alan's ioctl -> unlocked_ioctl
(pushing BKL down to the driver) conversion patch for hiddev.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2008-07-23 15:21:55 +02:00