OSDN Git Service

usb: gadget: composite: Split composite reset and disconnect
authorWesley Cheng <wcheng@codeaurora.org>
Tue, 29 Dec 2020 23:03:30 +0000 (15:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jan 2021 15:45:50 +0000 (16:45 +0100)
commit8280de6ab07b4c63eb607662754f151e539031a1
tree98f83dee9652759f18006d0887eb4f23dcbe1c81
parent82c46b8ed9dc395df902c1857e908f08f8395ca7
usb: gadget: composite: Split composite reset and disconnect

Add a specific composite reset API to differentiate between disconnect and
reset events.  This is needed for adjusting the current draw accordingly
based on the USB battery charging specification.  The device is only allowed
to draw the 500/900 mA (HS/SS) while in the CONFIGURED state, and only 100 mA
in the connected and UNCONFIGURED state.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1609283011-21997-3-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c
include/linux/usb/composite.h