From patchwork Mon Dec 1 17:03:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 5414401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 924399F1CD for ; Mon, 1 Dec 2014 17:07:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3887920265 for ; Mon, 1 Dec 2014 17:07:29 +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 62C51201F2 for ; Mon, 1 Dec 2014 17:07:28 +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 1XvUOQ-0006B2-Tf; Mon, 01 Dec 2014 17:04:10 +0000 Received: from mail.kmu-office.ch ([178.209.48.109]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XvUO5-0005gc-Co for linux-arm-kernel@lists.infradead.org; Mon, 01 Dec 2014 17:03:50 +0000 Received: from trochilidae.toradex.int (unknown [46.140.72.82]) by mail.kmu-office.ch (Postfix) with ESMTPSA id D4CF75E358E; Mon, 1 Dec 2014 18:02:51 +0100 (CET) From: Stefan Agner To: shawn.guo@linaro.org, kernel@pengutronix.de, linux@roeck-us.net, arnd@arndb.de, sre@kernel.org, fkan@apm.com, grant.likely@linaro.org, robh+dt@kernel.org Subject: [PATCH v2 1/3] power: reset: read priority from device tree Date: Mon, 1 Dec 2014 18:03:07 +0100 Message-Id: <1417453389-1588-2-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1417453389-1588-1-git-send-email-stefan@agner.ch> References: <1417453389-1588-1-git-send-email-stefan@agner.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141201_090349_625148_969301F2 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) Cc: devicetree@vger.kernel.org, dbaryshkov@gmail.com, linux-kernel@vger.kernel.org, stefan@agner.ch, dwmw2@infradead.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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 This patch adds an optional property which allows to specify the reset source priority. This priority is used by the kernel restart handler call chain to sort out the proper reset/restart method. Depending on the power design of a board or other machine/board specific peculiarity, it is not possible to pick a generic priority. Signed-off-by: Stefan Agner --- Documentation/devicetree/bindings/power/reset/syscon-reboot.txt | 3 +++ drivers/power/reset/syscon-reboot.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt index 1190631..ee41d9c 100644 --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt @@ -11,6 +11,9 @@ Required properties: - offset: offset in the register map for the reboot register (in bytes) - mask: the reset value written to the reboot register (32 bit access) +Optional properties: +- priority: define the priority of the reset (0-255, defaults to 128) + Default will be little endian mode, 32 bit access only. Examples: diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c index 815b901..3060d6b 100644 --- a/drivers/power/reset/syscon-reboot.c +++ b/drivers/power/reset/syscon-reboot.c @@ -67,8 +67,11 @@ static int syscon_reboot_probe(struct platform_device *pdev) if (of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask)) return -EINVAL; - ctx->restart_handler.notifier_call = syscon_restart_handle; ctx->restart_handler.priority = 128; + of_property_read_u32(pdev->dev.of_node, "priority", + &ctx->restart_handler.priority); + + ctx->restart_handler.notifier_call = syscon_restart_handle; err = register_restart_handler(&ctx->restart_handler); if (err) dev_err(dev, "can't register restart notifier (err=%d)\n", err);