From patchwork Mon Nov 19 07:11:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 151457 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2324634ljp; Sun, 18 Nov 2018 23:13:58 -0800 (PST) X-Google-Smtp-Source: AJdET5eDHRbVRQp2CbYrR/xG1CzNBJL02GgITDkFvVDeJwqTLBvgmaFYzft6cJsncfM/BTH2dnYp X-Received: by 2002:a62:c101:: with SMTP id i1mr5508004pfg.80.1542611638494; Sun, 18 Nov 2018 23:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542611638; cv=none; d=google.com; s=arc-20160816; b=ntQdGeNPi4rcK4/+UaTUUt1anv6Hyp0uXrTdS5yrBnBI1A5BMTYEEaOsgixZ4jXtQY FsAu34ZgXPDy6sdTHnMoQ+dcV+mL8tdS2CiGcpI3g5A1xHccNAeGBaWBDUYR2LSz06hB dRxGV+b0y8W1rDF5HRYBSjYjzO7QhuHWilbLtfm770nqfvY9TVHZjorNrBH/O/xHa4GS OemPYT97I+fzavh2Kx57ZtOCMa5nOm0LipE5qB2KU6caiVNinSDkOVWm0xBvW5tsPWzL V0HdprzigN6QQ7wyOPWUMJZCSPYcEcMcjRadBcvo6CdJbXhdRwKxPeqvyJjk3L9+uHFV UY5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IBb3a4hWtaHZwpV0DBM1ehv0fImjohELlIgLSGXL7yo=; b=iK/AxrqBdE7fQ+HgF79cUKRZUQZcMCnCRNfPu4lA+VZvelghNFsfsene29Fc4Yphab fb6qtUkg14EG2qjEkKabHVol5g+3wmBe7Ece4znVOI8NtBrYUnhCL+9tDJYSIU8568CN K0nSOM2cuL4tXWNstHqF5AgcDh4GM0yBAiysLB4z8EIAZ3gcnzI+6hXR2DNg15mOpQbr eVuX5+IPPg9NAQJDOEpFvjg2gpa0RJZlpAjSkQ8e6K6wyDN4RTulOHeIbdkBrJdnjPY7 g0tXf7d5LZAYRyL/HcySoxsxkn4UuaKaekYYq0M3FTHnWI65WK4jETkSiuasIfsyL+E2 yhFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Vc1tK/1t"; 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 m14si38070957pgd.326.2018.11.18.23.13.58; Sun, 18 Nov 2018 23:13:58 -0800 (PST) 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="Vc1tK/1t"; 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 S1726453AbeKSRgk (ORCPT + 32 others); Mon, 19 Nov 2018 12:36:40 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34579 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726079AbeKSRgj (ORCPT ); Mon, 19 Nov 2018 12:36:39 -0500 Received: by mail-lj1-f196.google.com with SMTP id u6-v6so25208582ljd.1 for ; Sun, 18 Nov 2018 23:13:54 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=IBb3a4hWtaHZwpV0DBM1ehv0fImjohELlIgLSGXL7yo=; b=Vc1tK/1tr5TVqXv1yFSwORx/LydYEsKqUN6t5rFAZDLbqkQQa2/5ybvY97fW0N6qsA qNq6ogqDH/W94s5NKhzcRSha9xkbtcjJMb2D86/sVVqqZQLrgvA2t6KogSdf/lQ63PPF zX7SCa18Quqhj8f6hqTFpFXo8JYBRjYHUHsPI= 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:mime-version:content-transfer-encoding; bh=IBb3a4hWtaHZwpV0DBM1ehv0fImjohELlIgLSGXL7yo=; b=iLnBaW36EiZBOZr4GN1i2Ez465CPKv9uh1OSvDf0V+2skaSjnagZjOtkblkku+fsad el3Yi0eky4HUO/rwcJyjmT+eilJ3uDr54sKdxcfZCt4AJg/OXDr/Q8jxeKzKz+Asf/L9 zlSMxxu1u3X107ZAzxZREZ4y6FP7Id0+Q5jxDt6OwS3W5QMT3nuEPGTpY1z46vRqhOOE urL/SfBaW0BcorqrB6zQ6FLN+/MKVf7i/3xk6jcq3pJTz2fPB3mbHFjAqWWpF5znNtLI n2+Veo7UTvNFXQ7xem0GRWsXKPfXSC6o5JKZn8cRk1+aZHaR3Xlv1sNEfEZkXAYLy1vq 8QTQ== X-Gm-Message-State: AGRZ1gIxkZKNe0MO+SS6eRuz6mY+2z1fQ1rjd2R1TEGzxxVSiZuc1vcw tACHzfA/SbOdaG1MLI2Jq5hPmA== X-Received: by 2002:a2e:8007:: with SMTP id j7-v6mr11047186ljg.22.1542611633409; Sun, 18 Nov 2018 23:13:53 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 10sm5531584lff.62.2018.11.18.23.13.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Nov 2018 23:13:52 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 3/5 v7] regulator: fixed/gpio: Update device tree bindings Date: Mon, 19 Nov 2018 08:11:24 +0100 Message-Id: <20181119071126.8889-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119071126.8889-1-linus.walleij@linaro.org> References: <20181119071126.8889-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 v6->v7: - Resend with the rest. ChangeLog v3->v6: - Resending. 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(-) -- 2.19.1 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.