On 9/20/2017 11:57 PM, John Stultz wrote:
> It has been noticed that the dwc2 udc state reporting doesn't
> seem to work (at least on HiKey boards). Where after the initial
> setup, the sysfs /sys/class/udc/f72c.usb/state file would
> report "configured" no matter the state of the OTG port.
>
> This patch adds a call so that we report to the UDC layer when
> the gadget device is disconnected.
>
> Cc: Wei Xu
> Cc: Guodong Xu
> Cc: Amit Pundir
> Cc: YongQin Liu
> Cc: John Youn
> Cc: Minas Harutyunyan
> Cc: Douglas Anderson
> Cc: Chen Yu
> Cc: Felipe Balbi
> Cc: Greg Kroah-Hartman
> Cc: linux-usb@vger.kernel.org
> Reported-by: Amit Pundir
> Signed-off-by: John Stultz
> ---
> drivers/usb/dwc2/gadget.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 7fd0e38..603c216 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3202,6 +3202,8 @@ void dwc2_hsotg_disconnect(struct dwc2_hsotg *hsotg)
>
> call_gadget(hsotg, disconnect);
> hsotg->lx_state = DWC2_L3;
> +
> + usb_gadget_set_state(>gadget, USB_STATE_NOTATTACHED);
> }
>
> /**
>
Tested by: Minas Harutyunyan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html