From patchwork Thu Oct 15 12:16:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Haslam X-Patchwork-Id: 7405491 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3F5CBEEA4 for ; Thu, 15 Oct 2015 12:17:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 269442087F for ; Thu, 15 Oct 2015 12:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3436720850 for ; Thu, 15 Oct 2015 12:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752897AbbJOMQ4 (ORCPT ); Thu, 15 Oct 2015 08:16:56 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:34632 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbbJOMQy (ORCPT ); Thu, 15 Oct 2015 08:16:54 -0400 Received: by wicgb1 with SMTP id gb1so25571761wic.1 for ; Thu, 15 Oct 2015 05:16:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BvqZlGTyn/j8caQg0Qnnq2bPawrSYH/wbd6Wk8Hwx8Y=; b=aYp0ACm+1Wp0XF5jasvfxihStEb6IIbsmM+Mgiz56M0h+fVGWhvE51cfP+ShQCIXg5 s9prH9AaxmN8TD7BvLD9ruhxl8zdyi0p//i2vGuhto+Am7Ppfm2+2RNwLj2OpKvEC0iy lNe9BNuuuEXGPTWNsJDX9x0wJ9yZAbI2l9R7oznobg3x/wXEZFP2YrNAimPWRNz4iENv rM+lTdHtcsdp0i4aK1AVApXyzo1BfSATrbh5VjuKX9ID+KDzjmU+R+jmfG5aTxqFxAs0 4qVuwNXtEO5CZFZyI0S/LYGud/SuCGYWPBuiIwo0HglgrMu8msfluy/YbzMl20+vSBIB QJfA== X-Gm-Message-State: ALoCoQlgBXP0DABrttRE2t2DMWBPCYn3yRVGD6nTbt6r47QLp4Dtfbv2td2dMEuwlYbGcweva7Jx X-Received: by 10.180.73.46 with SMTP id i14mr9958692wiv.49.1444911413337; Thu, 15 Oct 2015 05:16:53 -0700 (PDT) Received: from localhost.localdomain (cag06-6-78-235-100-105.fbx.proxad.net. [78.235.100.105]) by smtp.gmail.com with ESMTPSA id p2sm16156948wjb.21.2015.10.15.05.16.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Oct 2015 05:16:52 -0700 (PDT) From: ahaslam@baylibre.com To: khilman@linaro.org, ulf.hansson@linaro.org, lina.iyer@linaro.org, geert@glider.be, k.kozlowski.k@gmail.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org Cc: bcousson@baylibre.com, mturquette@baylibre.com, Axel Haslam Subject: [PATCH v8 4/6] ARM: imx6: pm: declare pm domain latency on power_state struct. Date: Thu, 15 Oct 2015 14:16:34 +0200 Message-Id: <1444911396-3473-5-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1444911396-3473-1-git-send-email-ahaslam@baylibre.com> References: <1444911396-3473-1-git-send-email-ahaslam@baylibre.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Axel Haslam The generic_pm_domain structure uses an array of latencies to be able to declare multiple intermediate states. Declare a single "OFF" state with the default latencies So that the power_off_latency_ns and power_on_latency_ns fields of generic_pm_domain structure can be eventualy removed. Signed-off-by: Axel Haslam --- arch/arm/mach-imx/gpc.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index 76658f8..367a00c 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -45,9 +45,11 @@ struct pu_domain { struct generic_pm_domain base; + struct genpd_power_state *states; struct regulator *reg; struct clk *clk[GPC_CLK_MAX]; int num_clks; + unsigned int num_states; }; static void __iomem *gpc_base; @@ -369,14 +371,22 @@ static struct generic_pm_domain imx6q_arm_domain = { .name = "ARM", }; +static struct genpd_power_state imx6q_arm_domain_states[] = { + { + .name = "OFF", + .power_off_latency_ns = 25000, + .power_on_latency_ns = 2000000, + }, +}; + static struct pu_domain imx6q_pu_domain = { .base = { .name = "PU", .power_off = imx6q_pm_pu_power_off, .power_on = imx6q_pm_pu_power_on, - .power_off_latency_ns = 25000, - .power_on_latency_ns = 2000000, }, + .states = imx6q_arm_domain_states, + .num_states = ARRAY_SIZE(imx6q_arm_domain_states), }; static struct generic_pm_domain imx6sl_display_domain = { @@ -419,7 +429,9 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg) if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) return 0; - pm_genpd_init_simple(&imx6q_pu_domain.base, NULL, false); + pm_genpd_init(&imx6q_pu_domain.base, NULL, imx6q_pu_domain.states, + imx6q_pu_domain.num_states, false); + return of_genpd_add_provider_onecell(dev->of_node, &imx_gpc_onecell_data);