From patchwork Thu Apr 30 10:55: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: 6301771 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 B2127BEEE1 for ; Thu, 30 Apr 2015 10:57:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4CE7201EF for ; Thu, 30 Apr 2015 10:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3FEA201F4 for ; Thu, 30 Apr 2015 10:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbbD3K5L (ORCPT ); Thu, 30 Apr 2015 06:57:11 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:34077 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbbD3K5G (ORCPT ); Thu, 30 Apr 2015 06:57:06 -0400 Received: by wgso17 with SMTP id o17so57931888wgs.1 for ; Thu, 30 Apr 2015 03:57:05 -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=WIN3r/hWyKPSJCk8rKK2Ou2Ii3bofq7Bu654EFbzMQY=; b=NBCsH6gc6snUF4p6QT8YLfZfGbSg3cGEV9oOEalCO9Jw+tBqH/y+wT5+8iCYEdpxEj 1I4xcNJwTGMorGGbteGmu4+XfkECcXpFbgQ+jq/KzDSTF2Duy8E5QMsTYIJNSWoyXZ+4 ZGDtbB5L78bEYjlygqb6IcelGvu2UmytucekJntAR30XjTIH6QnPMEe050/IK9TEkH8q VqlgFCojSeqL3hVUGew0I04SQHlI9fnq7FIa17qZ9aStDArwwny/rIVMfcBapI2mn61y H5vWkBa1STmW/x0yUqUvktaDTvR3JN2mwFOVMwQ5X8emOXXtP6goig2yi0No1DBj4orz l4Vw== X-Gm-Message-State: ALoCoQkqbLn+XiBbb0AYoYV4B1BnHr0an9+/68SJiWNLu1AXEVyH5WlV0vKp9inTU8y/BzJqHyeu X-Received: by 10.180.94.168 with SMTP id dd8mr4375202wib.76.1430391425487; Thu, 30 Apr 2015 03:57:05 -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 ha4sm1922482wib.0.2015.04.30.03.57.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Apr 2015 03:57:04 -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 v7 4/5] ARM: imx6: pm: declare pm domain latency on power_state struct. Date: Thu, 30 Apr 2015 12:55:34 +0200 Message-Id: <1430391335-7588-5-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430391335-7588-1-git-send-email-ahaslam@baylibre.com> References: <1430391335-7588-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..9329ed2 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; @@ -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);