From patchwork Mon Jan 21 09:12:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156174 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6153579jaa; Mon, 21 Jan 2019 01:12:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4fR/Ewy0UfsbSrIj0j49z1/ROCAx2fE7QnWnTKXbCFpLfLI4DpRn4W2xeb1uEBcVK1GCCP X-Received: by 2002:a63:6506:: with SMTP id z6mr27417268pgb.334.1548061941076; Mon, 21 Jan 2019 01:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548061941; cv=none; d=google.com; s=arc-20160816; b=BbWkwDMgeQDCkw4CC6GSOgiFQ+AYdviJbStIJ0j3e4TJq4YpjjOWrqd01LTOzHx/aM bSZY9bLwLW+U28W05RzmEoR4IqAUu+LLlj+GnjCZr76SYdbGArcY7qBToFse43iyrdEw XgK3IXMiLjMymjfkpY9gtpdQ3jdk66mJAGEnATqazII/we6v6GIEiys7Agdek+67t2QU FqU0hxtl+QMyPKlAUMQGWzO/fhf+idUoR8TtBPyvvKvQHR6xOqoZbZ0Po/qn/SH1hpNj Pw2H2U7xnClxH7C2X2T+KmRMTJntE/tAUZkeXUr2l9TFFmlD/aohWDZiUl43Xrtm/b/E gC4A== 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=Um6LelattwCcSWENhGPP2goGHhRfdc018uwfh2i6YoE=; b=LxO7KqHfqhHZd8hgeyApWYmZSR5qBxAgb8mYhWUjQ+TZRIg2527NUP4pySNi8RZiFL pGsSwWqo6aYiDyGHSeqRYFSUHbews6vxx5Y3HD2YUvjNG5XtmzM+I2BwY6jg4I7tkUqF Lix+1G/23pbpl5LiSKUAS3RJs4X9cGwJWyok3HODBLLohi707Q8SSz8GN40zSjsLxt/k ktLSreSyuYR0i2yPgVaSEZpYQ0H7O+RmJlaELpOaYj9c7l3WDFSkS/8+Vw3OwxSXlM+Z mShk7qXNwpkLfJv7N4o4aB+A3bWUxGmFFRm92hwA8pXl6d93qOUkPqUAe4BbE7x1fv8b o/sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dqJklgqS; 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 d34si11024893pgb.43.2019.01.21.01.12.20; Mon, 21 Jan 2019 01:12:21 -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=dqJklgqS; 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 S1727416AbfAUJMT (ORCPT + 24 others); Mon, 21 Jan 2019 04:12:19 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39833 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727229AbfAUJMS (ORCPT ); Mon, 21 Jan 2019 04:12:18 -0500 Received: by mail-lf1-f68.google.com with SMTP id n18so14920824lfh.6 for ; Mon, 21 Jan 2019 01:12:17 -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=Um6LelattwCcSWENhGPP2goGHhRfdc018uwfh2i6YoE=; b=dqJklgqSRLyNs181li/Gxdjle9xjnnbPOZjdL2y7QhOTxBghh0T2T5bFjV6fMA5/8h tNj7PRFrR1FKxG8tseKRcqGWIPX+c0aECOvGuAjtFhmSS1PRILRtDRdg+koB1uQhtk7S 61x228MoOPiAMQXJ0BOjZf7IJ1Lw4GOE/fK5c= 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=Um6LelattwCcSWENhGPP2goGHhRfdc018uwfh2i6YoE=; b=Opem4n0uw8tys5W7K72DHEUV/O9Zw5yU/eLtRTjusxrRZ3reEBEFho1rWvH+HdBJYU +xxNPOEVhyxiRguZKu96CqqPx4jC72w2jKP6g0dEKpqHrKAxQZfUQyTBAzwUPoky0K7g 8CplmQsMUtxr4QNuWd5/Ly9VQG7J2c7CFX2dkaaCjiG8wKZJ2ElRyipK2k0StbWxDSSe ZjTcgiioI514wUJIRDKW/S4IarSFDRbO93w2FWBim3LmayE7Ro/TxeeX+Xa/wdgcxdJU 0fzjz4SJql1ZW//qWqi5IeEN37q+F3MZsD1tdgj0MMqMyLkj1CwFo4h6hcRUzsUVxwBN 8meQ== X-Gm-Message-State: AJcUukdl+EN4my7RZ8/VT4vggV2oqQV2iHd+swphOUjrEpbiR4X6TyWd o7bv3BY1I+hcZA4O9hfxXT6B5A== X-Received: by 2002:a19:645b:: with SMTP id b27mr17451096lfj.14.1548061936019; Mon, 21 Jan 2019 01:12:16 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j18-v6sm2131789ljc.52.2019.01.21.01.12.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 01:12:14 -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 v9] regulator: fixed/gpio: Update device tree bindings Date: Mon, 21 Jan 2019 10:12:04 +0100 Message-Id: <20190121091206.18239-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121091206.18239-1-linus.walleij@linaro.org> References: <20190121091206.18239-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 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.