From patchwork Sat Jan 11 19:42:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3469791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3787CC02DC for ; Sat, 11 Jan 2014 19:44:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BD9C20160 for ; Sat, 11 Jan 2014 19:44:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 642EB2015A for ; Sat, 11 Jan 2014 19:44:28 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W24TS-00016V-3V; Sat, 11 Jan 2014 19:44:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W24TL-0000VF-5w; Sat, 11 Jan 2014 19:43:55 +0000 Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W24T5-0000PF-Fa for linux-arm-kernel@lists.infradead.org; Sat, 11 Jan 2014 19:43:39 +0000 Received: by mail-ee0-f53.google.com with SMTP id b57so2466201eek.40 for ; Sat, 11 Jan 2014 11:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sBx/6VM83TXigpUy/zbcXDc07kc8X5n6dio3SShTx9I=; b=W7EsbkTAUV3MZDbE2oyseJv0n501VNUbvWw4IfI7Z74ful19JUR1i7ttTykYnztvjf lW6zEk6abobFjEbJHV8/zMnIdO7pXLaTJLbBgA/aw1Z/dSD1iEVBrJAQKKuR8l3sZbNQ DL3ZobObo9dsqH6w2mzoln/7LB9L8AtUCxYQQRZbcyB7bnMeGR0DtvHLS80IgLaTzMuu ZygMpYn46KZflf6lMVXjg2rfUeO1qo2lLC7MLSzubM2Ao61ehKuMqjp2IlwuNNZFocOJ kgOI1H+SP1LrqFHwW4cmb9xc+wDpg+gA+xLUwwDqtibRwfBFPjpWxW7sTu2V6NwXiueb HVuA== X-Received: by 10.15.83.8 with SMTP id b8mr17783459eez.6.1389469395010; Sat, 11 Jan 2014 11:43:15 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id e3sm25312484eeg.11.2014.01.11.11.43.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jan 2014 11:43:14 -0800 (PST) From: Tomasz Figa To: linux-pm@vger.kernel.org Subject: [PATCH RFC 02/10] ARM: s3c64xx: pm: Add always_on field to s3c64xx_pm_domain struct Date: Sat, 11 Jan 2014 20:42:44 +0100 Message-Id: <1389469372-17199-3-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389469372-17199-1-git-send-email-tomasz.figa@gmail.com> References: <1389469372-17199-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140111_144339_632360_25386F3D X-CRM114-Status: GOOD ( 12.29 ) X-Spam-Score: -2.0 (--) Cc: Mark Rutland , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Russell King , Pawel Moll , Len Brown , Greg Kroah-Hartman , Tomasz Figa , Ian Campbell , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Rob Herring , Tomasz Figa , Bartlomiej Zolnierkiewicz , Kukjin Kim , Pavel Machek , Kumar Gala , Stephen Warren , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This patch adds always_on field to s3c64xx_pm_domain struct to allow handling registration of all domains in the same way, without the need to have separate arrays for normal and always on domains. Signed-off-by: Tomasz Figa --- arch/arm/mach-s3c64xx/pm.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index 5238d66..605bfa9 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c @@ -35,6 +35,7 @@ #include "regs-syscon-power.h" struct s3c64xx_pm_domain { + bool always_on; u32 ena; u32 pwr_stat; struct generic_pm_domain pd; @@ -84,6 +85,7 @@ static int s3c64xx_pd_on(struct generic_pm_domain *domain) } static struct s3c64xx_pm_domain s3c64xx_pm_irom = { + .always_on = true, .ena = S3C64XX_NORMALCFG_IROM_ON, .pd = { .name = "domain_irom", @@ -161,11 +163,8 @@ static struct s3c64xx_pm_domain s3c64xx_pm_v = { }, }; -static struct s3c64xx_pm_domain *s3c64xx_always_on_pm_domains[] = { - &s3c64xx_pm_irom, -}; - static struct s3c64xx_pm_domain *s3c64xx_pm_domains[] = { + &s3c64xx_pm_irom, &s3c64xx_pm_etm, &s3c64xx_pm_g, &s3c64xx_pm_v, @@ -311,12 +310,16 @@ int __init s3c64xx_pm_init(void) s3c_pm_init(); - for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++) - pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd, - &pm_domain_always_on_gov, false); - for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++) - pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false); + for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++) { + struct s3c64xx_pm_domain *pd = s3c64xx_pm_domains[i]; + struct dev_power_governor *gov = NULL; + + if (pd->always_on) + gov = &pm_domain_always_on_gov; + + pm_genpd_init(&pd->pd, gov, false); + } #ifdef CONFIG_S3C_DEV_FB if (dev_get_platdata(&s3c_device_fb.dev))