Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941028AbcJYBj2 (ORCPT ); Mon, 24 Oct 2016 21:39:28 -0400 Received: from vern.gendns.com ([206.190.152.46]:49352 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756439AbcJYBj0 (ORCPT ); Mon, 24 Oct 2016 21:39:26 -0400 Subject: Re: [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent To: ahaslam@baylibre.com, gregkh@linuxfoundation.org, johan@kernel.org, robh+dt@kernel.org, nsekhar@ti.com, stern@rowland.harvard.edu, khilman@baylibre.com, sshtylyov@ru.mvista.com, broonie@kernel.org, abailon@baylibre.com References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-13-ahaslam@baylibre.com> Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: David Lechner Message-ID: <672c1f1a-58b7-6947-7fb2-acd38fab8597@lechnology.com> Date: Mon, 24 Oct 2016 20:39:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161024164634.4330-13-ahaslam@baylibre.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1873 Lines: 51 On 10/24/2016 11:46 AM, ahaslam@baylibre.com wrote: > From: Axel Haslam > > Currently, the da8xx ohci driver uses a set of gpios and callbacks in > board files to handle vbus and overcurrent irqs form the power supply. > However, this does not play nice when moving to a DT based boot were > we wont have board files. > > Instead of requesting and handling the gpio, use the regulator framework > to take care of enabling and disabling vbus power. > This has the benefit > that we dont need to pass any more platform data to the driver: > > These will be handled by the regulator framework: > set_power -> regulator_enable/regulator_disable > get_power -> regulator_is_enabled > get_oci -> regulator_get_mode > ocic_notify -> regulator notification > > We can keep the default potpgt and use the regulator start delay instead: > potpgt -> regulator startup delay time > > The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus, > (they should not have been decleared/reserved) so, just remove those > definitions from the hwk board file. > > Signed-off-by: Axel Haslam > --- How do you recover after an overcurrent event? I have configured a fixed-regulator using device-tree, but similar to the configuration in the board files here. However, when I shorted out the VBUS and caused an overcurrent event, I see nothing in the kernel log saying that there was an overcurrent event and after I remove the short, the regulator is never turned back on. > @@ -163,7 +198,6 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, > u16 wIndex, char *buf, u16 wLength) > { > struct device *dev = hcd->self.controller; > - struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev); nit: unnecessary whitespace change > int temp; > > switch (typeReq) {