Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp618960imm; Fri, 12 Oct 2018 04:04:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63zGtOCyhyaJ7PoWeEGXBbZTCBLxGT9PeMuW30n2Se0wrk4gfoncBrqlwm/sQaOdQl/LfcY X-Received: by 2002:a63:f005:: with SMTP id k5-v6mr5138832pgh.259.1539342269834; Fri, 12 Oct 2018 04:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539342269; cv=none; d=google.com; s=arc-20160816; b=paFHbOoK2IWUIlE65jr+uFQC6oyjVkNGbR4HkQEzx1SvsZ7j/8pYKEszd8fA1jO/68 VZL75QiJSXSZaEF4BATakMvVG2AmQTUNtC68Vc+vVMNQsgqa3lEjv/bGSIWrMWzqu8kS +Lxcgzm/+/xDKOpIynkewqUE0SDMzrcGXfJlqETRGYFoVm5JRhaoD6gtorTyT7WB9jrI xTk+Uu6En79IpDEmvTn7saXGyI+elQtlbnE/EL9pbAJ31XLTJpN9NgM/zDzsJLnyZjzK obzcSamto02MZ6u9qADh+mPgXSShklryZU4njEs2JReSzPKkYFuBOxKkzY+nOsZA63Mk Y5ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=F4UHiGkAZ+o+54MjXN/yqnBdpTfXdZRH6F84SVbUT1k=; b=eEYMR6eqAjefcEyfQEZB5LHWb2XmURsvqU+Rw64l2m7/QJLWOr2Z0g4Q6pxn24T6J4 V0bqY9TgFhhisB6Uuug+jof5k+wUrBSeRjdMiqPzxFkViHM6njxbFGiUAiTB9LgRBmsZ GpVKCjghj4fKKH8yXRy+0K2yveVS77nBrRYEMsFVeP+SPbWEB1HKvt5irWhPuMnbAOwg NfjAfoCKsACOcTrTRl6QKEBjMx9qhnne23IutA5NgaV2m7dMGfncJgHsNeENiRLGDkBN DxNHdpTwvD0adcOpFqMyTlgkQmhFPlN+lYwWPkzCVrE2RvB6efOudb8/vSEjzU0NwVd2 WM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jeOdmwB3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z191-v6si805283pgd.451.2018.10.12.04.04.14; Fri, 12 Oct 2018 04:04:29 -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; dkim=pass header.i=@linaro.org header.s=google header.b=jeOdmwB3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728176AbeJLSfp (ORCPT + 99 others); Fri, 12 Oct 2018 14:35:45 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45305 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727640AbeJLSfp (ORCPT ); Fri, 12 Oct 2018 14:35:45 -0400 Received: by mail-io1-f68.google.com with SMTP id e12-v6so8878980iok.12 for ; Fri, 12 Oct 2018 04:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F4UHiGkAZ+o+54MjXN/yqnBdpTfXdZRH6F84SVbUT1k=; b=jeOdmwB30cAhnGhKftD9yzdjIlqS7EtT9j9azHjcO1/vmEvtdHqr1R8pP6DX6T58a5 pa2/sQYs75ueDtSkYr87yN6Kqh8vU6EAV/LossiGWf01hlMGFToIL3+zAL/lZtWCO4Ac HPbOZxNR2XEbA5C6ws3Yj0zpSl1WovamtiO1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F4UHiGkAZ+o+54MjXN/yqnBdpTfXdZRH6F84SVbUT1k=; b=ehTXfLrj4eSujb8bT+wjeqQCk0CumQHb/DgWnrwYbVx5/iSSZaXQmJgqmTuUQnby3V CW5FlaaMIXadjjUbabQuh2Ic4AVrqM+LofdAuEitbn8eFkW3qalnW9jcmTVe/AH0ndv8 ncy7BdZeKb4G+VlrqncIh6G7YAYwwE0Px1KRX6tN8PLG0GtHqPfcTZSmu5jgKqZzGAo1 8ggOW3wgYNWpkJ2wx6FXPxK3MxzGi7SXkYdEgz3qwrM8BQ+Zx0dvlZitRYM3OdVEN1Xa 5lO3fXGlhTZCmpXAFoAZD1/qp4dcnoFO7Sd7xqe/5yMjhzNIsGV8fl7qixfaHe3zWAn5 OSzg== X-Gm-Message-State: ABuFfoiBsBTsmc6la3qPghAFTeAzXZHVIorIzPrMSO22fCx3SN/3k7Ov L+nScgqijzxZ6ywdSP9x6pkYxwZzMeCmwXlmgQFhJw== X-Received: by 2002:a6b:c3c4:: with SMTP id t187-v6mr3843503iof.304.1539342230966; Fri, 12 Oct 2018 04:03:50 -0700 (PDT) MIME-Version: 1.0 References: <20180906122436.25610-1-linus.walleij@linaro.org> <20181011090112eucas1p286d8c1edfc1a2a207d8a11c5ad7eb20e~cglSx9qcr2394623946eucas1p2y@eucas1p2.samsung.com> <1539272073.18645.12.camel@toradex.com> <1539337415.30485.21.camel@toradex.com> <20181012104338.GS30658@n2100.armlinux.org.uk> In-Reply-To: <20181012104338.GS30658@n2100.armlinux.org.uk> From: Linus Walleij Date: Fri, 12 Oct 2018 13:03:38 +0200 Message-ID: Subject: Re: [PATCH v7] regulator: fixed: Convert to use GPIO descriptor only To: Russell King Cc: Jon Hunter , Marcel Ziswiler , "linux-kernel@vger.kernel.org" , Robert Jarzmik , Aaro Koskinen , jacopo , Marek Szyprowski , Mark Brown , Alexander Shiyan , Haojian Zhuang , Liam Girdwood , Mike Rapoport , Daniel Mack , Marc Zyngier , Philipp Zabel , linux-tegra@vger.kernel.org, Janusz Krzysztofik , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 12:43 PM Russell King - ARM Linux wrote: > Given that DT describes the hardware, not the software implementation, > it must not change just because we move from GPIO numbers to GPIO > descriptors. > > The existing DT description is reasonable, and introducing ficticious > regulators in DT to work around the implementation is not reasonable. You're right. In the electronics and the device tree it makes perfect sense for the same line to enable/disable several regulators. The patch I made is a quick hack to allow multiple users of the same descriptor, I think the long term fix is simply allow multiple users where applicable and maintain a reference count just like the regulator core is doing, assert the GPIO when the first consumer asserts it and de-assert it when the last consumer de-asserts it. What the old and current gpiolib does us just call the callback to enable/disable the line immediately as response to the callback asserting/deasserting the GPIO, which is just too simplified. Yours, Linus Walleij