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: 135674 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1439624lji; Mon, 14 May 2018 01:07:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZog4TYb9y2MimfCyBUQsQ3ogIlpLXcR3Dj25mUmpz3e2rdd81S7kp53YNHQ+d3Zix1s+WqZ X-Received: by 2002:a17:902:bc4a:: with SMTP id t10-v6mr8791313plz.343.1526285254137; Mon, 14 May 2018 01:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526285254; cv=none; d=google.com; s=arc-20160816; b=vlIq5gqOjXk/03rObDX9LraLzTcwjgnkda9nTOxJgtTQuE3HUsXq1qU+2m3YaIb6WE M4akr+I2Cj4Hmmst31oFwRsgTlloKoWeHhQkb8yYpFh9/oyEBQakTxEP7fdq+0mQ2qSq idKkLMUzhJm8Xzq57gvP1w8m/KMXTOB1cFKIdSeGLMecQN6CHCjYnk2eF2vBPUw/ypRC hPzSMsxBOyA2w0sdHyPkWVlnsYugPAcGF9nYBzRnX3ZmCv+P7jftdSdd2Jhm2Wh/2zb7 dBoS3C4hBZc8x0HyhiIpcLhB4v+6/6ylb+wtH/fu4pLFEbYVJWnmcmWBE3GMNweW3pIr 074g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=NW0KBA/srjrUv7rN/huGBF7G0waKkWJrGeIm8NKkJ2s=; b=pPwDPujblWHIBEeXBbYkVShe2ODBmOkmq/Tr/v2dy+222OotiM3U279sL+AbbS0wQz 99oI+S3jAPTczij63rgBXWI+taTatN31AOiXKDzWQIxohJF7WEwburqN3U0W7jWAn1QC EgWKW4O+RNX5o2yORAIlqwvTBCPSDcAQte5Y0wXwle9ebpY6E+rO6lxaHisiYNAoVx12 l2mctqZ1oiq50sF05hqxOx2Sw7XEF4IApIWHHxV9MrJ/3ohPqYFuh5Nep1uPChlwS39G P5ab/jnXpOn4Oi6Ggwe1qmYT5tbDC1tbzQwx4IiC3RDTwXAbIZxwpwuyRNQObBCLwsdk /2GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OWLOfwQ3; 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 m198-v6si6785758pga.107.2018.05.14.01.07.33; Mon, 14 May 2018 01:07:34 -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=OWLOfwQ3; 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 S1752368AbeENIHa (ORCPT + 29 others); Mon, 14 May 2018 04:07:30 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:37540 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbeENIHZ (ORCPT ); Mon, 14 May 2018 04:07:25 -0400 Received: by mail-lf0-f66.google.com with SMTP id r2-v6so16558316lff.4 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=uGD6GmblAnvf6O0laYHBMRrUgZn7YVIo+esYFU2NSHpldXnn6l1wisEL0l31L5qmLL OKamrO3fKRqihr4AbuAedFNP47fQ6DDcFnq5YSGMQXad8PH80hGh7J146Vq36kL/Vdyh NAA+lmjWkTch+Ym4KFW4tdxytjB+x0x7dm5RBO87k4D6yNCib7cIualMXwnlGK08lLUg ZRmcD+a26CQRVUmGDYL5803IjqF5KMkgap+cCRfUFG1gT6aPsflsydlX2EA6zaOaermr TkuTVJDyVodjvpim27PVmY1mdi/I+zxeudHnHXULpF96iGCrWF7NM1vtSN0WNvyZXMdO sxnA== X-Gm-Message-State: ALKqPwckqURmAoHQPpwucm7Zz4OrgNloR94r2x5wLqi4aV+jQrUKorF6 eSwJ2cvEOmEf2u65mHUtbjTV3vfrB40= 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: 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 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.17.0 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.