usb: gadget: composite: Inform controller driver of self-powered
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Tue, 4 Feb 2020 02:05:32 +0000 (18:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Apr 2020 06:00:33 +0000 (08:00 +0200)
commite591d7ca6e9cd24bff5fcef70d65544585656488
tree2602c37146c211d740860c99cd0a240d424b5cb9
parent03ee78583a9e1a7e52819a2f95ef6c9f70397dbb
usb: gadget: composite: Inform controller driver of self-powered

commit 5e5caf4fa8d3039140b4548b6ab23dd17fce9b2c upstream.

Different configuration/condition may draw different power. Inform the
controller driver of the change so it can respond properly (e.g.
GET_STATUS request). This fixes an issue with setting MaxPower from
configfs. The composite driver doesn't check this value when setting
self-powered.

Cc: stable@vger.kernel.org
Fixes: 88af8bbe4ef7 ("usb: gadget: the start of the configfs interface")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c