From patchwork Tue Jan 29 10:31:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156953 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4490774jaa; Tue, 29 Jan 2019 02:32:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN4b3Zk7mYVkiPr+fHQOf192wIVlgN3ITJLAO7uKg6klClBp6cf9BHD39ImA+dZHRcDj19Fb X-Received: by 2002:a63:fb4c:: with SMTP id w12mr23291850pgj.321.1548757936444; Tue, 29 Jan 2019 02:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548757936; cv=none; d=google.com; s=arc-20160816; b=HA/j6XA5fqV9XVymDp6Bkwe/EiHHf5mvG3m7MfKVsWZjtSsiFfP3NozlTg2bgjTxCM 8Xm0wjUGs600yaUBY2DKOWdHwr1WetCrpcacSloiLU5UsejY+IHB/hBkNVxuxcVAQeWJ AnVe2Zuc+i2xSzjePcoEtJpQlJMOW36oiZDjSZ14rmP357ZzYPMvalwCmCcQDNcbHqpq 99m04CaV6HUl6Py3tmHghcoXscv7wLLdGOwi+mPLUdNFlL7GOF7EcL4q4vOgmnzC3SJo lF1HkLtfBT3e9VDNkLNgWzYXo0szkvpE+NxP+KOSZrVwXrJorkwmumWjasHOI5zGNN3y fV7Q== 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=nWy4IKgcVotjcGKcL+YOPtGjOTrN/OWg2WWmLAh2Cuc=; b=l2/FRFE8997slLSXKz9XUxrCWi3wLBOKkMU0+6j/d0t9Q+ildDOPEdFbUbtzj8S/xf Fgy8Efo4FFkzPvZ5YK7CGOfwbjsLrGiSuqT/zZBBx8pnjVT9FOiXkIS4/L+ITbkhdH9q /iCqK85ZWsX2BtLxieIVdO9od2s3ieaMU7GbPnhfxSv8buoj9DfziraqhhepvLeSPwCr 3sx/jpFEhDwBm73ku6oV7Sk6GXFNTSw5FuXB59Hr43ktKbY1scua+yjIrpDBBrkU8PaI fWs69OjWBqoGaqv7+PPqL8A0d2GKCU/5cAavLnrpr9G53c/hZbVz/1u82tCPNYeMwRSq 5A3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZhDuyu8L; 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 3si18003201pla.240.2019.01.29.02.32.16; Tue, 29 Jan 2019 02:32:16 -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=ZhDuyu8L; 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 S1728465AbfA2KcN (ORCPT + 31 others); Tue, 29 Jan 2019 05:32:13 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:35073 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbfA2KcL (ORCPT ); Tue, 29 Jan 2019 05:32:11 -0500 Received: by mail-lf1-f65.google.com with SMTP id e26so14229268lfc.2 for ; Tue, 29 Jan 2019 02:32:09 -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=nWy4IKgcVotjcGKcL+YOPtGjOTrN/OWg2WWmLAh2Cuc=; b=ZhDuyu8LF/gtqxDcoKYwiqntXXSEhkG/QwiwOggiz+VVa5DtPtho1bn4lO/JihJATh j6ogTtNTeOitU8rHlSOgzTJx9VHAShs4Q6/SjPhHeOaB7y8HR17oiklXFM+LU9ROBuWs IonbT2qC1maNUvIPBv+YeydRKVdZ/YKpBhl2Y= 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=nWy4IKgcVotjcGKcL+YOPtGjOTrN/OWg2WWmLAh2Cuc=; b=WU2c1QTh8C1JmI+f9pmoQn4vg5fZhTTtMpxIvDBylwuSUk5WrlXEj1Vb2tu79gW6ew 5NXw91DLkEWvAtyxEksvDqbkqbwdbYXSLYBFXh68v7jcq93PwDizVYSmMQfR1CR0CE6Q QeLrYUqgsnKu6ZTLOxZq2LWthay3737vqJ6ckqciZR7jLApFr6GVLJXO/Yp0nsbslMLn c+7aGlYRcbWQNrBVQ10UAOiuVW0Nnvo7VRfbaNubYLL8JsgBpcapKzm3MlvbPtXhVe9E L+GC65r2SLzOLB8zVmQM+TXgDlpi9c7AeEMSzjxOH7UI7hVnx4fBqnn7Y/Ug5eoEwPuD 3wAg== X-Gm-Message-State: AJcUukfMFWsq3sqAnjfMDRXiV4dPrOgrFnOx+r7wrKZYdyBlik0o2gn7 PFHmcHZ4sq5KftAXxr8V5gW6moiHFys= X-Received: by 2002:a19:6a13:: with SMTP id u19mr20581381lfu.46.1548757929045; Tue, 29 Jan 2019 02:32:09 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id y9sm3471540lfe.75.2019.01.29.02.32.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jan 2019 02:32:07 -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, Rob Herring Subject: [PATCH 3/5 v10] regulator: fixed/gpio: Update device tree bindings Date: Tue, 29 Jan 2019 11:31:54 +0100 Message-Id: <20190129103156.10139-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129103156.10139-1-linus.walleij@linaro.org> References: <20190129103156.10139-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 Tested-by: Marek Szyprowski Signed-off-by: Linus Walleij --- ChangeLog v9->v10: - Rebase on other changes. ChangeLog v8->v9: - Rebased on other changes. - Collected Marek's Tested-by. ChangeLog v7->v8: - Rebase on v5.0-rc1. 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.20.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.