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=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 3BCB9C43381 for ; Fri, 29 Mar 2019 09:34:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C2C120643 for ; Fri, 29 Mar 2019 09:34:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pFczKGkf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="StbL9jxf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C2C120643 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VxSaCmmkSeOzIJMbbnuUj1Uq4+VWtAgucobZ8DAshxU=; b=pFczKGkf8nsh3m 5izTwYQDfVKXKOzSI7wOm0FB7P/2dG38jsfvdlLbp4xwzCu0wvBjiDsJrtoxcrpXtXjyz7gRrNhdv 50F72F9qDICiUk81LsELuNekxCi2rbovSkaXkoGcEJi71a7PSM9rilT5f5+kAwc8UwKKD+hj8aVjw iFfwoOVw1Jsnc5ses/iRWPq1aoDFC42Ut5jQ3pdntKQNshxsz1XJLwiWZrHrQ6s12pwrWj64xMU53 2uhScid0JaknVli4TzBnjUuluLmZUnhV2Kak7eKrvWdVyC5LEhzfye3fYy36D7QyjHM0zBjVRjuo9 2xnsFZB9GSKBy7MEmz7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9ntU-0001V2-0Z; Fri, 29 Mar 2019 09:33:48 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9ntP-0001Tp-Kh for linux-arm-kernel@lists.infradead.org; Fri, 29 Mar 2019 09:33:45 +0000 Received: by mail-wr1-x441.google.com with SMTP id p10so1741974wrq.1 for ; Fri, 29 Mar 2019 02:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GpELJtW4fCVe+Ycfj/JyzEGzxyVdJh7lCZRF0JRDAmo=; b=StbL9jxfAYy2Dxev994vRr2jrp0QWEaYx4Q38Af7iiA6tnp8/u4/eJIcMCja5VxTcw M25dq5tUiv0KyBxRY2noBeBD6ua5st5yuLJAzGFnfF6gP8mOrkkDD5k6qXd6T5ORXyiF W6k3eAWsrrvg9mtq1tmmyd5J6MgKfH6R/CdDbSnoQNW/t6Awo/lMcuZOOOcyvpFq9E3O 9NnDacgcmIyBjlEH3tMIswPNtalwAgpv3QAMC92sH+1/eOsYxdRmkxw6vy18/gndwfXr LcYs5/Hl+4OotlZmudghUor9a++XZetTH8HTbDAdt9Tk7dMQ5z58Gn+lu1KuEfUqiPJW C/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GpELJtW4fCVe+Ycfj/JyzEGzxyVdJh7lCZRF0JRDAmo=; b=eFupPIRG7ojbhnBjyj9fHC44bViz21VC5/YR/hDkvShzn8haQE9dwsFLG33kFD8233 fW9XXQoq0uReTQYcOSRRcD5E+aiEgpVkclSddoEYF50bApdaLnS91++8Vfd2SWZ0j67K Ag60rvP/qjOGjqm42+Kb7YJzdhSYD/mfL5UqZ3FzlmLJu0S2NINlP/Rvk1LY2LlA8/rj b+UMPsUlPIqKZ3KI3bIDIj2u2RiIaPEoO4843VN1X+GIZxjeBzu9KHdSGQmx64CpR1Yh RF0ll8e4VZR02A9w3pDVsfcaYM4HYnahsuLgNe5A0ptUMlfKL7KaAgX2qwTZnSvVOJkY 3ngA== X-Gm-Message-State: APjAAAWakeYp44OtNWAeQ+KLBPuVSX5NWRQN/5quWK0thUMA++n/vTIj bgb+aH0yxb0elOVaw4IN02xGZA== X-Google-Smtp-Source: APXvYqwGe72+R/HJYLG4Bw9as9N3h4jGK5k9CIf2Cpdx+/xB0L0e7eEQ5bI83VsTjllybDqiHtY4/g== X-Received: by 2002:adf:ec11:: with SMTP id x17mr29266263wrn.120.1553852021903; Fri, 29 Mar 2019 02:33:41 -0700 (PDT) Received: from localhost.localdomain (aputeaux-684-1-29-77.w90-86.abo.wanadoo.fr. [90.86.254.77]) by smtp.gmail.com with ESMTPSA id s12sm1957125wmj.42.2019.03.29.02.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 02:33:40 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Alan Stern , Greg Kroah-Hartman Subject: [PATCH v2 0/6] ARM: davinci: ohci-da8xx: model the vbus GPIO as a fixed regulator Date: Fri, 29 Mar 2019 10:33:28 +0100 Message-Id: <20190329093334.3885-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190329_023343_727727_C7F05247 X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-) -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel