From patchwork Mon Jul 31 04:53:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9870855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC86C6037D for ; Mon, 31 Jul 2017 04:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB0DC28545 for ; Mon, 31 Jul 2017 04:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE1AD28595; Mon, 31 Jul 2017 04:55:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50D7328545 for ; Mon, 31 Jul 2017 04:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=nU7ejDPtUrlipfgEITHSqsVmzlkzeckXKCiE2vNAxo8=; b=bVi 1lF5XrGhA1hLLynZTSd9yyFwCOh9ex+zVOuuWlC1ZnhnvXpqGee8ngO/QlTX7eYpAoWmDC2vaSY4g XHEcyNODjiT8Uv859l8fVoVAE4gjIFabC+ZKEglMlv9249zD1reulEcYaaklPVcntDpWWd05klxwL pVSeIxBhHTJ7KcsJKx3hOM+3tDbYsK7p3m95/prX826ockFduNQKd9Y6UYa/fRiE9OxhuzeZOI7O1 5T7bB+wSJ+zA36rpTCjOtPGeJ5hGDxW88qF0N4jhPlqKLCr8mhY82+KRlrT36Rmfo8ls6xSN+58Sc 758OChJBHHs255XIXoPUioMut3vviug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dc2jH-0006QC-FU; Mon, 31 Jul 2017 04:54:55 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dc2jE-0006PV-HG for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2017 04:54:54 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id v6V4rl8c021949; Mon, 31 Jul 2017 13:53:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v6V4rl8c021949 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1501476828; bh=SwjPsGzr+5ducZCigjgV8fO+fEe1EmJOaHwBgH22ivM=; h=From:To:Cc:Subject:Date:From; b=zXeBDG70vmoKk1QB67m3zJfBLXg1F8oTzc/TcfSFfowvVmV5QeKJpygSK3kO/V2Yz wIlKaR3dA7Dg35OubBW6QSsRqG8YjX7gqrrBSu3LrpcMLQBqHMq6Vc/pXQou/LcL0C iDEdBzF0+Lm+HOP45a5lSkeNGOS+NaXUwNmw/oPWtx7JZ+7S1fqasfvmxzVyMUlO10 WJeFLHZQU7t5RfNcL5QJ6Tmfcqr6/mbJFiJmcZ+KlAxSQ2Dr+GMbTOTQaQnBm5F7sT 5rF9ueiQXyTRAMwoGY2zqj807ZwP/ouOEAolZDHBANputVy3+6nBBNu2VX3oJ9QLsC vCEza2Y3KppSA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: arm@kernel.org Subject: [PATCH] bus: uniphier-system-bus: set up registers when resuming Date: Mon, 31 Jul 2017 13:53:42 +0900 Message-Id: <1501476822-18679-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170730_215452_803289_5B80C713 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Masahiro Yamada , linux-kernel@vger.kernel.org, Jassi Brar , Masami Hiramatsu , Olof Johansson , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When resuming, set up registers that have been lost in the sleep state. Signed-off-by: Masahiro Yamada --- drivers/bus/uniphier-system-bus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/bus/uniphier-system-bus.c b/drivers/bus/uniphier-system-bus.c index 1e6e0269edcc..f9c334159e83 100644 --- a/drivers/bus/uniphier-system-bus.c +++ b/drivers/bus/uniphier-system-bus.c @@ -256,10 +256,23 @@ static int uniphier_system_bus_probe(struct platform_device *pdev) uniphier_system_bus_set_reg(priv); + platform_set_drvdata(pdev, priv); + /* Now, the bus is configured. Populate platform_devices below it */ return of_platform_default_populate(dev->of_node, NULL, dev); } +static int uniphier_system_bus_resume(struct device *dev) +{ + uniphier_system_bus_set_reg(dev_get_drvdata(dev)); + + return 0; +} + +static const struct dev_pm_ops uniphier_system_bus_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, uniphier_system_bus_resume) +}; + static const struct of_device_id uniphier_system_bus_match[] = { { .compatible = "socionext,uniphier-system-bus" }, { /* sentinel */ } @@ -271,6 +284,7 @@ static struct platform_driver uniphier_system_bus_driver = { .driver = { .name = "uniphier-system-bus", .of_match_table = uniphier_system_bus_match, + .pm = &uniphier_system_bus_pm_ops, }, }; module_platform_driver(uniphier_system_bus_driver);