From owner-freebsd-arm@freebsd.org Thu Jun 30 20:56:08 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06C07B8898B for ; Thu, 30 Jun 2016 20:56:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA3A42BB9; Thu, 30 Jun 2016 20:56:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6461A1FE022; Thu, 30 Jun 2016 22:56:05 +0200 (CEST) To: "freebsd-arm@freebsd.org" , =?UTF-8?Q?Edward_Tomasz_Napiera=c5=82a?= From: Hans Petter Selasky Subject: DWC OTG patch to test Message-ID: Date: Thu, 30 Jun 2016 22:59:46 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6CA4512BEC3D78A4FFAB7C48" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2016 20:56:08 -0000 This is a multi-part message in MIME format. --------------6CA4512BEC3D78A4FFAB7C48 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, The attached patch should fix detection of USB detach, if you connect a USB device directly to the RPI, not via the built-in USB HUB, for example using RPI-zero. If you have a RPI-zero running FreeBSD - please test. --HPS --------------6CA4512BEC3D78A4FFAB7C48 Content-Type: text/x-patch; name="dwc_otg.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dwc_otg.diff" Index: sys/dev/usb/controller/dwc_otg.c =================================================================== --- sys/dev/usb/controller/dwc_otg.c (revision 300199) +++ sys/dev/usb/controller/dwc_otg.c (working copy) @@ -2985,7 +2985,8 @@ else sc->sc_flags.status_bus_reset = 0; - if (hprt & HPRT_PRTENCHNG) + if ((hprt & HPRT_PRTENCHNG) && + (hprt & HPRT_PRTENA) == 0) sc->sc_flags.change_enabled = 1; if (hprt & HPRT_PRTENA) @@ -4745,6 +4746,8 @@ value = 0; + if (sc->sc_flags.change_enabled) + value |= UPS_C_PORT_ENABLED; if (sc->sc_flags.change_connect) value |= UPS_C_CONNECT_STATUS; if (sc->sc_flags.change_suspend) --------------6CA4512BEC3D78A4FFAB7C48--