Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1565134ybb; Fri, 29 Mar 2019 07:03:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7dr1glr1DxWOoiNHmoTM1rKXtPh952SKIs2FuKzychBEMgefd5z+TWQS97BVDG/jqaqwJ X-Received: by 2002:aa7:938b:: with SMTP id t11mr40059311pfe.67.1553868229421; Fri, 29 Mar 2019 07:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553868229; cv=none; d=google.com; s=arc-20160816; b=qVQ/r01Wy6KK1kHSxw3z64DWPxjxC+LWwRmsW9mnhr2bIUpmx6mYDmBvpFAhsSXMKY c9UnU5llYxfz8BY5WGyTAq1HQJrjFhQb61OekKD3a55GGjCa66BxHmyScKfZoyUWm1aR Yf8JXbT3EcQSfLIL7MZ//efQM8medOMKAG1AAaSa572teM/BaptGD2aMCkxhwIX8E6HQ rQ47VUMrrZLO4dYvCix4p9RdulNe/1FxsKZ8MEbaej07ldJOt9ZUESbucat/fR5XIo2o Oj0ubKv9vj8DFIOBX0u/S5PbF/ye/XiIu9ElQ5EcbWI2mlYK4uhEpcG1iJkILqMFWYKI 25Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=u9dCSpbhNf3HqoSqNhMr4eZ3B1ZYxepxHAkS0PiC1lc=; b=C/wsxh51f2ZpswcaAD0rvKDjXMT5MDwwvwOQ2GW4FbyKWyxIsOlDz4rGfdJVeWE5xv e9B48tyjX3Ij9AWU1Yw3JAIyirrDmXK0LcvouZpU/8pv18+oKgQrFr0nwcuSgm/Jmo27 KID2mYpV4MnlFELb8+2KGVuml5P3ncGGn3rXXR/SeYedfE8DRo7/ElB8QDmR/BRmDDus J8CveLILLxlY5d6uISteQw4LwXTNkbLncCgIdh/AiogtGybcNVL2z5Jrw9KmnkSjXEns /58T81RlLV2ZvVYJQKypSxupth7Qab0i9nTvnZt9e4NO0bBqjdlHSWGXx4aZRrv3F6wo 69wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si2064085pgl.21.2019.03.29.07.03.32; Fri, 29 Mar 2019 07:03:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729413AbfC2OCm (ORCPT + 99 others); Fri, 29 Mar 2019 10:02:42 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48942 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728996AbfC2OCm (ORCPT ); Fri, 29 Mar 2019 10:02:42 -0400 Received: (qmail 1797 invoked by uid 2102); 29 Mar 2019 10:02:41 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 29 Mar 2019 10:02:41 -0400 Date: Fri, 29 Mar 2019 10:02:41 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Bartosz Golaszewski cc: Sekhar Nori , Kevin Hilman , Greg Kroah-Hartman , , , , Bartosz Golaszewski Subject: Re: [PATCH v2 0/6] ARM: davinci: ohci-da8xx: model the vbus GPIO as a fixed regulator In-Reply-To: <20190329093334.3885-1-brgl@bgdev.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Mar 2019, 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. > > v1 -> v2: > - add patch 1/6 that fixes an existing problem with missing array > sentinels in GPIO lookups > - add patch 2/6 that removes an unnecessary use count variable from the > driver > - reorder the changes: add support for overcurrent protection using the > existing vbus regulator first, then setup fixed regulators in board > files and finally remove the vbus GPIO from the ohci driver > > Bartosz Golaszewski (6): > ARM: davinci: add missing sentinels to GPIO lookup tables > usb: ohci-da8xx: let the regulator framework keep track of use count > usb: ohci-da8xx: disable the regulator if the overcurrent irq fired > ARM: davinci: omapl138-hawk: add a fixed regulator for ohci-da8xx > ARM: davinci: da830-evm: add a fixed regulator for ohci-da8xx > usb: ohci-da8xx: drop the vbus GPIO > > arch/arm/mach-davinci/board-da830-evm.c | 51 ++++++++++++++++++-- > arch/arm/mach-davinci/board-da850-evm.c | 1 + > arch/arm/mach-davinci/board-dm355-evm.c | 1 + > arch/arm/mach-davinci/board-dm644x-evm.c | 1 + > arch/arm/mach-davinci/board-omapl138-hawk.c | 50 ++++++++++++++++++-- > drivers/usb/host/ohci-da8xx.c | 52 ++++++++++----------- > 6 files changed, 122 insertions(+), 34 deletions(-) For patches 2, 3, and 6: Acked-by: Alan Stern Alan Stern