Skip to content
  1. Jan 11, 2018
  2. Dec 12, 2017
  3. Dec 11, 2017
  4. Dec 08, 2017
  5. Oct 12, 2017
  6. Jun 19, 2017
    • Ruslan Bilovol's avatar
      usb: gadget: add f_uac1 variant based on a new u_audio api · 0591bc23
      Ruslan Bilovol authored
      
      
      This patch adds a new function 'f_uac1'
      (f_uac1 with virtual "ALSA card") that
      uses recently created u_audio API. Comparing
      to legacy f_uac1 function implementation it
      doesn't require any real Audio codec to be
      present on the device. In f_uac1 audio
      streams are simply sinked to and sourced
      from a virtual ALSA sound card created
      using u_audio API.
      
      Legacy f_uac1 approach is to write audio
      samples directly to existing ALSA sound
      card
      
      f_uac1 approach is more generic/flexible
      one - create an ALSA sound card that
      represents USB Audio function and allows to
      be used by userspace application that
      may choose to do whatever it wants with the
      data received from the USB Host and choose
      to provide whatever it wants as audio data
      to the USB Host.
      
      f_uac1 also has capture support (gadget->host)
      thanks to easy implementation via u_audio.
      By default, capture interface has 48000kHz/2ch
      configuration, same as playback channel has.
      
      f_uac1 descriptors naming convention
      uses f_uac2 driver naming convention that
      makes it more common and meaningful.
      
      Comparing to f_uac1_legacy, the f_uac1 doesn't
      have volume/mute functionality. This is because
      the f_uac1 volume/mute feature unit was dummy
      implementation since that driver creation (2009)
      and never had any real volume control or mute
      functionality, so there is no any difference
      here.
      
      Since f_uac1 functionality, exposed
      interface to userspace (virtual ALSA card),
      input parameters are so different comparing
      to f_uac1_legacy, that there is no any
      reason to keep them in the same file/module,
      and separate function was created.
      
      g_audio can be built using one of existing
      UAC functions (f_uac1, f_uac1_legacy or f_uac2)
      
      Signed-off-by: default avatarRuslan Bilovol <ruslan.bilovol@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      0591bc23
    • Ruslan Bilovol's avatar
      usb: gadget: function: make current f_uac1 implementation legacy · d355339e
      Ruslan Bilovol authored
      
      
      Before introducing new f_uac1 function (with virtual
      ALSA card) make current implementation legacy.
      
      This includes renaming of existing files, some
      variables, config options and documentation
      
      Signed-off-by: default avatarRuslan Bilovol <ruslan.bilovol@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      d355339e
  7. Jun 02, 2017
  8. May 17, 2017
    • Markus Heiser's avatar
      doc-rst: fixed kernel-doc directives in usb/typec.rst · 5383fae7
      Markus Heiser authored
      
      
      Even if this file is not yet included in any toctree, it is parsed by
      Sphinx since it is named '.rst'. This patch fixes the following two
      ERRORs from Sphinx build:
      
      Documentation/usb/typec.rst:116: ERROR: Error in "kernel-doc" directive:
      invalid option block.
      
      .. kernel-doc:: drivers/usb/typec/typec.c
         :functions: typec_register_cable typec_unregister_cable typec_register_plug
         typec_unregister_plug
      
      Documentation/usb/typec.rst:139: ERROR: Error in "kernel-doc" directive:
      invalid option block.
      
      .. kernel-doc:: drivers/usb/typec/typec.c
         :functions: typec_set_data_role typec_set_pwr_role typec_set_vconn_role
         typec_set_pwr_opmode
      
      Signed-off-by: default avatarMarkus Heiser <markus.heiser@darmarit.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5383fae7
  9. Apr 20, 2017
  10. Apr 11, 2017
  11. Mar 23, 2017
  12. Mar 21, 2017
  13. Jan 26, 2017
  14. Jan 24, 2017
    • Peter Chen's avatar
      usb: gadget: uac2: add req_number as parameter · e92b9d44
      Peter Chen authored
      
      
      There are only two requests for uac2, it may not be enough at high
      loading system which usb interrupt handler can't be serviced on
      time, then the data will be lost since it is isoc transfer for audio.
      
      In this patch, we introduce a parameter for the number for usb request,
      and the user can override it if current number for request is not enough
      for his/her use case.
      
      Besides, update this parameter for legacy audio gadget and documentation.
      
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      e92b9d44
  15. Jun 23, 2016
  16. May 04, 2016
  17. Apr 15, 2016
  18. Apr 13, 2016
  19. Mar 05, 2016
    • Reilly Grant's avatar
      usb: devio: Add ioctl to disallow detaching kernel USB drivers. · d883f52e
      Reilly Grant authored
      
      
      The new USBDEVFS_DROP_PRIVILEGES ioctl allows a process to voluntarily
      relinquish the ability to issue other ioctls that may interfere with
      other processes and drivers that have claimed an interface on the
      device.
      
      This commit also includes a simple utility to be able to test the
      ioctl, located at Documentation/usb/usbdevfs-drop-permissions.c
      
      Example (with qemu-kvm's input device):
      
          $ lsusb
          ...
          Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
      
          $ usb-devices
          ...
          C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
          I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=02 Driver=usbhid
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          OK: privileges dropped!
          Available options:
          [0] Exit now
          [1] Reset device. Should fail if device is in use
          [2] Claim 4 interfaces. Should succeed where not in use
          [3] Narrow interface permission mask
          Which option shall I run?: 1
          ERROR: USBDEVFS_RESET failed! (1 - Operation not permitted)
          Which test shall I run next?: 2
          ERROR claiming if 0 (1 - Operation not permitted)
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
          Which test shall I run next?: 0
      
      After unbinding usbhid:
      
          $ usb-devices
          ...
          I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=02 Driver=(none)
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          ...
          Which option shall I run?: 2
          OK: claimed if 0
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
          Which test shall I run next?: 1
          OK: USBDEVFS_RESET succeeded
          Which test shall I run next?: 0
      
      After unbinding usbhid and restricting the mask:
      
          $ sudo ./usbdevfs-drop-permissions /dev/bus/usb/001/002
          ...
          Which option shall I run?: 3
          Insert new mask: 0
          OK: privileges dropped!
          Which test shall I run next?: 2
          ERROR claiming if 0 (1 - Operation not permitted)
          ERROR claiming if 1 (1 - Operation not permitted)
          ERROR claiming if 2 (1 - Operation not permitted)
          ERROR claiming if 3 (1 - Operation not permitted)
      
      Signed-off-by: default avatarReilly Grant <reillyg@chromium.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarEmilio López <emilio.lopez@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d883f52e
  20. Mar 04, 2016
  21. Dec 24, 2015
  22. Dec 16, 2015
  23. Dec 15, 2015
  24. Dec 01, 2015
    • Lu Baolu's avatar
      usb: core: lpm: fix usb3_hardware_lpm sysfs node · bf5ce5bf
      Lu Baolu authored
      
      
      Commit 655fe4ef ("usbcore: add sysfs support to xHCI usb3
      hardware LPM") introduced usb3_hardware_lpm sysfs node. This
      doesn't show the correct status of USB3 U1 and U2 LPM status.
      
      This patch fixes this by replacing usb3_hardware_lpm with two
      nodes, usb3_hardware_lpm_u1 (for U1) and usb3_hardware_lpm_u2
      (for U2), and recording the U1/U2 LPM status in right places.
      
      This patch should be back-ported to kernels as old as 4.3,
      that contains Commit 655fe4ef ("usbcore: add sysfs support
      to xHCI usb3 hardware LPM").
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf5ce5bf
  25. Sep 22, 2015
  26. Aug 18, 2015
  27. Aug 14, 2015
  28. Jul 31, 2015
  29. Jul 22, 2015
Loading