From patchwork Tue Nov 25 12:28:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 5378321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20E69C11AC for ; Tue, 25 Nov 2014 12:31:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37D2620142 for ; Tue, 25 Nov 2014 12:31:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51EEF200D9 for ; Tue, 25 Nov 2014 12:31:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtFFc-0005rt-8P; Tue, 25 Nov 2014 12:29:48 +0000 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtFEn-0005Jz-SX for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 12:29:00 +0000 Received: by mail-wg0-f49.google.com with SMTP id x12so708528wgg.8 for ; Tue, 25 Nov 2014 04:28:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=38LFkGd5oasnXQC7vVSv1a//kg97O8qv0/yj3oDdpzU=; b=nprSPeFmNwQ4CNkqSNwE3D1vJoIeRB5AsjBXB1HojrTLCk3qx1TorYED+zAIdu5utF tOSpAyyX0xzHnAg/tqcQtVATZWdq+ZfmQ0JEbMM/K4wSEG0wL+DQyQfRftSRQmquh753 nxcYL76gB6Ufv0GuRsHg9OQAxyezk+/b+1HH7rrVFU6Rw1/0tOCDp9MUFwAfcmBbOVuZ 52ziBN8py2P71fhK9/PsBGCkSo072wul4AgEQqa5s4dnV8ELSjcte6GBnq8zbqHjYe47 gcS4n/G0kjpZzoA4M+li/mmN7t6M78UL/BqOsILWhlfvxqIRjT75IyyZv16Wf6LQrSsv 02kA== X-Received: by 10.181.28.3 with SMTP id jk3mr10026746wid.14.1416918513934; Tue, 25 Nov 2014 04:28:33 -0800 (PST) Received: from localhost.localdomain (AToulouse-554-1-130-34.w90-60.abo.wanadoo.fr. [90.60.105.34]) by mx.google.com with ESMTPSA id s9sm2625598wiz.12.2014.11.25.04.28.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Nov 2014 04:28:33 -0800 (PST) From: Romain Perier To: heiko@sntech.de Subject: [PATCH v5 1/2] of: Rename "poweroff-source" property to "system-power-controller" Date: Tue, 25 Nov 2014 12:28:25 +0000 Message-Id: <1416918506-9366-2-git-send-email-romain.perier@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416918506-9366-1-git-send-email-romain.perier@gmail.com> References: <1416918506-9366-1-git-send-email-romain.perier@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141125_042858_158404_333AD5D6 X-CRM114-Status: GOOD ( 14.92 ) X-Spam-Score: -0.8 (/) Cc: mark.rutland@arm.com, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, johan@kernel.org, balbi@ti.com, lgirdwood@gmail.com, broonie@kernel.org, grant.likely@linaro.org, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which checks if this property is set. Signed-off-by: Romain Perier Acked-by: Johan Hovold Acked-by: Grant Likely --- .../bindings/power/{poweroff.txt => power-controller.txt} | 0 Documentation/devicetree/bindings/regulator/act8865-regulator.txt | 4 ++-- drivers/regulator/act8865-regulator.c | 2 +- include/linux/of.h | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename Documentation/devicetree/bindings/power/{poweroff.txt => power-controller.txt} (100%) diff --git a/Documentation/devicetree/bindings/power/poweroff.txt b/Documentation/devicetree/bindings/power/power-controller.txt similarity index 100% rename from Documentation/devicetree/bindings/power/poweroff.txt rename to Documentation/devicetree/bindings/power/power-controller.txt diff --git a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt index 01a5b07..dad6358 100644 --- a/Documentation/devicetree/bindings/regulator/act8865-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/act8865-regulator.txt @@ -6,8 +6,8 @@ Required properties: - reg: I2C slave address Optional properties: -- poweroff-source: Telling whether or not this pmic is controlling - the system power. See Documentation/devicetree/bindings/power/poweroff.txt . +- system-power-controller: Telling whether or not this pmic is controlling + the system power. See Documentation/devicetree/bindings/power/power-controller.txt . Any standard regulator properties can be used to configure the single regulator. diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index 76301ed..9eec453 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c @@ -365,7 +365,7 @@ static int act8865_pmic_probe(struct i2c_client *client, return ret; } - if (of_system_has_poweroff_source(dev->of_node)) { + if (of_device_is_system_power_controller(dev->of_node)) { if (!pm_power_off) { act8865_i2c_client = client; act8865->off_reg = off_reg; diff --git a/include/linux/of.h b/include/linux/of.h index b81dbcf..0abdd70 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -964,14 +964,14 @@ static inline int of_changeset_update_property(struct of_changeset *ocs, extern int of_resolve_phandles(struct device_node *tree); /** - * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node + * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node * @np: Pointer to the given device_node * * return true if present false otherwise */ -static inline bool of_system_has_poweroff_source(const struct device_node *np) +static inline bool of_device_is_system_power_controller(const struct device_node *np) { - return of_property_read_bool(np, "poweroff-source"); + return of_property_read_bool(np, "system-power-controller"); } #endif /* _LINUX_OF_H */