From patchwork Tue Oct 20 13:26:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Haslam X-Patchwork-Id: 7447411 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 8EFC9BEEA4 for ; Tue, 20 Oct 2015 13:27:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97FDF20865 for ; Tue, 20 Oct 2015 13:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD1FF2073A for ; Tue, 20 Oct 2015 13:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbbJTN0x (ORCPT ); Tue, 20 Oct 2015 09:26:53 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36002 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752837AbbJTN0s (ORCPT ); Tue, 20 Oct 2015 09:26:48 -0400 Received: by wicfx6 with SMTP id fx6so45648591wic.1 for ; Tue, 20 Oct 2015 06:26:47 -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=zpKEeprz3izk8Ye3BL5dIAEx6gVyU2W0cyz7c4XcgfY=; b=MfIFe6QEBRTeMndjCBS0/siLLYMcZhk8jK0N1R9+cNTpcPFfZ8M0WnlGz+Jz/J50Q3 DgWT5xpy+eXCDZRlV0/xoAO+geVFU7E9UbHgD0tLwqBXLjcA3SX9vPMwn+VzH5UZI03w eh+tsYRim6xn6ppWon96jz3ieqtDjSQoNGnUgZ4FiXBnSb/+NB3+Qt4N/11qoDsCKYAD tK5J3bb6r4Wwzk6w6UEqu8zrQJdbEyfNoSWEA8PjvcUcwhmroBr5zhbCyiCTQQ2MVQGl AmqPqmMWPu2STTG/BS69b0PypGm7/BXykyg2kiLGqilcqxIZVM7GO9n1ShlNg3X11HuX jTyQ== X-Gm-Message-State: ALoCoQnKxjGx/Z+MTNRPzGGDZGqzD52RIUdCUBeqBxqowgYHwhGAPBwxWcf9qUUB6F9vuklKKs4V X-Received: by 10.194.192.6 with SMTP id hc6mr4121250wjc.33.1445347607494; Tue, 20 Oct 2015 06:26:47 -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 uq5sm3905098wjc.3.2015.10.20.06.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 06:26:46 -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, linux-kernel@vger.kernel.org Cc: bcousson@baylibre.com, mturquette@baylibre.com, Axel Haslam Subject: [PATCH v10 4/6] ARM: imx6: pm: declare pm domain latency on power_state struct. Date: Tue, 20 Oct 2015 15:26:27 +0200 Message-Id: <1445347589-5626-5-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1445347589-5626-1-git-send-email-ahaslam@baylibre.com> References: <1445347589-5626-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, 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 aefe92d..7b839b3 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; @@ -372,14 +374,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 = { @@ -422,7 +432,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);