From patchwork Wed Apr 29 19:10:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Haslam X-Patchwork-Id: 6297881 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E8AE59F389 for ; Wed, 29 Apr 2015 19:11:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D299B20122 for ; Wed, 29 Apr 2015 19:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F188E20172 for ; Wed, 29 Apr 2015 19:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbbD2TLY (ORCPT ); Wed, 29 Apr 2015 15:11:24 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35641 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833AbbD2TLX (ORCPT ); Wed, 29 Apr 2015 15:11:23 -0400 Received: by widdi4 with SMTP id di4so191850318wid.0 for ; Wed, 29 Apr 2015 12:11:22 -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=Kw/uNKEutpigZvBysl9lk7S8He7nUDF3tE1jNIqRazw=; b=az+7KcRv+JpZc5vF/Vqi9lO6grTtfR/vGuE4CBhpj+8iduDHkufLKvCmMsq7ac+1Or yavCnogeGfwTWpQPA1gz6aBRph5v0HFr6Ylu+yHjU3UkIeWSD/rNXY7fQ7cpp1n6ZDGO g1Lzsv9fUmEeMptFP52Xhi4cI7tOmDC29u/XazAmRq04gyifbjIg0XGzAdyR2L6szc7Q /K0WRkxhjPuXOy5PklbrBd5nPppLa/dF4f0k4wzKleMQKD+oINbOm+6uq4BVtGWFeC6r DsNoIaRr2xCS0MPFvf0PR0ApasEtCFV6QLgAYjiTBOJR12aav2BcMfnn15Q7cltKTB1D H0eA== X-Gm-Message-State: ALoCoQmoF+/9wEgMBVVGpK+R85vCrEyp73p9n2uqz1INVYH1OKIHnJo5zGQQFCmPhw5qgFzaSdZ5 X-Received: by 10.180.93.193 with SMTP id cw1mr11802411wib.12.1430334682804; Wed, 29 Apr 2015 12:11:22 -0700 (PDT) Received: from axelh-ThinkPad-T440s.home (LPoitiers-656-1-62-228.w90-63.abo.wanadoo.fr. [90.63.143.228]) by mx.google.com with ESMTPSA id be3sm418738wib.21.2015.04.29.12.11.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Apr 2015 12:11:22 -0700 (PDT) From: ahaslam@baylibre.com To: ulf.hansson@linaro.org, khilman@linaro.org, k.kozlowski.k@gmail.com, geert@linux-m68k.org, rjw@rjwysocki.net Cc: bcousson@baylibre.com, linux-pm@vger.kernel.org, Axel Haslam Subject: [PATCH/RFC v6 4/5] ARM: imx6: pm: declare pm domain latency on power_state struct. Date: Wed, 29 Apr 2015 21:10:14 +0200 Message-Id: <1430334615-1161-5-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430334615-1161-1-git-send-email-ahaslam@baylibre.com> References: <1430334615-1161-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=ham 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 092b4ae..4c0ca34 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; + int num_states; }; static void __iomem *gpc_base; @@ -365,14 +367,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 = { @@ -421,7 +431,9 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg) imx6q_pm_pu_power_on(&imx6q_pu_domain.base); } - pm_genpd_init(&imx6q_pu_domain.base, NULL, NULL, 0, is_off); + pm_genpd_init(&imx6q_pu_domain.base, NULL, imx6q_pu_domain.states, + imx6q_pu_domain.num_states, is_off); + return of_genpd_add_provider_onecell(dev->of_node, &imx_gpc_onecell_data);