From patchwork Mon May 14 08:06:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 912736 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OWLOfwQ3"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40ktcn3mFhz9s0W for ; Mon, 14 May 2018 18:08:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752353AbeENIH3 (ORCPT ); Mon, 14 May 2018 04:07:29 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:46812 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbeENIHZ (ORCPT ); Mon, 14 May 2018 04:07:25 -0400 Received: by mail-lf0-f66.google.com with SMTP id 16-v6so6964153lfs.13 for ; Mon, 14 May 2018 01:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NW0KBA/srjrUv7rN/huGBF7G0waKkWJrGeIm8NKkJ2s=; b=OWLOfwQ3i3o64DziXYnewYOy3VeJSyFOWtEypLg9pkajut3T5i3uXomkqTZMUOvL3r WLUYwJrWLcDjqGcK6Fw4VztRdgaURaGmUdFsoEnqUaNdtgNAQvRi/Tr0PbQn7zkvBrzl y7ZPJ7cCDkG/Hv5A4+9bU2x9xrSIrAliwkthk= 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:in-reply-to :references; bh=NW0KBA/srjrUv7rN/huGBF7G0waKkWJrGeIm8NKkJ2s=; b=VtDdfvsQAcIszPOzjsa1YC85mhcHikQ5w4kYjn5BLAziSXJsCZb47tj6CLCKxnQqz/ DSxzD+7lOAtoaBoxFc+aYW1AJVjISpoXoxJOLVZWnhyC8YIAsQX3qUMRJtX32DekAwNt We6C8oyW6xnSvMQJGNIX9agZJ6HcXLDfaT1rDTH4grZ0MgkVdFo6425WgJAV5+BSI1kk COivAd1zdrU8cLfWglTjIjfC4AehioTx9JtkbPbUYgxaANpVhm0nzSC+cXwywoPrOUA4 FPTNNEVQiB95s3XPvoHdfGwobXMglj6bWIcdE25ZF4F3KK3bRbMsPjE7ETewnwP0dJzC KbFw== X-Gm-Message-State: ALKqPwc84AETdvTlsi1vKwvtMi0Ft9CPHorpJaYMFVU71UvPJmK0qICp 12VHvF5DlsOKCOKCe+fG+oxEVw== X-Google-Smtp-Source: AB8JxZo2Z8b+fnYLtQK1yzXUgXXcqB/hVxnfMgRwf3ZceOmNwZ+E3nV4bnUdAXtAdWlah/nAaOOgiA== X-Received: by 2002:a19:4d04:: with SMTP id a4-v6mr7056662lfb.99.1526285243731; Mon, 14 May 2018 01:07:23 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id s4-v6sm1725265ljh.9.2018.05.14.01.07.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 01:07:22 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 16/19 v3] regulator: fixed/gpio: Update device tree bindings Date: Mon, 14 May 2018 10:06:37 +0200 Message-Id: <20180514080640.12515-17-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514080640.12515-1-linus.walleij@linaro.org> References: <20180514080640.12515-1-linus.walleij@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Deprecate the open drain binding for fixed regulator and indicate that we prefer this to be passed in the GPIO phandle flags. Clarify that the line inversion semantics for fixed and GPIO regulators completely overrides the active low flags in the phandle flags. Unfortunately this can not be changed to prefer that we pass the flags in the phandle: the bindings have been specified and deployed such that the presence/absence of this flag and only that controls the line inversion semantics. The crucial semantic is that the absence of the flag means the core will assume the line is active low, which in GPIO terms is an exception, as GPIO lines are normally assumed to be active high. This special device tree semantic cannot be changed without introducing a whole new compatible string for the fixed and GPIO regulators, so we just contain the situation. Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Resending. ChangeLog v1->v2: - Collect Rob's ACK. --- .../bindings/regulator/fixed-regulator.txt | 13 +++++++++++-- .../bindings/regulator/gpio-regulator.txt | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt index 0c2a6c8a1536..a7a1cd0dfa6e 100644 --- a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt @@ -8,10 +8,19 @@ Optional properties: - gpio: gpio to use for enable control - startup-delay-us: startup time in microseconds - enable-active-high: Polarity of GPIO is Active high -If this property is missing, the default assumed is Active low. + If this property is missing, the default assumed is Active low. + If the phandle flags to the GPIO handle also flag the line as active + low or high, that will be ignored for fixed regulators and the + presence or absence of this flag solely controls the inversion + semantics. +-vin-supply: Input supply name. + +Deprecated properties: - gpio-open-drain: GPIO is open drain type. If this property is missing then default assumption is false. --vin-supply: Input supply name. + Do not use this property in new device trees: instead use the + phandle flag to indicate to the GPIO provider that the line + should be handled as open drain. Any property defined as part of the core regulator binding, defined in regulator.txt, can also be used. diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt index 1f496159e2bb..8fef3e5358a2 100644 --- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt @@ -14,6 +14,10 @@ Optional properties: defualt is LOW if nothing is specified. - startup-delay-us : Startup time in microseconds. - enable-active-high : Polarity of GPIO is active high (default is low). + If the phandle flags to the GPIO handle also flag the line as + active low or high, that will be ignored for fixed regulators + and the presence or absence of this flag solely controls the + inversion semantics. - regulator-type : Specifies what is being regulated, must be either "voltage" or "current", defaults to voltage.