Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754145AbdGJNie (ORCPT ); Mon, 10 Jul 2017 09:38:34 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:58963 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754005AbdGJNic (ORCPT ); Mon, 10 Jul 2017 09:38:32 -0400 Date: Mon, 10 Jul 2017 17:38:11 +0400 From: Minas Harutyunyan Subject: [PATCH] usb: dwc2: gadget: On disconnect reset device address to zero To: John Youn , Felipe Balbi , "Greg Kroah-Hartman" , , CC: Minas Harutyunyan MIME-Version: 1.0 Content-Type: text/plain Message-ID: X-Originating-IP: [10.13.184.19] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 753 Lines: 25 USB CV driver stack doesn't perform USB RESET after device disconnect/ connect, so need to reset to zero DEVADDR field in DCFG to pass enumeration again. Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 98a4a79e7f6e..deb3d901b99d 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3174,6 +3174,9 @@ void dwc2_hsotg_disconnect(struct dwc2_hsotg *hsotg) return; hsotg->connected = 0; + /* On disconnect reset device address to zero */ + __bic32(hsotg->regs + DCFG, DCFG_DEVADDR_MASK); + hsotg->test_mode = 0; for (ep = 0; ep < hsotg->num_of_eps; ep++) { -- 2.11.0