diff options
author | Prashanth K <prashanth.k@oss.qualcomm.com> | 2025-02-17 15:03:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-19 17:18:55 +0300 |
commit | 40e89ff5750fca2c1d6da93f98a2038716bba86c (patch) | |
tree | 9ae9f76dfd54fbf8931bd4808b8c69ba880bbe1e /tools/perf/scripts/python | |
parent | 17c2c87c37862c3e95b55f660681cc6e8d66660e (diff) | |
download | linux-40e89ff5750fca2c1d6da93f98a2038716bba86c.tar.xz |
usb: gadget: Set self-powered based on MaxPower and bmAttributes
Currently the USB gadget will be set as bus-powered based solely
on whether its bMaxPower is greater than 100mA, but this may miss
devices that may legitimately draw less than 100mA but still want
to report as bus-powered. Similarly during suspend & resume, USB
gadget is incorrectly marked as bus/self powered without checking
the bmAttributes field. Fix these by configuring the USB gadget
as self or bus powered based on bmAttributes, and explicitly set
it as bus-powered if it draws more than 100mA.
Cc: stable <stable@kernel.org>
Fixes: 5e5caf4fa8d3 ("usb: gadget: composite: Inform controller driver of self-powered")
Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250217120328.2446639-1-prashanth.k@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions