From patchwork Tue Oct 31 18:11:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10035089 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 2969F600C5 for ; Tue, 31 Oct 2017 18:11:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23DFC28047 for ; Tue, 31 Oct 2017 18:11:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1866328B61; Tue, 31 Oct 2017 18:11: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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A96228047 for ; Tue, 31 Oct 2017 18:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753670AbdJaSLp (ORCPT ); Tue, 31 Oct 2017 14:11:45 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:41718 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdJaSLo (ORCPT ); Tue, 31 Oct 2017 14:11:44 -0400 Received: from ayla.of.borg ([84.195.106.246]) by andre.telenet-ops.be with bizsmtp id UJBf1w01G5JzmfG01JBfor; Tue, 31 Oct 2017 19:11:43 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1e9b0l-0001Gg-LU; Tue, 31 Oct 2017 19:11:39 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1e9b0l-00059Q-HA; Tue, 31 Oct 2017 19:11:39 +0100 From: Geert Uytterhoeven To: "Rafael J . Wysocki" , Ulf Hansson , Kevin Hilman Cc: Simon Horman , Magnus Damm , Matthias Brugger , Heiko Stuebner , linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 4/5] [RFC] soc: rockchip: power-domain: Use GENPD_FLAG_ACTIVE_WAKEUP Date: Tue, 31 Oct 2017 19:11:33 +0100 Message-Id: <1509473494-19740-5-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509473494-19740-1-git-send-email-geert+renesas@glider.be> References: <1509473494-19740-1-git-send-email-geert+renesas@glider.be> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set the newly introduced GENPD_FLAG_ACTIVE_WAKEUP, which allows to remove the driver's own flag-based callback. Signed-off-by: Geert Uytterhoeven Acked-by: Heiko Stuebner --- This must not be applied before "PM / Domain: Enable genpd users to specify default active wakeup behavior" has landed upstream, hence the "RFC". Compile-tested only. v2: - New. --- drivers/soc/rockchip/pm_domains.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 40b75748835f552c..5c342167b9db7a16 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -358,17 +358,6 @@ static void rockchip_pd_detach_dev(struct generic_pm_domain *genpd, pm_clk_destroy(dev); } -static bool rockchip_active_wakeup(struct device *dev) -{ - struct generic_pm_domain *genpd; - struct rockchip_pm_domain *pd; - - genpd = pd_to_genpd(dev->pm_domain); - pd = container_of(genpd, struct rockchip_pm_domain, genpd); - - return pd->info->active_wakeup; -} - static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, struct device_node *node) { @@ -489,8 +478,9 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, pd->genpd.power_on = rockchip_pd_power_on; pd->genpd.attach_dev = rockchip_pd_attach_dev; pd->genpd.detach_dev = rockchip_pd_detach_dev; - pd->genpd.dev_ops.active_wakeup = rockchip_active_wakeup; pd->genpd.flags = GENPD_FLAG_PM_CLK; + if (pd_info->active_wakeup) + pd->genpd.flags |= GENPD_FLAG_ACTIVE_WAKEUP; pm_genpd_init(&pd->genpd, NULL, false); pmu->genpd_data.domains[id] = &pd->genpd;