04 Apr, 2009

1 commit

  • * '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

    Linus Torvalds
     

30 Mar, 2009

12 commits

  • Signed-off-by: Matt LaPlante
    Acked-by: Randy Dunlap
    Signed-off-by: Jiri Kosina

    Matt LaPlante
     
  • Conflicts:

    drivers/hid/hid-core.c

    Jiri Kosina
     
  • 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
    Cc: Jiri Kosina
    Signed-off-by: Jiri Kosina

    Jiri Slaby
     
  • 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
    Signed-off-by: Jiri Kosina

    Paul Collins
     
  • 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
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     
  • 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
    Signed-off-by: Jiri Kosina

    Ryan Finnie
     
  • 0x47d/0x2041 device sends two extra buttons in 0xff00 usage
    page and therefore requires special handling.

    Reported-by: Jason Noble
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     
  • 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
    Signed-off-by: Jiri Kosina

    Richard Walmsley
     
  • 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
    Tested-by: Pantelis Koukousoulas
    Signed-off-by: Jiri Kosina

    Anssi Hannula
     
  • 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
    Signed-off-by: Jiri Kosina

    Oliver Neukum
     
  • 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

    Jiri Kosina
     
  • Make defaults consistent with help text suggestions for HID_DEBUG.

    Signed-off-by: Pavel Machek
    Signed-off-by: Jiri Kosina

    Pavel Machek
     

27 Mar, 2009

1 commit


26 Mar, 2009

5 commits

  • This fixes a use of flush_scheduled_work() in USB HID's reset logic that can
    deadlock.

    Tested-by: Valdis Kletniks
    Signed-off-by: Oliver Neukum
    Signed-off-by: Jiri Kosina

    Oliver Neukum
     
  • 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
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     
  • 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
    Tested-by: Laurent Riffard
    Signed-off-by: Jiri Kosina

    Oliver Neukum
     
  • 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
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     
  • 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
    Signed-off-by: Jiri Kosina

    Oliver Neukum
     

20 Mar, 2009

1 commit


16 Mar, 2009

1 commit

  • 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
    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

11 Mar, 2009

2 commits

  • 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
    Cc: Oliver Neukum
    Cc: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Jiri Kosina

    Johannes Weiner
     
  • 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
    Cc: Oliver Neukum
    Cc: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Jiri Kosina

    Johannes Weiner
     

17 Feb, 2009

3 commits

  • 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
    Signed-off-by: Jiri Kosina

    Anssi Hannula
     
  • We can't return immediately because lock_kernel() is held.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Jiri Kosina

    Dan Carpenter
     
  • 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
    Signed-off-by: Jiri Kosina

    Michael Tokarev
     

29 Jan, 2009

4 commits


08 Jan, 2009

3 commits

  • * 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
    ...

    Linus Torvalds
     
  • Commit 079034073fa ("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
    Signed-off-by: Jiri Kosina
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • 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
    Cc: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

04 Jan, 2009

7 commits