1. 14 6月, 2011 1 次提交
  2. 13 6月, 2011 2 次提交
    • S
      HID: hid-sony: fix endiannes of Sixaxis accel/gyro values · c9e4d877
      Simon Wood 提交于
      The accelerometers/gyro on the Sixaxis are reported in the wrong
      endianness (ie. not compatible with HID), so this patch intercepts
      the report and swaps the appropriate bytes over.
      
      Accelerometers are scaled with a nominal value of +/-4000 = 1G,
      maximum value would be around +/-32768 = 8G.
      
      Gyro on my device always reports -32768, might need some calibration
      set within the controller.
      
      Fix extracted from previous patch submission:
      https://patchwork.kernel.org/patch/95212/Signed-off-by: NMarcin Tolysz <tolysz@gmail.com>
      Signed-off-by: NSimon Wood <simon@mungewell.org>
      Signed-off-by: NAntonio Ospite <ospite@studenti.unina.it>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      c9e4d877
    • S
      HID: hid-sony: amend Sixaxis descriptor to enable accelerometers · 61ab44be
      Simon Wood 提交于
      Modify the HID descriptor of the Sixaxis controller to allow the
      reporting of the accelerometers and gyro via a joystick axis.
      
      Rewrite section from offset 83:
      --
      0x75, 0x08,         /* Report Size (8),         */
      /* all the other data lumped together */
      0x95, 0x27,         /* Report Count (39),       */
      0x09, 0x01,         /* Usage (Pointer),         */
      0x81, 0x02,         /* Input (Variable),        */
      0x75, 0x08,         /* Report Size (8),         */
      0x95, 0x30,         /* Report Count (48),       */
      0x09, 0x01,         /* Usage (Pointer),         */
      /* Note Output */
      0x91, 0x02,         /* Output (Variable),       */
      0x75, 0x08,         /* Report Size (8),         */
      0x95, 0x30,         /* Report Count (48),       */
      0x09, 0x01,         /* Usage (Pointer),         */
      /* Note Feature */
      0xB1, 0x02,         /* Feature (Variable),      */
      --
      with
      --
      /* last 2 not used... */
      0x95, 0x13,         /* Report Count (19),       */
      0x09, 0x01,         /* Usage (Pointer),         */
      0x81, 0x02,         /* Input (Variable),        */
      /* Padding */
      0x95, 0x0C,         /* Report Count (12),       */
      0x81, 0x01,         /* Input (Constant),        */
      0x75, 0x10,         /* Report Size (16),        */
      0x95, 0x04,         /* Report Count (4),        */
      0x26, 0xFF, 0x03,   /* Logical Maximum (1023),  */
      0x46, 0xFF, 0x03,   /* Physical Maximum (1023), */
      0x09, 0x01,         /* Usage (Pointer),         */
      0x81, 0x02,         /* Input (Variable),        */
      --
      Signed-off-by: NSimon Wood <simon@mungewell.org>
      Signed-off-by: NAntonio Ospite <ospite@studenti.unina.it>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      61ab44be
  3. 08 6月, 2011 1 次提交
    • S
      HID: Add driver to fix Speedlink VAD Cezanne support · 74bc6953
      Stefan Kriwanek 提交于
      Speedlink VAD Cezanne have a hardware bug that makes the cursor "jump" from one
      place to another every now and then. The issue are relative motion events
      erroneously reported by the device, each having a distance value of +256. This
      256 can in fact never occur due to real motion, therefore those events can
      safely be ignored.  The driver also drops useless EV_REL events with a value of
      0, that the device sends every time it sends an "real" EV_REL or EV_KEY event.
      Signed-off-by: NStefan Kriwanek <mail@stefankriwanek.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      74bc6953
  4. 07 6月, 2011 2 次提交
    • M
      HID: Fix Logitech Driving Force Pro wheel · dc0a4f0c
      Michael Bauer 提交于
      - Add the quirk "NOGET" to make the wheel work at all in native mode.
      - Replace the somehow broken report descriptor with a custom one to have
        separate throttle and brake axes.
      
      As there are significant differences in the descriptor (original descriptor
      "hides" the separate axes in a  24 bit FF00 usagepage, new descripter replaces
      that with two individual 8 bit desktop.y and desktop.rz usages) I provided a
      complete replacement descriptor instead trying to patch the original one.
      Patching the descriptor seems not feasible as the new one is much larger.
      
      Note: To actually test this you have to use the tool "ltwheelconf" to put the
      DFP into it's native mode - See below for more info.
      
      Background:
      Most Logitech wheels are initially reporting themselves with a "fallback"
      deviceID (USB_DEVICE_ID_LOGITECH_WHEEL - 0xc294), in order to make sure they
      are working even without having the proper driver installed.
      
      If the Logitech driver is installed it sends a special command to the wheel
      which sets the wheel to "native mode", enabling enhance features like:
      - Clutch pedal
      - extended wheel rotation range (up to 900 degrees)
      - H-gate shifter
      - separate axis for throttle / brake
      - all buttons
      
      When the wheel is set to native mode it basically disconnects and reconnects
      with a different deviceID (USB_DEVICE_ID_LOGITECH_DFP_WHEEL - 0xc298 in this
      case).
      
      I am working on a userspace tool [1] which does the switching from fallback to
      native mode. During development I found out that the Driving Force Pro wheel
      is not supported in native mode - quierk NOGET is missing and the throttle and
      brake axes are reported in a combined way only.
      Signed-off-by: NMichael Bauer <michael@m-bauer.org>
      Signed-off-by: NSimon Wood <simon@mungewell.org>
      
      [1] https://github.com/TripleSpeeder/LTWheelConfSigned-off-by: NJiri Kosina <jkosina@suse.cz>
      dc0a4f0c
    • T
      HID: yurex: recognize GeneralKeys wireless presenter as generic HID · 6dc1418e
      Tomoki Sekiyama 提交于
      Unfortunately, the device seems to have the same Vendor ID and Product ID
      as YUREX leg-shakes sensors, and the commit 6bc235a2 ("USB: add driver
      for Meywa-Denki & Kayac YUREX") added the ID to hid_ignore_list.
      
      I believe that we can distinguish YUREX and the Wireless Presenter by
      device type.  The patch below makes the driver ignore only YUREX
      (bInterfaceProtocol==0), and recognize Wireless Presenter
      (bInterfaceProtocol is keyboard or mouse) as generic HID.  (I don't have
      the Wireless Presenter, so not yet ested.)
      
      ** YUREX lsusb information:
      Bus 002 Device 007: ID 0c45:1010 Microdia
      Device Descriptor:
         bLength                18
         bDescriptorType         1
         bcdUSB               1.10
         bDeviceClass            0 (Defined at Interface level)
         bDeviceSubClass         0
         bDeviceProtocol         0
         bMaxPacketSize0         8
         idVendor           0x0c45 Microdia
         idProduct          0x1010
         bcdDevice            0.03
         iManufacturer           1 JESS
         iProduct                2 YUREX
         iSerial                 3 10000269
         bNumConfigurations      1
         Configuration Descriptor:
           bLength                 9
           bDescriptorType         2
           wTotalLength           34
           bNumInterfaces          1
           bConfigurationValue     1
           iConfiguration          0
           bmAttributes         0xa0
             (Bus Powered)
             Remote Wakeup
           MaxPower              100mA
           Interface Descriptor:
             bLength                 9
             bDescriptorType         4
             bInterfaceNumber        0
             bAlternateSetting       0
             bNumEndpoints           1
             bInterfaceClass         3 Human Interface Device
             bInterfaceSubClass      1 Boot Interface Subclass
             bInterfaceProtocol      0 None
             iInterface              0
               HID Device Descriptor:
                 bLength                 9
                 bDescriptorType        33
                 bcdHID               1.10
                 bCountryCode            0 Not supported
                 bNumDescriptors         1
                 bDescriptorType        34 Report
                 wDescriptorLength      31
                Report Descriptors:
                  ** UNAVAILABLE **
             Endpoint Descriptor:
               bLength                 7
               bDescriptorType         5
               bEndpointAddress     0x81  EP 1 IN
               bmAttributes            3
                 Transfer Type            Interrupt
                 Synch Type               None
                 Usage Type               Data
               wMaxPacketSize     0x0008  1x 8 bytes
               bInterval              10
      Device Status:     0x0002
         (Bus Powered)
         Remote Wakeup Enabled
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26922Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@gmail.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
      Reported-by: NThomas B?chler <thomas@archlinux.org>
      Tested-by: NThomas B?chler <thomas@archlinux.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      6dc1418e
  5. 24 5月, 2011 3 次提交
  6. 23 5月, 2011 23 次提交
  7. 22 5月, 2011 8 次提交
    • J
      PCI: Don't use dmi_name_in_vendors in quirk · 9251bac9
      Jean Delvare 提交于
      Don't use the costly dmi_name_in_vendors() when we know the string we
      are looking for can only be in the DMI board name field. This is more
      robust and, more importantly, much faster.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9251bac9
    • C
      PCI: remove unused AER functions · cbfddd20
      Chen Gong 提交于
      In the commit 28eb5f27, aer_osc_setup is removed but corresponding
      definiton information in the aerdrv.h is missed.
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NChen Gong <gong.chen@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      cbfddd20
    • Y
      PCI/sysfs: move bus cpuaffinity to class dev_attrs · dc2c2c9d
      Yinghai Lu 提交于
      Requested by Greg KH to fix a race condition in the creating of PCI bus
      cpuaffinity files.
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      dc2c2c9d
    • Y
      PCI: add rescan to /sys/.../pci_bus/.../ · b9d320fc
      Yinghai Lu 提交于
      After remove the device from /sys, we have to rescan all or
      find out the bridge and access /sys../device/rescan there.
      
      this patch add /sys/.../pci_bus/.../rescan. So user can rescan more easy.
      that is more clean and easy to understand.
      
      like after remove 0000:c4:00.0, you can rescan 0000:c4 directly.
      
      -v2: According to Jesse, use function instead of exposing attr, so could hide
      	#ifdef in header file.
           also add code to remove rescan file in remove path.
      -v3: GregKH pointed out that we should use dev_attrs to avoid racing.
           So add pcibus_attrs and make it to be member of pcibus_attrs.
      -v4: Change name to pcibus_dev_attrs according to GregKH
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b9d320fc
    • Y
      PCI: update bridge resources to get more big ranges when allocating space (again) · da7822e5
      Yinghai Lu 提交于
      With Ram's fixes, this should be safe to do again.  So let's give it
      another try.
      
      BIOS separates IO ranges between several IOHs, and on some slots, BIOS
      assigns resources to a bridge, but stops assigning resources to the
      device under that bridge, because the device needs a big resource.
      
      So:
      1. allocate resources and record the failed device resources
      2. clear the BIOS assigned resources of the parent bridge of failing device
      3. go back and call pci assign unassigned
      4. if it still fails, go up the tree, clear more bridges. and try again
      
      Now Ram's allocate requested resource already got into mainline. could
      put this one again.
      Reviewed-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      da7822e5
    • A
      PCI: Add interfaces to store and load the device saved state · ffbdd3f7
      Alex Williamson 提交于
      For KVM device assignment, we'd like to save off the state of a device
      prior to passing it to the guest and restore it later.  We also want
      to allow pci_reset_funciton() to be called while the device is owned
      by the guest.  This however overwrites and invalidates the struct pci_dev
      buffers, so we can't just manually call save and restore.  Add generic
      interfaces for the saved state to be stored and reloaded back into
      struct pci_dev at a later time.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ffbdd3f7
    • A
      PCI: Track the size of each saved capability data area · 24a4742f
      Alex Williamson 提交于
      This will allow us to store and load it later.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      24a4742f
    • Y
      PCI/e1000e: Add and use pci_disable_link_state_locked() · 9f728f53
      Yinghai Lu 提交于
      Need to use it in _e1000e_disable_aspm.  This routine is used for error
      recovery, where the pci_bus_sem is already held, and we don't want
      pci_disable_link_state to try to take it again.  So add a locked variant
      for use in cases like this.
      
      Found lock up:
      
      [ 2374.654557] kworker/32:1    D ffff881027f6b0f0     0  6075      2 0x00000000
      [ 2374.654816]  ffff88503f099a68 0000000000000046 ffff88503f098000 0000000000004000
      [ 2374.654837]  00000000001d1ec0 ffff88503f099fd8 00000000001d1ec0 ffff88503f099fd8
      [ 2374.654860]  0000000000004000 00000000001d1ec0 ffff88503dcc8000 ffff88503f090000
      [ 2374.654880] Call Trace:
      [ 2374.654898]  [<ffffffff810b1302>] ? __lock_acquired+0x3a/0x224
      [ 2374.654914]  [<ffffffff81c2b59c>] ? _raw_spin_unlock_irq+0x30/0x36
      [ 2374.654925]  [<ffffffff810b069d>] ? trace_hardirqs_on_caller+0x1f/0x178
      [ 2374.654936]  [<ffffffff81c2ab24>] rwsem_down_failed_common+0xd3/0x103
      [ 2374.654945]  [<ffffffff810b158f>] ? __lock_contended+0x3a/0x2a2
      [ 2374.654955]  [<ffffffff81c2ab7b>] rwsem_down_read_failed+0x12/0x14
      [ 2374.654967]  [<ffffffff813371e4>] call_rwsem_down_read_failed+0x14/0x30
      [ 2374.654981]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.654990]  [<ffffffff81c2a0e6>] ? down_read+0x7e/0x91
      [ 2374.654999]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.655008]  [<ffffffff8135df20>] pci_disable_link_state+0x5f/0xf5
      [ 2374.655024]  [<ffffffff81661796>] e1000e_disable_aspm+0x55/0x5a
      [ 2374.655037]  [<ffffffff816677eb>] e1000_io_slot_reset+0x59/0xea
      [ 2374.655048]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655057]  [<ffffffff8135fe3b>] report_slot_reset+0x2e/0x5d
      [ 2374.655072]  [<ffffffff8135369e>] pci_walk_bus+0x8a/0xb7
      [ 2374.655081]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655091]  [<ffffffff813603be>] broadcast_error_message+0xa4/0xb2
      [ 2374.655101]  [<ffffffff81352c71>] ? pci_bus_read_config_dword+0x72/0x80
      [ 2374.655110]  [<ffffffff813606df>] do_recovery+0x9e/0xf9
      [ 2374.655120]  [<ffffffff81360786>] handle_error_source+0x4c/0x51
      [ 2374.655129]  [<ffffffff81360974>] aer_isr_one_error+0x1e9/0x21a
      [ 2374.655138]  [<ffffffff81360a6c>] aer_isr+0xc7/0xcc
      [ 2374.655147]  [<ffffffff813609a5>] ? aer_isr_one_error+0x21a/0x21a
      [ 2374.655159]  [<ffffffff81096d9f>] process_one_work+0x237/0x3ec
      [ 2374.655168]  [<ffffffff81096d10>] ? process_one_work+0x1a8/0x3ec
      [ 2374.655178]  [<ffffffff8109728d>] worker_thread+0x17c/0x240
      [ 2374.655186]  [<ffffffff810b0803>] ? trace_hardirqs_on+0xd/0xf
      [ 2374.655196]  [<ffffffff81097111>] ? manage_workers+0xab/0xab
      [ 2374.655209]  [<ffffffff8109c8ed>] kthread+0xa0/0xa8
      [ 2374.655223]  [<ffffffff81c332d4>] kernel_thread_helper+0x4/0x10
      [ 2374.655232]  [<ffffffff81c2b880>] ? retint_restore_args+0xe/0xe
      [ 2374.655243]  [<ffffffff8109c84d>] ? __init_kthread_worker+0x5b/0x5b
      [ 2374.655252]  [<ffffffff81c332d0>] ? gs_change+0xb/0xb
      
      when aer happens,
      pci_walk_bus already have down_read(&pci_bus_sem)...
      then report_slot_reset
              ==> e1000_io_slot_reset
                      ==> e1000e_disable_aspm
                              ==> pci_disable_link_state...
      
      We can not use pci_disable_link_state, and it will try to hold pci_bus_sem again.
      
      Try to have __pci_disable_link_state that will not need to hold pci_bus_sem.
      
      -v2: change name to pci_disable_link_state_locked() according to Jesse.
      
      [jbarnes: make sure new function is exported for modules]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9f728f53