android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jack Pham 995567ded0 usb: gadget: composite: Allow bMaxPower=0 if self-powered
[ Upstream commit bcacbf06c891374e7fdd7b72d11cda03b0269b43 ]

Currently the composite driver encodes the MaxPower field of
the configuration descriptor by reading the c->MaxPower of the
usb_configuration only if it is non-zero, otherwise it falls back
to using the value hard-coded in CONFIG_USB_GADGET_VBUS_DRAW.
However, there are cases when a configuration must explicitly set
bMaxPower to 0, particularly if its bmAttributes also has the
Self-Powered bit set, which is a valid combination.

This is specifically called out in the USB PD specification section
9.1, in which a PDUSB device "shall report zero in the bMaxPower
field after negotiating a mutually agreeable Contract", and also
verified by the USB Type-C Functional Test TD.4.10.2 Sink Power
Precedence Test.

The fix allows the c->MaxPower to be used for encoding the bMaxPower
even if it is 0, if the self-powered bit is also set.  An example
usage of this would be for a ConfigFS gadget to be dynamically
updated by userspace when the Type-C connection is determined to be
operating in Power Delivery mode.

Co-developed-by: Ronak Vijay Raheja <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Ronak Vijay Raheja <[email protected]>
Signed-off-by: Jack Pham <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2021-09-22 12:26:28 +02:00
..
atm
c67x00
cdns3 usb: cdns3: Fixed incorrect gadget state 2021-08-12 13:20:59 +02:00
chipidea
class USB: usbtmc: Fix RCU stall warning 2021-08-12 13:20:58 +02:00
common usb: otg-fsm: Fix hrtimer list corruption 2021-08-12 13:21:00 +02:00
core USB: core: Avoid WARNings for 0-length descriptor requests 2021-08-26 08:36:13 -04:00
dwc2 usb: dwc2: gadget: Fix sending zero length packet in DDMA mode. 2021-07-28 13:31:00 +02:00
dwc3 usb: dwc3: gadget: Stop EP0 transfers during pullup disable 2021-09-03 10:08:13 +02:00
early
gadget usb: gadget: composite: Allow bMaxPower=0 if self-powered 2021-09-22 12:26:28 +02:00
host USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable() 2021-09-22 12:26:28 +02:00
image
isp1760
misc USB: trancevibrator: fix control-request direction 2021-06-03 08:59:04 +02:00
mon
mtu3 usb: mtu3: fix the wrong HS mult value 2021-09-12 08:56:41 +02:00
musb usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling 2021-06-16 11:59:41 +02:00
phy usb: phy: tahvo: add IRQ check 2021-09-15 09:47:35 +02:00
renesas_usbhs usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() 2021-07-28 13:31:00 +02:00
roles
serial USB: serial: mos7720: improve OOM-handling in read_mos_reg() 2021-09-12 08:56:40 +02:00
storage USB: usb-storage: Add LaCie Rugged USB3-FW to IGNORE_UAS 2021-07-28 13:30:59 +02:00
typec usb: typec: Add the missed altmode_id_remove() in typec_register_altmode() 2021-07-14 16:53:01 +02:00
usbip usbip: vudc: fix missing unlock on error in usbip_sockfd_store() 2021-05-14 09:44:22 +02:00
Kconfig
Makefile
usb-skeleton.c