aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb
AgeCommit message (Collapse)AuthorFilesLines
2019-06-03USB: drop HCD_LOCAL_MEM flagLaurentiu Tudor1-1/+0
With the addition of the local memory allocator, the HCD_LOCAL_MEM flag can be dropped and the checks against it replaced with a check for the localmem_pool ptr being initialized. Signed-off-by: Laurentiu Tudor <[email protected]> Tested-by: Fredrik Noring <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2019-06-03USB: use genalloc for USB HCs with local memoryLaurentiu Tudor1-0/+5
For HCs that have local memory, replace the current DMA API usage with a genalloc generic allocator to manage the mappings for these devices. To help users, introduce a new HCD API, usb_hcd_setup_local_mem() that will setup up the genalloc backing up the device local memory. It will be used in subsequent patches. This is in preparation for dropping the existing "coherent" dma mem declaration APIs. The current implementation was relying on a short circuit in the DMA API that in the end, was acting as an allocator for these type of devices. Signed-off-by: Laurentiu Tudor <[email protected]> Tested-by: Fredrik Noring <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2019-06-03usb: typec: Registering real device entries for the muxesHeikki Krogerus1-34/+28
Registering real device entries (struct device) for the mode muxes as well as for the orientation switches. The Type-C mux code was deliberately attempting to avoid creation of separate device entries for the orientation switch and the mode switch (alternate modes) because they are not physical devices. They are functions of a single physical multiplexer/demultiplexer switch device. Unfortunately because of the dependency we still have on the underlying mux device driver, we had to put in hacks like the one in the commit 3e3b81965cbf ("usb: typec: mux: Take care of driver module reference counting") to make sure the driver does not disappear from underneath us. Even with those hacks we were still left with a potential NUll pointer dereference scenario, so just creating the device entries, and letting the core take care of the dependencies. No more hacks needed. Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-06-03Merge 5.2-rc3 into usb-nextGreg Kroah-Hartman5-53/+5
we want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner4-40/+4
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner1-13/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21usb: renesas_usbhs: Add support for RZ/A2Chris Brandt1-0/+1
The RZ/A2 is similar to the R-Car Gen3 with some small differences. Signed-off-by: Chris Brandt <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21usb: renesas_usbhs: support byte addressable CFIFOChris Brandt1-0/+1
Some SoC have a CFIFO register that is byte addressable. This means when the CFIFO access is set to 32-bit, you can write 8-bit values to addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3. Signed-off-by: Chris Brandt <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21usb: renesas_usbhs: add support for CNEN bitChris Brandt1-0/+1
For some SoC, CNEN must be set for USB Device mode operation. Signed-off-by: Chris Brandt <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21usb: renesas_usbhs: move flags to paramChris Brandt1-0/+1
Move options from 'flags' field in private structure to param structure where other options are already being kept. Signed-off-by: Chris Brandt <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-03Merge tag 'usb-for-v5.2' of ↵Greg Kroah-Hartman1-0/+5
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: USB: changes for v5.2 merge window With a total of 50 non-merge commits, this is not a large pull request. Most of the changes are, again, in dwc2 (37%) and dwc3 (32%) with the rest of it scattered among other UDCs, function drivers and device-tree bindings. No really big feature this time around apart from support to Amlogic being added to both dwc3 and dwc2 drivers. * tag 'usb-for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (50 commits) usb: dwc3: Rename DWC3_DCTL_LPM_ERRATA usb: dwc3: Fix default lpm_nyet_threshold value usb: dwc3: debug: Print GET_STATUS(device) tracepoint usb: dwc3: Do core validation early on probe usb: dwc3: gadget: Set lpm_capable usb: gadget: atmel: tie wake lock to running clock usb: gadget: atmel: support USB suspend usb: gadget: atmel_usba_udc: simplify setting of interrupt-enabled mask dwc2: gadget: Fix completed transfer size calculation in DDMA usb: dwc2: Set lpm mode parameters depend on HW configuration usb: dwc2: Fix channel disable flow usb: dwc2: Set actual frame number for completed ISOC transfer usb: gadget: do not use __constant_cpu_to_le16 usb: dwc2: gadget: Increase descriptors count for ISOC's usb: introduce usb_ep_type_string() function usb: dwc3: move synchronize_irq() out of the spinlock protected block usb: dwc3: Free resource immediately after use usb: dwc3: of-simple: Convert to bulk clk API usb: dwc2: Delayed status support usb: gadget: udc: lpc32xx: rework interrupt handling ...
2019-05-03Merge tag 'usb-serial-5.2-rc1' of ↵Greg Kroah-Hartman1-7/+1
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.2-rc1 Here are the USB-serial updates for 5.2-rc1, including: - flow-control related fixes for pl2303 - fix for an initial-termios issue - fix for a couple of unthrottle() races - fix for f81232 interrupt-handling issues - improved f81232 overrun handling - support for higher f81232 line speeds - support for f81232 break control Included are also various clean ups. All but the last four commits have been in linux-next and with no reported issues. Signed-off-by: Johan Hovold <[email protected]> * tag 'usb-serial-5.2-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (22 commits) USB: serial: f81232: implement break control USB: serial: f81232: add high baud rate support USB: serial: f81232: clear overrun flag USB: serial: f81232: fix interrupt worker not stop USB: serial: io_edgeport: fix up switch fall-through comments USB: serial: drop unused iflag macro USB: serial: drop unnecessary goto USB: serial: clean up throttle handling USB: serial: fix unthrottle races USB: serial: spcp8x5: simplify init_termios USB: serial: oti6858: simplify init_termios USB: serial: iuu_phoenix: simplify init_termios USB: serial: iuu_phoenix: drop bogus initial cflag USB: serial: cypress_m8: clean up initial-termios handling USB: serial: cypress_m8: drop unused termios USB: serial: cypress_m8: drop unused driver data flag USB: serial: ark3116: drop redundant init_termios USB: serial: fix initial-termios handling USB: serial: digi_acceleport: clean up set_termios USB: serial: digi_acceleport: clean up modem-control handling ...
2019-05-03usb: introduce usb_ep_type_string() functionChunfeng Yun1-0/+8
In some places, the code prints a human-readable USB endpoint transfer type (e.g. "bulk"). This involves a switch statement sometimes wrapped around in ({ ... }) block leading to code repetition. To make this scenario easier, here introduces usb_ep_type_string() function, which returns a human-readable name of provided endpoint type. It also changes a few places switch was used to use this new function. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2019-05-03USB: Export usb_wakeup_enabled_descendants()Douglas Anderson1-0/+5
In (e583d9d USB: global suspend and remote wakeup don't mix) we introduced wakeup_enabled_descendants() as a static function. We'd like to use this function in USB controller drivers to know if we should keep the controller on during suspend time, since doing so has a power impact. Signed-off-by: Douglas Anderson <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2019-04-30USB: serial: drop unused iflag macroJohan Hovold1-3/+0
Drop the RELEVANT_IFLAG() macro which essentially hasn't been used for over a decade except in some remnant debug printks that were recently removed. Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2019-04-30USB: serial: clean up throttle handlingJohan Hovold1-4/+1
Clean up the throttle implementation by dropping the redundant throttle_req flag which was a remnant from back when there was only a single read URB. Also convert the throttled flag to an atomic bit flag. Signed-off-by: Johan Hovold <[email protected]>
2019-04-25usb/hcd: Send a uevent signaling that the host controller had diedRaul E Rangel1-0/+1
This change will send an OFFLINE event to udev with the ERROR=DEAD environment variable set when the HC dies. By notifying user space the appropriate policies can be applied. i.e., * Collect error logs. * Notify the user that USB is no longer functional. * Perform a graceful reboot. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Raul E Rangel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-25usb: typec: Add driver for NVIDIA Alt ModesAjay Gupta1-0/+5
Latest NVIDIA GPUs support VirtualLink device. Since USBIF has not assigned a Standard ID (SID) for VirtualLink so using NVIDA VID 0x955 as SVID. Signed-off-by: Ajay Gupta <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-19usb: typec: tcpm: Notify the tcpc to start connection-detection for SRPsHans de Goede1-6/+7
Some tcpc device-drivers need to explicitly be told to watch for connection events, otherwise the tcpc will not generate any TCPM_CC_EVENTs and devices being plugged into the Type-C port will not be noticed. For dual-role ports tcpm_start_drp_toggling() is used to tell the tcpc to watch for connection events. Sofar we lack a similar callback to the tcpc for single-role ports. With some tcpc-s such as the fusb302 this means no TCPM_CC_EVENTs will be generated when the port is configured as a single-role port. This commit renames start_drp_toggling to start_toggling and since the device-properties are parsed by the tcpm-core, adds a port_type parameter to the start_toggling callback so that the tcpc_dev driver knows the port-type and can act accordingly when it starts toggling. The new start_toggling callback now always gets called if defined, instead of only being called for DRP ports. To avoid this causing undesirable functional changes all existing start_drp_toggling implementations are not only renamed to start_toggling, but also get a port_type check added and return -EOPNOTSUPP when port_type is not DRP. Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") Cc: Adam Thomson <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Tested-by: Adam Thomson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: introduce usb_ep_type_string() functionChunfeng Yun1-0/+8
In some places, the code prints a human-readable USB endpoint transfer type (e.g. "bulk"). This involves a switch statement sometimes wrapped around in ({ ... }) block leading to code repetition. To make this scenario easier, here introduces usb_ep_type_string() function, which returns a human-readable name of provided endpoint type. It also changes a few places switch was used to use this new function. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-01wusb: Remove unnecessary static function ckhdid_printfJoe Perches1-16/+0
This static inline is unnecessary and can be removed by using the vsprintf %ph extension. This reduces overall object size by more than 2K. Reported-by: Louis Taylor <[email protected]> Signed-off-by: Joe Perches <[email protected]> Reviewed-by: Louis Taylor <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-22usb: core: add option of only authorizing internal devicesDmitry Torokhov1-3/+7
On Chrome OS we want to use USBguard to potentially limit access to USB devices based on policy. We however to do not want to wait for userspace to come up before initializing fixed USB devices to not regress our boot times. This patch adds option to instruct the kernel to only authorize devices connected to the internal ports. Previously we could either authorize all or none (or, by default, we'd only authorize wired devices). The behavior is controlled via usbcore.authorized_default command line option. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-14usb: roles: Find the muxes by also matching against the device nodeHeikki Krogerus1-0/+2
When the connections are defined in firmware, struct device_connection will have the fwnode member pointing to the device node (struct fwnode_handle) of the requested device, and the endpoint will not be used at all in that case. Acked-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Jun Li <[email protected]> Tested-by: Jun Li <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-14usb: typec: Rationalize the API for the muxesHeikki Krogerus1-1/+2
Since with accessory modes there is no need for additional identification when requesting a handle to the mux, we can replace the second parameter that is passed to the typec_mux_get() function with a pointer to alternate mode description structure, and simply passing NULL with accessory modes. This change means the naming of the mux device connections can be updated. Alternate and Accessory Modes will both be handled with muxes named "mode-switch", and the orientation switches will be named "orientation-switch". Future identification of the alternate modes will be later done using device property "svid" of the mux. Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Jun Li <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-13usb: typec: tcpm: Remove unused functionsGuenter Roeck1-6/+0
tcpm_update_source_capabilities() and tcpm_update_sink_capabilities() are not used anywhere, and I don't recall why I introduced those functions in the first place. Effectively that means that we don't know if they even work, or ever did. Lets remove them. Reported-by: Kyle Tso <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Kyle Tso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-08usb: typec: displayport: Move the Configuration VDO helpers to the headerHeikki Krogerus1-0/+4
The helpers used for reading and writing the pin assignment from and to the Configuration VDO will be useful in GPU drivers, and also UCSI driver after DisplayPort alt mode support is added to it. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-17Merge tag 'usb-ci-v4.21-rc1' of ↵Greg Kroah-Hartman1-0/+3
git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: - Improve the over-current handling for imx - Add the HSIC support for imx * tag 'usb-ci-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb: usb: chipidea: imx: allow to configure oc polarity on i.MX25 usb: chipidea: imx: Warn if oc polarity isn't specified usb: chipidea: imx: support configuring for active low oc signal doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups usb: chipidea: host: override ehci->hub_control usb: chipidea: imx: add HSIC support usb: chipidea: add flag for imx hsic implementation
2018-12-12Merge tag 'usb-for-v4.21' of ↵Greg Kroah-Hartman2-0/+55
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: USB changes for v4.21 So it looks like folks are interested in dwc3 again. Almost 64% of the changes are in dwc3 this time around with some other bits in gadget functions and dwc2. There are two important parts here: a. removal of the waitqueue from dwc3's dequeue implementation, which will guarantee that gadget functions can dequeue from any context and; b. better method for starting isochronous transfers to avoid, as much as possible, missed isoc frames. Apart from these, we have the usual set of non-critical fixes and new features all over the place. * tag 'usb-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (56 commits) usb: dwc2: Fix disable all EP's on disconnect usb: dwc3: gadget: Disable CSP for stream OUT ep usb: dwc2: disable power_down on Amlogic devices Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs" USB: gadget: udc: s3c2410_udc: convert to DEFINE_SHOW_ATTRIBUTE usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler usb: dwc3: trace: add missing break statement to make compiler happy usb: dwc3: gadget: Report isoc transfer frame number usb: gadget: Introduce frame_number to usb_request usb: renesas_usbhs: Use SIMPLE_DEV_PM_OPS macro usb: renesas_usbhs: Remove dummy runtime PM callbacks usb: dwc2: host: use hrtimer for NAK retries usb: mtu3: clear SOFTCONN when clear USB3_EN if work as HS mode usb: mtu3: enable SETUPENDISR interrupt usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) usb: mtu3: enable hardware remote wakeup from L1 automatically usb: mtu3: remove QMU checksum usb/mtu3: power down device ip at setup usb: dwc2: Disable power down feature on Samsung SoCs usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() ...
2018-12-11usb: chipidea: add flag for imx hsic implementationPeter Chen1-0/+3
NXP (Freecale) imx HSIC design has some special requirements, add some flags at host code to handle them. Reviewed-by: Frieder Schrempf <[email protected]> Tested-by: Frieder Schrempf <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2018-12-05usb: gadget: Introduce frame_number to usb_requestThinh Nguyen1-0/+4
Add a field frame_number to the usb_request to report the interval number in (micro)frames in which the isochronous transfer was transmitted or received. The gadget driver can use this knowledge to synchronize with the host. Also, this option is useful for debugging purposes. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-11-26usb: gadget: f_fs: Add support for CCID descriptors.Vincent Pelletier1-0/+51
Nothing to remap, only check length. Define a minimal structure for CCID descriptor only used to check length. As this descriptor shares the same value as HID descriptors, keep track and compare current interface's class to expected HID and CCID standard values. Signed-off-by: Vincent Pelletier <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-11-26Merge 4.20-rc4 into usb-nextGreg Kroah-Hartman1-0/+3
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-11-09USB: remove the unused struct hcd_timeout definitionChristoph Hellwig1-5/+0
No users of this type anywhere in the tree. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-11-07USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hubKai-Heng Feng1-0/+3
Devices connected under Terminus Technology Inc. Hub (1a40:0101) may fail to work after the system resumes from suspend: [ 206.063325] usb 3-2.4: reset full-speed USB device number 4 using xhci_hcd [ 206.143691] usb 3-2.4: device descriptor read/64, error -32 [ 206.351671] usb 3-2.4: device descriptor read/64, error -32 Info for this hub: T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 4 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1a40 ProdID=0101 Rev=01.11 S: Product=USB 2.0 Hub C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub Some expirements indicate that the USB devices connected to the hub are innocent, it's the hub itself is to blame. The hub needs extra delay time after it resets its port. Hence wait for extra delay, if the device is connected to this quirky hub. Signed-off-by: Kai-Heng Feng <[email protected]> Cc: stable <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-11-07usb: typec: tcpm: Do not disconnect link for self powered devicesBadhri Jagan Sridharan1-0/+1
During HARD_RESET the data link is disconnected. For self powered device, the spec is advising against doing that. >From USB_PD_R3_0 7.1.5 Response to Hard Resets Device operation during and after a Hard Reset is defined as follows: Self-powered devices Should Not disconnect from USB during a Hard Reset (see Section 9.1.2). Bus powered devices will disconnect from USB during a Hard Reset due to the loss of their power source. Tackle this by letting TCPM know whether the device is self or bus powered. This overcomes unnecessary port disconnections from hard reset. Also, speeds up the enumeration time when connected to Type-A ports. Signed-off-by: Badhri Jagan Sridharan <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> --------- Version history: V3: Rebase on top of usb-next V2: Based on feedback from [email protected] - self_powered added to the struct tcpm_port which is populated from a. "connector" node of the device tree in tcpm_fw_get_caps() b. "self_powered" node of the tcpc_config in tcpm_copy_caps Based on feedbase from [email protected] - Code was refactored - SRC_HARD_RESET_VBUS_OFF sets the link state to false based on self_powered flag V1 located here: https://lkml.org/lkml/2018/9/13/94 Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-26Merge tag 'usb-4.20-rc1' of ↵Linus Torvalds1-0/+6
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big USB/PHY driver patches for 4.20-rc1 Lots of USB changes in here, primarily in these areas: - typec updates and new drivers - new PHY drivers - dwc2 driver updates and additions (this old core keeps getting added to new devices.) - usbtmc major update based on the industry group coming together and working to add new features and performance to the driver. - USB gadget additions for new features - USB gadget configfs updates - chipidea driver updates - other USB gadget updates - USB serial driver updates - renesas driver updates - xhci driver updates - other tiny USB driver updates All of these have been in linux-next for a while with no reported issues" * tag 'usb-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (229 commits) usb: phy: ab8500: silence some uninitialized variable warnings usb: xhci: tegra: Add genpd support usb: xhci: tegra: Power-off power-domains on removal usbip:vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten usbip: tools: fix atoi() on non-null terminated string USB: misc: appledisplay: fix backlight update_status return code phy: phy-pxa-usb: add a new driver usb: host: add DT bindings for faraday fotg2 usb: host: ohci-at91: fix request of irq for optional gpio usb/early: remove set but not used variable 'remain_length' usb: typec: Fix copy/paste on typec_set_vconn_role() kerneldoc usb: typec: tcpm: Report back negotiated PPS voltage and current USB: core: remove set but not used variable 'udev' usb: core: fix memory leak on port_dev_path allocation 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: serial: cypress_m8: remove set but not used variable 'iflag' ...
2018-10-24Merge branch 'work.tty-ioctl' of ↵Linus Torvalds1-0/+2
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull tty ioctl updates from Al Viro: "This is the compat_ioctl work related to tty ioctls. Quite a bit of dead code taken out, all tty-related stuff gone from fs/compat_ioctl.c. A bunch of compat bugs fixed - some still remain, but all more or less generic tty-related ioctls should be covered (remaining issues are in things like driver-private ioctls in a pcmcia serial card driver not getting properly handled in 32bit processes on 64bit host, etc)" * 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (53 commits) kill TIOCSERGSTRUCT change semantics of ldisc ->compat_ioctl() kill TIOCSER[SG]WILD synclink_gt(): fix compat_ioctl() pty: fix compat ioctls compat_ioctl - kill keyboard ioctl handling gigaset: add ->compat_ioctl() vt_compat_ioctl(): clean up, use compat_ptr() properly gigaset: don't try to printk userland buffer contents dgnc: don't bother with (empty) stub for TCXONC dgnc: leave TIOC[GS]SOFTCAR to ldisc remove fallback to drivers for TIOCGICOUNT dgnc: break-related ioctls won't reach ->ioctl() kill the rest of tty COMPAT_IOCTL() entries dgnc: TIOCM... won't reach ->ioctl() isdn_tty: TCSBRK{,P} won't reach ->ioctl() kill capinc_tty_ioctl() take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl() synclink: reduce pointless checks in ->ioctl() complete ->[sg]et_serial() switchover ...
2018-10-13usb-serial: begin switching to ->[sg]et_serial()Al Viro1-0/+2
add such methods for usb_serial_driver, provide tty_operations ->[sg]et_serial() calling those. For now the lack of methods in driver means ENOIOCTLCMD from usb-serial ->[sg]et_serial(), making tty_ioctl() fall back to calling ->ioctl(). Once all drivers are converted, we'll be returning -ENOTTY instead, completing the switchover. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Al Viro <[email protected]>
2018-10-02net: usbnet: make driver_info constBen Dooks1-1/+1
The driver_info field that is used for describing each of the usb-net drivers using the usbnet.c core all declare their information as const and the usbnet.c itself does not try and modify the struct. It is therefore a good idea to make this const in the usbnet.c structure in case anyone tries to modify it. Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2018-09-20usb: chipidea: Add dynamic pinctrl selectionLoic Poulain1-0/+6
Some hardware implementations require to configure pins differently according to the USB role (host/device), this can be an update of the pins routing or a simple GPIO value change. This patch introduces new optional "host" and "device" pinctrls. If these pinctrls are defined by the device, they are respectively selected on host/device role start. If a default pinctrl exist, it is restored on host/device role stop. Signed-off-by: Loic Poulain <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2018-08-18Merge tag 'usb-4.19-rc1' of ↵Linus Torvalds7-49/+276
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 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-31ALSA: usb-audio: Initial Power Domain supportJorge Sanjuan1-0/+4
Thee USB Audio Class 3 (UAC3) introduces Power Domains as a new feature to let a host turn individual parts of an audio function to different power states via USB requests. This lets the device get to know a bit amore about what the host is up to in order to optimize power consumption efficiently. The Power Domains are optional for UAC3 configuration but all UAC3 devices shall include at least one BADD configuration where the support for Power Domains is compulsory. This patch adds a set of features/helpers to parse these power domains and change their status. Signed-off-by: Jorge Sanjuan <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2018-07-16ALSA: usb-audio: Add support for Processing Units in UAC3Jorge Sanjuan1-0/+15
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2018-07-02usb: typec: tcpm: Support for Alternate ModesHeikki Krogerus1-9/+0
This adds more complete handling of VDMs and registration of partner alternate modes, and introduces callbacks for alternate mode operations. Only DFP role is supported for now. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-02usb: typec: Add driver for DisplayPort alternate modeHeikki Krogerus1-0/+95
DisplayPort USB Type-C Alt Mode allows DisplayPort displays and adapters to be attached to the USB Type-C ports on the system. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-02usb: typec: Bus type for alternate modesHeikki Krogerus2-11/+163
Introducing a simple bus for the alternate modes. Bus allows binding drivers to the discovered alternate modes the partners support. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-02usb: typec: Register a device for every modeHeikki Krogerus1-28/+9
Before a device was created for every discovered SVID, but this will create a device for every discovered mode of every SVID. The idea is to make it easier to create mode specific drivers once a bus for the alternate mode is added. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-02usb: typec: mux: Get the mux identifier from function parameterHeikki Krogerus1-1/+1
In order for the muxes to be usable with alternate modes, the alternate mode devices will need also to be able to get a handle to the muxes on top of the port devices. To make that possible, the muxes need to be possible to request with an identifier. This will change the API so that the mux identifier is given as a function parameter to typec_mux_get(), and the hard-coded "typec-mux" is replaced with that value. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-06-28usb: typec: function for checking cable plug orientationHeikki Krogerus1-0/+1
This adds function typec_get_orientation() that can be used for checking the current cable plug orientation. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-06-28usb: pd: include kernel.hHeikki Krogerus1-0/+1
This makes life a bit easier for the drivers that include pd.h. All pd_header_*_le() inline functions defined in pd.h call le16_to_cpu(), and all *_LE() macros in pd.h call cpu_to_le16(). Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>