aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJack Pham <[email protected]>2021-07-20 01:09:07 -0700
committerGreg Kroah-Hartman <[email protected]>2021-07-21 10:06:47 +0200
commitbcacbf06c891374e7fdd7b72d11cda03b0269b43 (patch)
tree1d7ace15d4bc182a66801c95c7d4f6dd40840824 /tools/perf/scripts/python
parentfb4e52b609f0e29468b8f5b71117456410ff7d3b (diff)
usb: gadget: composite: Allow bMaxPower=0 if self-powered
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]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions