aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/usb (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-05Merge tag 'usb-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-nextGreg Kroah-Hartman1-152/+152
Felipe writes: USB for v4.20 With 63 non-merge commits, this is not a large merge window for USB peripheral. The largest changes go to the UVC gadget driver which a few folks have been improving. Apart from UVC changes, we have a few more devices being added to Renesas USB3 and DWC3 controller drivers and a couple minor bug fixes on other drivers. * tag 'usb-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (63 commits) USB: net2280: Remove ->disconnect() callback from net2280_pullup() usb: dwc2: disable power_down on rockchip devices usb: gadget: udc: renesas_usb3: add support for r8a77990 dt-bindings: usb: renesas_usb3: add bindings for r8a77990 usb: gadget: udc: renesas_usb3: Add r8a774a1 support usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround" usb: dwc2: gadget: Add handler for WkupAlert interrupt usb: dwc2: gadget: enable WKUP_ALERT interrupt usb: dwc2: gadget: Program GREFCLK register usb: dwc2: gadget: Add parameters for GREFCLK register usb: dwc2: Add definitions for new registers usb: dwc2: Update target (u)frame calculation usb: dwc2: Add dwc2_gadget_dec_frame_num_by_one() function usb: dwc2: Add core parameter for service interval support usb: dwc2: Update registers definitions to support service interval usb: renesas_usbhs: add support for R-Car E3 dt-bindings: usb: renesas_usbhs: add bindings for r8a77990 usb: renesas_usbhs: rcar3: Use OTG mode for R-Car D3 Revert "usb: renesas_usbhs: set the mode by using extcon state for non-otg channel" usb: gadget: f_uac2: disable IN/OUT ep if unused ...
2018-09-25usb: video: Fix endianness mismatches in descriptor structuresLaurent Pinchart1-152/+152
All UVC descriptors use little-endian format, update the data structures accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2018-09-20usb: usbtmc: Add ioctl USBTMC_IOCTL_API_VERSIONGuido Kiener1-0/+1
Add ioctl USBTMC_IOCTL_API_VERSION to get current API version of usbtmc driver. This is to allow an instrument library to determine whether the driver API is compatible with the implementation. The API may change in future versions. Therefore the macro USBTMC_API_VERSION should be incremented when changing tmc.h with new flags, ioctls or when changing a significant behavior of the driver. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl USBTMC_IOCTL_AUTO_ABORTGuido Kiener1-0/+1
Add ioctl USBTMC_IOCTL_AUTO_ABORT to configure auto_abort for each specific file handle. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: add ioctl USBTMC_IOCTL_MSG_IN_ATTRGuido Kiener1-0/+2
add ioctl USBTMC_IOCTL_MSG_IN_ATTR that returns the specific bmTransferAttributes field of the last DEV_DEP_MSG_IN Bulk-IN header. This header is received by the read() function. The meaning of the (u8) bitmap bmTransferAttributes is: Bit 0 = EOM flag is set when the last transfer of a USBTMC message is received. Bit 1 = is set when the last byte is a termchar (e.g. '\n'). Note that this bit is always zero when the device does not support the termchar feature or when termchar detection is not enabled (see ioctl USBTMC_IOCTL_CONFIG_TERMCHAR). Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQGuido Kiener1-0/+1
Wait until an SRQ (service request) is received on the interrupt pipe or until the given period of time is expired. In contrast to the poll() function this ioctl does not return when other (a)synchronous I/O operations fail with EPOLLERR. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl USBTMC_IOCTL_CLEANUP_IOGuido Kiener1-0/+1
The ioctl USBTMC_IOCTL_CLEANUP_IO kills all submitted urbs to OUT and IN bulk, and clears all received data from IN bulk. Internal transfer counters and error states are reset. An application should use this ioctl after an asnychronous transfer was canceled and/or error handling has finished. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl USBTMC_IOCTL_CANCEL_IOGuido Kiener1-0/+3
ioctl USBTMC_IOCTL_CANCEL_IO stops and kills all flying urbs of last USBTMC_IOCTL_READ and USBTMC_IOCTL_WRITE function calls. A subsequent call to USBTMC_IOCTL_READ or USBTMC_IOCTL_WRITE_RESULT returns -ECANCELED with information about current transferred data. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl for vendor specific readGuido Kiener1-0/+2
The USBTMC_IOCTL_READ call provides for generic synchronous and asynchronous reads on bulk IN to implement vendor specific library routines. Depending on transfer_size the function submits one or more urbs (up to 16) each with a size of up to 4kB. The flag USBTMC_FLAG_IGNORE_TRAILER can be used when the transmission size is already known. Then the function does not truncate the transfer_size to a multiple of 4 kB, but does reserve extra space to receive the final short or zero length packet. Note that the instrument is allowed to send up to wMaxPacketSize - 1 bytes at the end of a message to avoid sending a zero length packet. With flag USBTMC_FLAG_ASYNC the ioctl is non blocking. When no received data is available, the read function submits as many urbs as needed to receive transfer_size bytes. However the number of flying urbs (=4kB) is limited to 16 even with subsequent calls of this ioctl. Returns -EAGAIN when non blocking and no data is received. Signals EPOLLIN | EPOLLRDNORM when asynchronous urbs are ready to be read. In non blocking mode the usbtmc_message.message pointer may be NULL and the ioctl just submits urbs to initiate receiving data. However if data is already available due to a previous non blocking call the ioctl will return -EINVAL when the message pointer is NULL. This ioctl does not support compatibility for 32 bit applications running on 64 bit systems. However all other convenient ioctls of the USBTMC driver can still be used in 32 bit applications as well. Note that 32 bit applications running on 32 bit target systems are not affected by this limitation. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl USBTMC_IOCTL_WRITE_RESULTGuido Kiener1-0/+1
ioctl USBTMC_IOCTL_WRITE_RESULT copies current out_transfer_size to given __u32 pointer and returns current out_status of the last (asnynchronous) USBTMC_IOCTL_WRITE call. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl for vendor specific writeGuido Kiener1-0/+14
The new ioctl USBTMC_IOCTL_WRITE sends a generic message to bulk OUT. This ioctl is used for vendor specific or asynchronous I/O as well. The message is split into chunks of 4k (page size). Message size is aligned to 32 bit boundaries. With flag USBTMC_FLAG_ASYNC the ioctl is non blocking. With flag USBTMC_FLAG_APPEND additional urbs are queued and out_status/out_transfer_size is not reset. EPOLLOUT | EPOLLWRNORM is signaled when all submitted urbs are completed. Flush flying urbs when file handle is closed or device is suspended or reset. This ioctl does not support compatibility for 32 bit applications running on 64 bit systems. However all other convenient ioctls of the USBTMC driver can still be used in 32 bit applications as well. Note that 32 bit applications running on 32 bit target systems are not affected by this limitation. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20usb: usbtmc: Add ioctl for generic requests on controlGuido Kiener1-0/+15
Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. The maximum length of control request is set to 4k. This ioctl does not support compatibility for 32 bit applications running on 64 bit systems. However all other convenient ioctls of the USBTMC driver can still be used in 32 bit applications as well. Note that 32 bit applications running on 32 bit target systems are not affected by this limitation. Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-18Merge tag 'usb-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds2-0/+52
Pull USB/PHY updates from Greg KH: "Here is the big USB and phy driver patch set for 4.19-rc1. Nothing huge but there was a lot of work that happened this development cycle: - lots of type-c work, with drivers graduating out of staging, and displayport support being added. - new PHY drivers - the normal collection of gadget driver updates and fixes - code churn to work on the urb handling path, using irqsave() everywhere in anticipation of making this codepath a lot simpler in the future. - usbserial driver fixes and reworks - other misc changes All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (159 commits) USB: serial: pl2303: add a new device id for ATEN usb: renesas_usbhs: Kconfig: convert to SPDX identifiers usb: dwc3: gadget: Check MaxPacketSize from descriptor usb: dwc2: Turn on uframe_sched on "stm32f4x9_fsotg" platforms usb: dwc2: Turn on uframe_sched on "amlogic" platforms usb: dwc2: Turn on uframe_sched on "his" platforms usb: dwc2: Turn on uframe_sched on "bcm" platforms usb: dwc2: gadget: ISOC's starting flow improvement usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic. usb: dwc3: core: Enable AutoRetry feature in the controller usb: dwc3: Set default mode for dwc_usb31 usb: gadget: udc: renesas_usb3: Add register of usb role switch usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep usb: dwc2: Modify dwc2_readl/writel functions prototype usb: dwc3: pci: Intel Merrifield can be host usb: dwc3: pci: Supply device properties via driver data arm64: dts: dwc3: description of incr burst type usb: dwc3: Enable undefined length INCR burst type usb: dwc3: add global soc bus configuration reg0 usb: dwc3: Describe 'wakeup_work' field of struct dwc3_pci ...
2018-07-30Merge tag 'usb-for-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-nextGreg Kroah-Hartman1-0/+39
Felipe writes: usb: changes for v4.19 Not a big pull request with only 37 non-merge commits, most of which are touching dwc2 (74% of the changes). The most important changes are dwc2's support for uframe scheduling and its endian-agnostic readl/writel wrappers. From dwc3 side we have a special new glue layer for Synopsys HAPS which will help Synopsys running FPGA validation using our upstream driver. We also have the beginnings of dual-role support for Intel Merrifield platform. Apart from these, just a series of non-critical changes.
2018-07-26usb: gadget: uvc: Move userspace API definition to public headerLaurent Pinchart1-0/+39
The UVC gadget userspace API (V4L2 events and custom ioctls) is defined in a header internal to the kernel. Move it to a new public header to make it accessible to userspace. The UVC_INTF_CONTROL and UVC_INTF_STREAMING macros are not used, so remove them in the process. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2018-07-21usb: usbtmc: Add ioctl for termination characterGuido Kiener1-0/+6
add USBTMC_IOCTL_CONFIG_TERMCHAR to control TermChar handling for next read(). Controls field 'TermChar' and Bit 1 of field 'bmTransferAttributes' of REQUEST_DEV_DEP_MSG_IN BULK-OUT header. Allows enabling/disabling of terminating a read on reception of term_char individually for each read request. Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-21usb: usbtmc: Add ioctl for EOM bitGuido Kiener1-0/+2
add USBTMC_IOCTL_EOM_ENABLE to specify EOM bit for next write() call. Sets Bit 0 of field 'bmTransferAttributes' of DEV_DEP_MSG_OUT Bulk-OUT Header. Allows fine grained control over end of message handling on a per file descriptor basis. Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-21usb: usbtmc: Add ioctl for triggerGuido Kiener1-0/+1
add USBTMC488_IOCTL_TRIGGER to send TRIGGER Bulk-OUT header according to Subclass USB488 Specification The usbtmc trigger command is equivalent to the IEEE 488 GET (Group Execute Trigger) action. While the "*TRG" command can be sent as data to perform the same operation, in some situations an instrument will be busy and unable to process the data immediately in which case the USBTMC488_IOCTL_TRIGGER can be used to trigger the instrument with lower latency. Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-21usb: usbtmc: Add ioctls to set/get usb timeoutGuido Kiener1-0/+4
Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to get/set I/O timeout for specific file handle. Different operations on an instrument can take different lengths of time thus it is important to be able to set the timeout slightly longer than the expected duration of each operation to optimise the responsiveness of the application. As the instrument may be shared by multiple applications the timeout should be settable on a per file descriptor basis. Tested-by: Dave Penkler <dpenkler@gmail.com> Reviewed-by: Steve Bayless <steve_bayless@keysight.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-16ALSA: usb-audio: Add support for Processing Units in UAC3Jorge Sanjuan1-9/+40
This patch adds support for the Processig Units defined in the UAC3 spec. The main difference with the previous specs is the lack of on/off switches in the controls for these units and the addiction of the new Multi Function Processing Unit. The current version of the UAC3 spec doesn't define any useful controls for the new Multi Function Processing Unit so no control will get created once this unit is parsed. Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-15Merge tag 'sound-fix-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-0/+8
Pull sound fixes from Takashi Iwai: "Here is a collection of small fixes on top of the previous update. All small and obvious fixes. Mostly for usual suspects, USB-audio and HD-audio, but a few trivial error handling fixes for misc drivers as well" * tag 'sound-fix-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Always create the interrupt pipe for the mixer ALSA: usb-audio: Add insertion control for UAC3 BADD ALSA: usb-audio: Change in connectors control creation interface ALSA: usb-audio: Add bi-directional terminal types ALSA: lx6464es: add error handling for pci_ioremap_bar ALSA: sonicvibes: add error handling for snd_ctl_add ALSA: usb-audio: Remove explicitly listed Mytek devices ALSA: usb-audio: Generic DSD detection for XMOS-based implementations ALSA: usb-audio: Add native DSD support for Mytek DACs ALSA: hda/realtek - Add shutup hint ALSA: usb-audio: Disable the quirk for Nura headset ALSA: hda: add dock and led support for HP ProBook 640 G4 ALSA: hda: add dock and led support for HP EliteBook 830 G5 ALSA: emu10k1: add error handling for snd_ctl_add ALSA: fm801: add error handling for snd_ctl_add
2018-06-14ALSA: usb-audio: Add bi-directional terminal typesJorge Sanjuan1-0/+8
Define the bi-directional USB terminal types for audio devices. Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-06Merge tag 'sound-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-3/+16
Pull sound updates from Takashi Iwai: "We've got many code additions at this cycle as a result of quite a few new drivers. Below are highlights: Core stuff: - Fix the long-standing issue with the device registration order; the control device is now registered at last - PCM locking code cleanups for RT kernels - Fixes for possible races in ALSA timer resolution accesses - TLV offset definitions in uapi ASoC: - Many fixes for the topology stuff, including fixes for v4 ABI compatibility - Lots of cleanups / quirks for Intel platforms based on Realtek CODECs - Continued componentization works, removing legacy CODEC stuff - Conversion of OMAP DMA to the new, more standard SDMA-PCM driver - Fixes and updates to Cirrus Logic SoC drivers - New Qualcomm DSP support - New drivers for Analog SSM2305, Atmel I2S controllers, Mediatek MT6351, MT6797 and MT7622, Qualcomm DSPs, Realtek RT1305, RT1306 and RT5668 and TI TSCS454 HD-audio: - Finally better support for some CA0132 boards, allowing Windows firmware - HP Spectre x360 support along with a bulk of COEF stuff - Blacklisting power save default some known boards reported on Fedora USB-audio: - Continued improvements on UAC3 support; now BADD is supported - Fixes / improvements for Dell WD15 dock - Allow DMA coherent pages for PCM buffers for ARCH, MIPS & co Others: - New Xen sound frontend driver support - Cache implementation and other improvements for FireWire DICE - Conversions to octal permissions in allover places" * tag 'sound-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (386 commits) ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it ALSA: usb-audio: remove redundant check on err ASoC: topology: Move skl-tplg-interface.h to uapi ASoC: topology: Move v4 manifest header data structures to uapi ASoC: topology: Improve backwards compatibility with v4 topology files ALSA: pci/hda: Remove unused, broken, header file ASoC: TSCS454: Add Support ASoC: Intel: kbl: Move codec sysclk config to codec_init function ASoC: simple-card: set cpu dai clk in hw_params ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() ALSA: oxygen: use match_string() helper ASoC: dapm: use match_string() helper ASoC: max98095: use match_string() helper ASoC: max98088: use match_string() helper ASoC: Intel: bytcr_rt5651: Set card long_name based on quirks ASoC: mt6797-mt6351: add hostless phone call path ASoC: mt6797: add Hostless DAI ASoC: mt6797: add PCM interface ASoC: mediatek: export mtk-afe symbols as needed ASoC: codecs: PCM1789: include gpio/consumer.h ...
2018-05-15ALSA: usb-audio: UAC3. Add support for mixer unit.Jorge Sanjuan1-3/+16
This adds support for the MIXER UNIT in UAC3. All the information is obtained from the (HIGH CAPABILITY) Cluster's header. We don't read the rest of the logical cluster to obtain the channel config as that wont make any difference in the current mixer behaviour. The name of the mixer unit is not yet requested as there is not support for the UAC3 Class Specific String requests. Tested in an UAC3 device working as a HEADSET with a basic mixer unit (same as the one in the BADD spec) with no controls. Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-22USB: Add support to store lane count used by USB 3.2Mathias Nyman1-0/+5
USB 3.2 specification adds Dual-lane support, doubling the maximum SuperSpeedPlus data rate from 10Gbps to 20Gbps. Dual-lane takes into use a second set of rx and tx wires/pins in the Type-C cable and connector. Add "rx_lanes" and "tx_lanes" variables to struct usb_device to store the numer of lanes in use. Number of lanes can be read using the extended port status hub request that was introduced in USB 3.1. Extended port status rx and tx lane count are zero based, maximum lanes supported by non inter-chip (SSIC) USB 3.2 is 2 (dual lane) with rx and tx lane count symmetric. SSIC devices support asymmetric lanes up to 4 lanes per direction. If extended port status is not available then default to one lane. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-21ALSA: usb: initial USB Audio Device Class 3.0 supportRuslan Bilovol1-0/+1
Recently released USB Audio Class 3.0 specification introduces many significant changes comparing to previous versions, like - new Power Domains, support for LPM/L1 - new Cluster descriptor - changed layout of all class-specific descriptors - new High Capability descriptors - New class-specific String descriptors - new and removed units - additional sources for interrupts - removed Type II Audio Data Formats - ... and many other things (check spec) It also provides backward compatibility through multiple configurations, as well as requires mandatory support for BADD (Basic Audio Device Definition) on each ADC3.0 compliant device This patch adds initial support of UAC3 specification that is enough for Generic I/O Profile (BAOF, BAIF) device support from BADD document. Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-19ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unitKirill Marinushkin1-2/+2
Currently, the offsets in the UAC2 processing unit descriptor are calculated incorrectly. It causes an issue when connecting the device which provides such a feature: ~~~~ [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18) ~~~~ After this patch is applied, the UAC2 processing unit inits w/o this error. Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0") Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-09USB: clarify USB_DT_USB_SSP_CAP_SIZE(ssac) definitionMathias Nyman1-2/+2
USB_DT_USB_SSP_CAP_SIZE(ssac) gives the size of the SSP capability descriptor. The descriptor consists of 12 bytes plus a array of SSA entries. The number of SSA entries is stored in a SSAC value in the first 12 bytes, The USB3.1 specification 9.6.2.5 defines SSAC as zero based: "The number of Sublink Speed Attributes = SSAC + 1." This is not intuitive and has already caused some confusion. Make a small modifiaction to the USB_DT_USB_SSP_CAP_SIZE(ssac) definition to make it a bit clearer Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28USB: core: Add type-specific length check of BOS descriptorsMasakazu Mokuno1-0/+3
As most of BOS descriptors are longer in length than their header 'struct usb_dev_cap_header', comparing solely with it is not sufficient to avoid out-of-bounds access to BOS descriptors. This patch adds descriptor type specific length check in usb_get_bos_descriptor() to fix the issue. Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-13Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds1-0/+4
Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
2017-11-07usb: core: add Status Type definitionsFelipe Balbi1-0/+4
USB 3.1 added a PTM_STATUS type. Let's add a define for it and following patches will let usb_get_status() accept the new argument. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02License cleanup: add SPDX license identifier to uapi header files with a licenseGreg Kroah-Hartman4-0/+4
Many user space API headers have licensing information, which is either incomplete, badly formatted or just a shorthand for referring to the license under which the file is supposed to be. This makes it hard for compliance tools to determine the correct license. Update these files with an SPDX license identifier. The identifier was chosen based on the license information in the file. GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license identifier with the added 'WITH Linux-syscall-note' exception, which is the officially assigned exception identifier for the kernel syscall exception: NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". This exception makes it possible to include GPL headers into non GPL code, without confusing license compliance tools. Headers which have either explicit dual licensing or are just licensed under a non GPL license are updated with the corresponding SPDX identifier and the GPLv2 with syscall exception identifier. The format is: ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE) SPDX license identifiers are a legally binding shorthand, which can be used instead of the full boiler plate text. The update does not remove existing license information as this has to be done on a case by case basis and the copyright holders might have to be consulted. This will happen in a separate step. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. See the previous patch in this series for the methodology of how this patch was researched. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02License cleanup: add SPDX license identifier to uapi header files with no licenseGreg Kroah-Hartman7-0/+7
Many user space API headers are missing licensing information, which makes it hard for compliance tools to determine the correct license. By default are files without license information under the default license of the kernel, which is GPLV2. Marking them GPLV2 would exclude them from being included in non GPLV2 code, which is obviously not intended. The user space API headers fall under the syscall exception which is in the kernels COPYING file: NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". otherwise syscall usage would not be possible. Update the files which contain no license information with an SPDX license identifier. The chosen identifier is 'GPL-2.0 WITH Linux-syscall-note' which is the officially assigned identifier for the Linux syscall exception. SPDX license identifiers are a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. See the previous patch in this series for the methodology of how this patch was researched. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-19USB: fix out-of-bounds in usb_set_configurationGreg Kroah-Hartman1-0/+1
Andrey Konovalov reported a possible out-of-bounds problem for a USB interface association descriptor. He writes: It seems there's no proper size check of a USB_DT_INTERFACE_ASSOCIATION descriptor. It's only checked that the size is >= 2 in usb_parse_configuration(), so find_iad() might do out-of-bounds access to intf_assoc->bInterfaceCount. And he's right, we don't check for crazy descriptors of this type very well, so resolve this problem. Yet another issue found by syzkaller... Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-15include: uapi: usb: Introduce USB charger type and state definitionBaolin Wang1-0/+31
Introducing USB charger type and state definition can help to support USB charging which will be added in USB phy core. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-07-18include: usb: audio: specify exact endiannes of descriptorsRuslan Bilovol1-3/+3
USB spec says that multiple byte fields are stored in little-endian order (see chapter 8.1 of USB2.0 spec and chapter 7.1 of USB3.0 spec), thus mark such fields as LE for UAC1 and UAC2 headers Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-06-20Merge tag 'usb-for-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testingGreg Kroah-Hartman1-3/+4
Felipe writes: usb: changes for v4.13 merge window This time around we have a total of 57 non-merge commits. A list of most important changes follows: - Improvements to dwc3 tracing interface - Initial dual-role support for dwc3 - Improvements to how we handle DMA resources in dwc3 - A new f_uac1 implementation which much more flexible - Removal of AVR32 bits - Improvements to f_mass_storage driver
2017-06-02usb: gadget: function: f_fs: Let ffs_epfile_ioctl wait for enable.Jerry Zhang1-3/+4
This allows users to make an ioctl call as the first action on a connection. Ex, some functions might want to get endpoint size before making any i/os. Previously, calling ioctls before read/write would depending on the timing of endpoints being enabled. ESHUTDOWN is now a possible return value and ENODEV is not, so change docs accordingly. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Jerry Zhang <zhangjerry@google.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-05-17USB: hub: fix SS max number of portsJohan Hovold1-0/+3
Add define for the maximum number of ports on a SuperSpeed hub as per USB 3.1 spec Table 10-5, and use it when verifying the retrieved hub descriptor. This specifically avoids benign attempts to update the DeviceRemovable mask for non-existing ports (should we get that far). Fixes: dbe79bbe9dcb ("USB 3.0 Hub Changes") Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-11uapi: export all headers under uapi directoriesNicolas Dichtel1-12/+0
Regularly, when a new header is created in include/uapi/, the developer forgets to add it in the corresponding Kbuild file. This error is usually detected after the release is out. In fact, all headers under uapi directories should be exported, thus it's useless to have an exhaustive list. After this patch, the following files, which were not exported, are now exported (with make headers_install_all): asm-arc/kvm_para.h asm-arc/ucontext.h asm-blackfin/shmparam.h asm-blackfin/ucontext.h asm-c6x/shmparam.h asm-c6x/ucontext.h asm-cris/kvm_para.h asm-h8300/shmparam.h asm-h8300/ucontext.h asm-hexagon/shmparam.h asm-m32r/kvm_para.h asm-m68k/kvm_para.h asm-m68k/shmparam.h asm-metag/kvm_para.h asm-metag/shmparam.h asm-metag/ucontext.h asm-mips/hwcap.h asm-mips/reg.h asm-mips/ucontext.h asm-nios2/kvm_para.h asm-nios2/ucontext.h asm-openrisc/shmparam.h asm-parisc/kvm_para.h asm-powerpc/perf_regs.h asm-sh/kvm_para.h asm-sh/ucontext.h asm-tile/shmparam.h asm-unicore32/shmparam.h asm-unicore32/ucontext.h asm-x86/hwcap2.h asm-xtensa/kvm_para.h drm/armada_drm.h drm/etnaviv_drm.h drm/vgem_drm.h linux/aspeed-lpc-ctrl.h linux/auto_dev-ioctl.h linux/bcache.h linux/btrfs_tree.h linux/can/vxcan.h linux/cifs/cifs_mount.h linux/coresight-stm.h linux/cryptouser.h linux/fsmap.h linux/genwqe/genwqe_card.h linux/hash_info.h linux/kcm.h linux/kcov.h linux/kfd_ioctl.h linux/lightnvm.h linux/module.h linux/nbd-netlink.h linux/nilfs2_api.h linux/nilfs2_ondisk.h linux/nsfs.h linux/pr.h linux/qrtr.h linux/rpmsg.h linux/sched/types.h linux/sed-opal.h linux/smc.h linux/smc_diag.h linux/stm.h linux/switchtec_ioctl.h linux/vfio_ccw.h linux/wil6210_uapi.h rdma/bnxt_re-abi.h Note that I have removed from this list the files which are generated in every exported directories (like .install or .install.cmd). Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all subdirs with a pure makefile command. For the record, note that exported files for asm directories are a mix of files listed by: - include/uapi/asm-generic/Kbuild.asm; - arch/<arch>/include/uapi/asm/Kbuild; - arch/<arch>/include/asm/Kbuild. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Mark Salter <msalter@redhat.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-04-18usb: fix some references for /proc/bus/usbMauro Carvalho Chehab1-1/+2
Since when we got rid of usbfs, the /proc/bus/usb is now elsewhere. Fix references for it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-11usb: gadget: f_fs: Fix ExtCompat documentation in uapi headerVincent Pelletier1-1/+1
The code was fixed in commit 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on reserved1 wof OS_DESC_EXT_COMPAT") but the in-header documentation kept referencing 0 as the expected value. Reference 1 instead as per original commit message. Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-01-02usb: gadget: f_fs: Document eventfd effect on descriptor format.Vincent Pelletier1-0/+1
When FUNCTIONFS_EVENTFD flag is set, __ffs_data_got_descs reads a 32bits, little-endian value right after the fixed structure header, and passes it to eventfd_ctx_fdget. Document this. Also, rephrase a comment to be affirmative about the role of string descriptor at index 0. Ref: USB 2.0 spec paragraph "9.6.7 String", and also checked to still be current in USB 3.0 spec paragraph "9.6.9 String". Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-11-03usb: ch9: make usb_endpoint_maxp() return only packet sizeFelipe Balbi1-2/+3
Now that we have a helper to gather periodic endpoints' multiplier bits from wMaxPacketSize and every driver is using it, we can safely make sure that usb_endpoint_maxp() returns only bits 10:0 of wMaxPacketSize which is where the actual packet size lies. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-10-31usb: add helper to extract bits 12:11 of wMaxPacketSizeFelipe Balbi1-0/+19
According to USB Specification 2.0 table 9-4, wMaxPacketSize is a bitfield. Endpoint's maxpacket is laid out in bits 10:0. For high-speed, high-bandwidth isochronous endpoints, bits 12:11 contain a multiplier to tell us how many transactions we want to try per uframe. This means that if we want an isochronous endpoint to issue 3 transfers of 1024 bytes per uframe, wMaxPacketSize should contain the value: 1024 | (2 << 11) or 5120 (0x1400). In order to make Host and Peripheral controller drivers' life easier, we're adding a helper which returns bits 12:11. Note that no care is made WRT to checking endpoint type and gadget's speed. That's left for drivers to handle. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-08-25usb: gadget: f_fs: handle control requests in config 0Felix Hädicke1-0/+1
Introduces a new FunctionFS descriptor flag named FUNCTIONFS_CONFIG0_SETUP. When this flag is enabled, FunctionFS userspace drivers can process non-standard control requests in configuration 0. Signed-off-by: Felix Hädicke <felixhaedicke@web.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-08-25usb: gadget: f_fs: handle control requests not directed to interface or endpointFelix Hädicke1-0/+1
Introduces a new FunctionFS descriptor flag named FUNCTIONFS_ALL_CTRL_RECIP. When this flag is enabled, control requests, which are not explicitly directed to an interface or endpoint, can be handled. This allows FunctionFS userspace drivers to process non-standard control requests. Signed-off-by: Felix Hädicke <felixhaedicke@web.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-04-19USB: PD: additional feature selectorsOliver Neukum1-0/+16
This adds the feature selectors from Table 9-8 Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-19USB: PD: define specific requestsOliver Neukum1-0/+7
This takes the definitions of requests from chapter 9.3.1 of the USB Power Delivery spec. Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-19USB: add descriptors from USB Power Delivery specOliver Neukum1-0/+98
Adding the descriptors of chapter 9.2 of the Power Delivery spec. Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>