From patchwork Tue Dec 11 21:24:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153521 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1111615ljp; Tue, 11 Dec 2018 13:26:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/VRo4XA7omDy0BXGClm36b2Fmp1x07089BEGQrOOAgVa1FUn4V0E0pN4fKB3vNjXV0Nzeup X-Received: by 2002:a17:902:365:: with SMTP id 92mr16665993pld.327.1544563609654; Tue, 11 Dec 2018 13:26:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544563609; cv=none; d=google.com; s=arc-20160816; b=OJKJWPEmw2k/CRWPKO+g8MyXZsYdeHc2Hyrxx7mK24qjJ9z4CvyA6v1yoEzOlFEeJW Itzj0TscOKJOxojuyB/gNtSPjWWRbd7pVFufI3TclnKwdxdUExCwB22Qg1V1c6tmclmq t9EAIkylo/R5EStFNVPR0Ea5guO19ieW2qSBxd+Djacz0LC2QYLYSj02f5+5u9lcgCUs pt1JZth3aJSA2xBeHzwUxlkgf5BHa2qOJjas0Kt0q/E+pQLtqCMRw6KnsDCBB7qm88q/ 79bO1vhJQcJ33tpVXFvdjubyapT+LW8sh3wPUOFzFWfY7nnUlljTa0WOs3PwuLxFP9oi dAyA== 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=Jnq+OwVAjE2KpWBcTMnLqNlM72PMDoCsAblvBeKtC1I=; b=PE60p8roK5hczb0p9ztDLoOma95zCTpPI7IQRlyxohhpFljVdnKCCMaivZXR7xxpfS uTSxnLcpBAXbmP4HkxugeKbw9S6LIbg5nQ5eByFn387IWhRRqftOAy2FYAO7oM88M53R tCzCQ4B23e9tHx6Ofmx9dC+8zSgfizWCwdubUbsUio8CF8jPqsyXY7Rxutk7JN/po1EW yxpMwPdUY/vqkFyJeb9TDkYScWwNVxQk1AZ8gnUS7SmbBWZsyjv3C4YSDYNlVM+CZt8W vpppBAVxeN532ARssDDoyTJT5XqkMGi585qpLVjraHqlMjAoa16vC3A446upEt3BhC18 b64w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I79SxOfZ; 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 d39si13318483pla.278.2018.12.11.13.26.49; Tue, 11 Dec 2018 13:26:49 -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=I79SxOfZ; 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 S1726387AbeLKV0r (ORCPT + 31 others); Tue, 11 Dec 2018 16:26:47 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42452 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbeLKV0q (ORCPT ); Tue, 11 Dec 2018 16:26:46 -0500 Received: by mail-lf1-f66.google.com with SMTP id l10so11899460lfh.9 for ; Tue, 11 Dec 2018 13:26:45 -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=Jnq+OwVAjE2KpWBcTMnLqNlM72PMDoCsAblvBeKtC1I=; b=I79SxOfZpg/9n7k+GwS77IsKuVLBqDEHYw7ZijXiQTIX7tbpUaFhYVz3ng6msCB/x/ 1U0itLE8kqKvdBjWivRINgNaBx+KibSBS4eVZWEIgxV4pvn1EF1/0xg8M/PFRMbSUtlF SYQyClyWQzgFvZtb5OY9Tr1AUd5cA5+BXw5dg= 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=Jnq+OwVAjE2KpWBcTMnLqNlM72PMDoCsAblvBeKtC1I=; b=UrSXD60C964s5CEZYUgcb9Wjqlj4aBaTmhEPdC5PX1ZF3Ymrm1sGJ8aj1TlxwAxiNF WlyNb3/8z+UcSXV97ukjlT2W5Iue92M9d37yFCHghwKBG635FrIaVs+ewKhY/c1THCsB v9UgiOb4LXvE5YHNJbVoA7cZVGO4A+xlRqivTkvXJaiUwPbqFIC21WP4IYMoWPOlc2Gu tplSBGNOIXwYwwDbhVQjVUWPXtxfCOcDjGrwD1FsBIAK7ApABsyDOW8wKPEuGCPJnffL IFRnAGQciz9w0LTUhKFrQT0ayy7w1R3fhghSLdYl0tosmzNRueiwEo7cD1gfHbapOlSk CH4Q== X-Gm-Message-State: AA+aEWZO5RF5/9LOxz8PZoF5kRjKietQ9QTqeTpxZHJi0FSKz//NZCR5 wyXrSLSHFamkgEckdWHTBKoRiA== X-Received: by 2002:a19:d58e:: with SMTP id m136mr11091455lfg.70.1544563604148; Tue, 11 Dec 2018 13:26:44 -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 y11-v6sm2873870ljc.85.2018.12.11.13.26.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Dec 2018 13:26:42 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Bartosz Golaszewski , Marek Szyprowski , Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 3/5 v8] regulator: fixed/gpio: Update device tree bindings Date: Tue, 11 Dec 2018 22:24:26 +0100 Message-Id: <20181211212428.28327-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181211212428.28327-1-linus.walleij@linaro.org> References: <20181211212428.28327-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 v7->v8: - Rebase on recent fixes on the for-4.21 branch. 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.2 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.