From patchwork Mon Jul 31 05:49:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9870927 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 F0ECA60375 for ; Mon, 31 Jul 2017 05:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E12422855E for ; Mon, 31 Jul 2017 05:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5E5C28563; Mon, 31 Jul 2017 05:50:48 +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 ABCF22855E for ; Mon, 31 Jul 2017 05:50:47 +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=5y4l0tUCs1vwiN7x6UgSwbAk+nW6SK9uUMhBGzPSNEU=; b=ETT ezOeVKX2pq/5C1v+q5I4RuhtgjoNFKU9KwMaIvJi3hq3wRp+8yetX3KuOphL0A1srxMic91mnFTcJ zaPQ2QeWOWYK32/z20+Fy/nhDY3qnqHsJn4Pwzyy4fyC/EZKWjFzQL4MwIHGAdM0s1eC4WxVsPMvT SAr6Zw2atw0e41/WS7rt56hf1JC02VQbs4RBsBVHZIPRzRgSZyde5r/cVfZ0ns4XY4HrQJi+0p4fn 3SeRNf2QEBIcGVRVSH+i64FBPG02Qa2Uy1cfah/piu8wZb2mIlELWRY5hjI3IZ/b8IM9pVuKzGCRw wd3kLnO9zMnzMoHPBGlcEQQRuGj3M/Q==; 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 1dc3bG-0007G3-1h; Mon, 31 Jul 2017 05:50:42 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dc3bC-000643-Pb for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2017 05:50:40 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id v6V5nShD031668; Mon, 31 Jul 2017 14:49:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v6V5nShD031668 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1501480169; bh=KUmzvklMpavzvFEH880OfiVS80O3to4YUz1eCt2KlK8=; h=From:To:Cc:Subject:Date:From; b=JoLgJCGn+p2+8JmwUgqE79orf23CLUoRN+4JcKXDlhuEv071zna6ukNf3vJZBnWOE 0OvSldTL3hgLhfWLEqymLRpzGZsQXUMeD/FZSkbgLzTYbtdr3hxUvv9IOwqOJdrHwt 83ZUI/KXQLYAEZd9WFGVDMJ71QP5Net0NlBNiBAdGmfwV4Fuw+gwPhjfrKqhT6cD3n egwQkLcYk+GmllhFlEC4zcHLd2erqcdhjP462Qiix4L+ZSQ2g3fj52cV/E4kcLx3zn NrFJOx+b0G1+uFFrBPI5TkPGq0MTmXEI2K93nfaKmApXwX3xv8bA3C47/GsVWrSwY/ lrOf8eJXfnWZQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: arm@kernel.org Subject: [PATCH v2] bus: uniphier-system-bus: set up registers when resuming Date: Mon, 31 Jul 2017 14:49:25 +0900 Message-Id: <1501480165-10527-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_225039_093170_C58AB03A X-CRM114-Status: UNSURE ( 9.02 ) 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 --- Changes in v2: - Fix define but not used warning 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..f76be6bd6eb3 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 __maybe_unused 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);