From patchwork Thu Nov 6 14:23:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 5243211 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 817ECC11AC for ; Thu, 6 Nov 2014 14:26:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 804DD200FE for ; Thu, 6 Nov 2014 14:26:30 +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 729C0200DC for ; Thu, 6 Nov 2014 14:26:29 +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 1XmNyV-0007oZ-9d; Thu, 06 Nov 2014 14:23:47 +0000 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XmNuw-0002wK-VD for linux-arm-kernel@lists.infradead.org; Thu, 06 Nov 2014 14:20:08 +0000 Received: by mail-wg0-f43.google.com with SMTP id y10so1328057wgg.2 for ; Thu, 06 Nov 2014 06:19:44 -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=rP9OeDqXAX2kpCc+lNYVj6mEt/PTm1oaS/ML7FB7dOw=; b=Z7IbNoDXP3yRaxGREuq0r/XhIUc4YfbrKIP7WbPlRJvJNG20GvIiAazQQWt0CbesEa nF6XKvQ0vAc9fsl9GiPOvQ9QLGPcQKIoq/1tVLKgyRSwMbuSCezYmaXbsj5P7LSVXyIe QIcrEIe8UevobGKZtTZRaSt+TQNp2NztXz8x9xMw5HArEtDx5xTCKBmvwFGPz6yw0KwQ 6tOGp4REdmyRVMkO8iywdNHQUFUAbjV+bP5LZ9IupZrmfa7H+c9rer7SOYiZNn+X26df otGOVwaL1Dmrd08v5XBm3mb+84I1Sl2L4irl8/jmRJZPWXfXwGP4teprDzTmNxGzDoxX 7ajw== X-Received: by 10.194.219.138 with SMTP id po10mr6079935wjc.62.1415283584908; Thu, 06 Nov 2014 06:19:44 -0800 (PST) Received: from localhost.localdomain (AToulouse-554-1-154-42.w86-213.abo.wanadoo.fr. [86.213.97.42]) by mx.google.com with ESMTPSA id fa7sm7986138wjd.27.2014.11.06.06.19.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Nov 2014 06:19:44 -0800 (PST) From: Romain Perier To: heiko@sntech.de Subject: [PATCH v3 1/2] of: Rename "poweroff-source" property to "system-power-controller" Date: Thu, 6 Nov 2014 14:23:02 +0000 Message-Id: <1415283784-10885-2-git-send-email-romain.perier@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415283784-10885-1-git-send-email-romain.perier@gmail.com> References: <1415283784-10885-1-git-send-email-romain.perier@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141106_062007_187230_AFA395E4 X-CRM114-Status: GOOD ( 16.36 ) X-Spam-Score: -0.8 (/) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, robh+dt@kernel.org, johan@kernel.org, broonie@kernel.org, balbi@ti.com, grant.likely@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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix. Signed-off-by: Romain Perier --- .../bindings/power/{poweroff.txt => power-controller.txt} | 0 Documentation/devicetree/bindings/regulator/act8865-regulator.txt | 4 ++-- drivers/mfd/tps65910.c | 2 +- drivers/regulator/act8865-regulator.c | 2 +- include/linux/of.h | 8 +++++--- 5 files changed, 9 insertions(+), 7 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/mfd/tps65910.c b/drivers/mfd/tps65910.c index b8dca8a..77a7f78 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c @@ -423,7 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, board_info->irq = client->irq; board_info->irq_base = -1; - board_info->pm_off = of_system_has_poweroff_source(np); + board_info->pm_off = of_is_system_power_controller(np); return board_info; } diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index 76301ed..435aba1 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_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 868fdad..f3595ba 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -911,14 +911,16 @@ 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_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_is_system_power_controller(const struct device_node *np) { - return of_property_read_bool(np, "poweroff-source"); + if (of_property_read_bool(np, "system-power-controller")) + return true; + return of_property_read_bool(np, "ti,system-power-controller"); } #endif /* _LINUX_OF_H */