From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60381C282DA for ; Fri, 12 Apr 2019 14:24:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23CDC2083E for ; Fri, 12 Apr 2019 14:24:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Ufa0BLRK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbfDLOYH (ORCPT ); Fri, 12 Apr 2019 10:24:07 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47384 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbfDLOYE (ORCPT ); Fri, 12 Apr 2019 10:24:04 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3CENsvb002136; Fri, 12 Apr 2019 09:23:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555079034; bh=Vw6Zie5sf+oXW59daqqsWea0HiJVk+fUww+feLpxn68=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=Ufa0BLRKH93NdBpmeFH4ilom/mdIyE6VbZ7esGJUQ0+AT9EhCYUthn2wSJpIXOJ8n XaAULeRpvLiZqVmGBNdU6v7LF/RK3nBEPZyeruby5MJVJXUcPg0GnCkeY3bNsJbT2l NNIzwecBSWnhujNIWBq6c+coUSbhU/sZwunHWLk4= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3CENsAn095752 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Apr 2019 09:23:54 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 12 Apr 2019 09:23:54 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 12 Apr 2019 09:23:54 -0500 Received: from [172.24.190.172] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3CENpxb004909; Fri, 12 Apr 2019 09:23:52 -0500 Subject: Re: [PATCH v5 0/6] ARM: davinci: ohci-da8xx: model the vbus GPIO as a fixed regulator To: Bartosz Golaszewski , Kevin Hilman , Alan Stern , Greg Kroah-Hartman CC: , , , Bartosz Golaszewski References: <20190412123640.11437-1-brgl@bgdev.pl> From: Sekhar Nori Message-ID: Date: Fri, 12 Apr 2019 19:53:50 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190412123640.11437-1-brgl@bgdev.pl> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/04/19 6:06 PM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Historically the power supply management in this driver has been handled > in two separate places in parallel. Device-tree users simply defined an > appropriate regulator, while two boards with no DT support (da830-evm and > omapl138-hawk) passed functions defined in their respective board files > over platform data. These functions simply used legacy GPIO calls to > watch the oc GPIO for interrupts and disable the vbus GPIO when the irq > fires. > > Commit d193abf1c913 ("usb: ohci-da8xx: add vbus and overcurrent gpios") > updated these GPIO calls to the modern API and moved them inside the > driver. > > This however is not the optimal solution for the vbus GPIO as it > duplicates code. Instead we should model the GPIO as a fixed regulator > that can be controlled with a GPIO. > > This series adds fixed regulators for all users of vbus GPIO, adds > overcurrent protection using the existing vbus regulator in the USB > driver and removes the vbus GPIO calls once they're no longer used. > > Tested on da830-evm with the module both built-in and loadable. Applied to v5.2/soc with Alan's ack applied on 3/6 Thanks, Sekhar