1. 11 9月, 2012 1 次提交
  2. 10 9月, 2012 15 次提交
  3. 31 8月, 2012 1 次提交
    • M
      usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED · 85b8614d
      Michal Nazarewicz 提交于
      This commit removes USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED
      Kconfig options.  Since now kernel allows many UDC drivers to be
      compiled, those options may turn to no longer be valid.  For
      instance, if someone decides to build UDC that supports super
      speed and UDC that supports high speed only, the latter will be
      "assumed" to support super speed since USB_GADGET_SUPERSPEED will
      be selected by the former.
      
      The test of whether CONFIG_USB_GADGET_*SPEED was defined was just
      an optimisation which removed otherwise dead code (ie. if UDC is
      not dual speed, there is no need to handle cases that can happen
      if speed is high).  This commit removes those checks.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      85b8614d
  4. 21 8月, 2012 1 次提交
  5. 17 8月, 2012 1 次提交
  6. 11 8月, 2012 2 次提交
  7. 19 7月, 2012 1 次提交
  8. 10 7月, 2012 4 次提交
  9. 07 7月, 2012 1 次提交
  10. 27 6月, 2012 1 次提交
  11. 26 6月, 2012 1 次提交
  12. 25 6月, 2012 4 次提交
  13. 14 6月, 2012 3 次提交
  14. 13 6月, 2012 1 次提交
  15. 04 6月, 2012 1 次提交
  16. 19 5月, 2012 2 次提交
    • S
      USB: Add macros for interrupt endpoint types. · 6538eafc
      Sarah Sharp 提交于
      The USB 3.0 spec defines a new way of differentiating interrupt
      endpoints.  The idea is that some interrupt endpoints are used for
      notifications, i.e. they continually NAK the transfer until something
      changes on the device.  Other interrupt endpoints are used as a way to
      periodically transfer data.
      
      The USB 3.0 endpoint descriptor uses bits 5:4 of bmAttributes for
      interrupt endpoints, to define the endpoint as either a Notification
      endpoint, or a Periodic endpoint.  Introduce macros to dig out that
      information.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      6538eafc
    • S
      USB: Add support to enable/disable USB3 link states. · 1ea7e0e8
      Sarah Sharp 提交于
      There are various functions within the USB core that will need to
      disable USB 3.0 link power states.  For example, when a USB device
      driver is being bound to an interface, we need to disable USB 3.0 LPM
      until we know if the driver will allow hub-initiated LPM transitions.
      Another example is when the USB core is switching alternate interface
      settings.  The USB 3.0 timeout values are dependent on what endpoints
      are enabled, so we want to ensure that LPM is disabled until the new alt
      setting is fully installed.
      
      Multiple functions need to disable LPM, and those functions can even be
      nested.  For example, usb_bind_interface() could disable LPM, and then
      call into the driver probe function, which may attempt to switch to a
      different alt setting.  Therefore, we need to keep a count of the number
      of functions that require LPM to be disabled at any point in time.
      
      Introduce two new USB core API calls, usb_disable_lpm() and
      usb_enable_lpm().  These functions increment and decrement a new
      variable in the usb_device, lpm_disable_count.  If usb_disable_lpm()
      fails, it will call usb_enable_lpm() in order to balance the
      lpm_disable_count.
      
      These two new functions must be called with the bandwidth_mutex locked.
      If the bandwidth_mutex is not already held by the caller, it should
      instead call usb_unlocked_disable_lpm() and usb_enable_lpm(), which take
      the bandwidth_mutex before calling usb_disable_lpm() and
      usb_enable_lpm(), respectively.
      
      Introduce a new variable (timeout) in the usb3_lpm_params structure to
      keep track of the currently enabled U1/U2 timeout values.  When
      usb_disable_lpm() is called, and the USB device has the U1 or U2
      timeouts set to a non-zero value (meaning either device-initiated or
      hub-initiated LPM is enabled), attempt to disable LPM, regardless of the
      state of the lpm_disable_count.  We want to ensure that all callers can
      be guaranteed that LPM is disabled if usb_disable_lpm() returns zero.
      
      Otherwise the following scenario could occur:
      
      1. Driver A is being bound to interface 1.  usb_probe_interface()
      disables LPM.  Driver A doesn't care if hub-initiated LPM is enabled, so
      even though usb_disable_lpm() fails, the probe of the driver continues,
      and the bandwidth mutex is dropped.
      
      2. Meanwhile, Driver B is being bound to interface 2.
      usb_probe_interface() grabs the bandwidth mutex and calls
      usb_disable_lpm().  That call should attempt to disable LPM, even
      though the lpm_disable_count is set to 1 by Driver A.
      
      For usb_enable_lpm(), we attempt to enable LPM only when the
      lpm_disable_count is zero.  If some step in enabling LPM fails, it will
      only have a minimal impact on power consumption, and all USB device
      drivers should still work properly.  Therefore don't bother to return
      any error codes.
      
      Don't enable device-initiated LPM if the device is unconfigured.  The
      USB device will only accept the U1/U2_ENABLE control transfers in the
      configured state.  Do enable hub-initiated LPM in that case, since
      devices are allowed to accept the LGO_Ux link commands in any state.
      
      Don't enable or disable LPM if the device is marked as not being LPM
      capable.  This can happen if:
       - the USB device doesn't have a SS BOS descriptor,
       - the device's parent hub has a zeroed bHeaderDecodeLatency value, or
       - the xHCI host doesn't support LPM.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      1ea7e0e8