From patchwork Mon Mar 3 16:02:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3755311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 014A19F38E for ; Mon, 3 Mar 2014 16:04:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26E13203DF for ; Mon, 3 Mar 2014 16:04:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FA1320397 for ; Mon, 3 Mar 2014 16:04:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754862AbaCCQCr (ORCPT ); Mon, 3 Mar 2014 11:02:47 -0500 Received: from mail-ee0-f50.google.com ([74.125.83.50]:41145 "EHLO mail-ee0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754831AbaCCQCn (ORCPT ); Mon, 3 Mar 2014 11:02:43 -0500 Received: by mail-ee0-f50.google.com with SMTP id c13so2188861eek.37 for ; Mon, 03 Mar 2014 08:02:42 -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=Pch1p+w8SDAm/29pA4A8dxWcvBdO8QJpwNkmzYO3p+o=; b=jtMcIkkXFU1lEDkO+IhTExceWlx/2jGufOoWOJYBA8Cf15bITxR9tZTc3EQFKVjKII MNHpCrEfS2/SVuC71S/Q/042ic/G7ffybpHQ5WtN0dnwm1SeBbKGnvEo0/dAZlnToSwV bklxXIrHY2vFX4AW6KR7akgjzWpVto8nE6RUDvsvfe6lytajhN7JykO7hVzBC3XGDXv8 tiFlPgwseBOYvvro/sk4pfnldwzVE3XQ2E9d9KG/nUox0rP5aGgqrCACR+E8TW6ILf8t eJvjVLWCdcQ2Rbtkx3xFa0SCRrEiFyt2PHIuFlYptbW74wYGPgnic7u1aIz64Vyndf6L cWCA== X-Received: by 10.14.106.193 with SMTP id m41mr40597774eeg.62.1393862562269; Mon, 03 Mar 2014 08:02:42 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id y51sm51430597eeu.0.2014.03.03.08.02.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Mar 2014 08:02:41 -0800 (PST) From: Tomasz Figa To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Russell King , Kukjin Kim , Kumar Gala , Ian Campbell , Mark Rutland , Pawel Moll , Rob Herring , Bartlomiej Zolnierkiewicz , Stephen Warren , Tomasz Figa , Mark Brown , Stephen Boyd , Lorenzo Pieralisi , Ulf Hansson , Marek Szyprowski , Tomasz Figa Subject: [PATCH v2 05/11] ARM: s3c64xx: pm: Add always_on field to s3c64xx_pm_domain struct Date: Mon, 3 Mar 2014 17:02:10 +0100 Message-Id: <1393862536-9842-6-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393862536-9842-1-git-send-email-tomasz.figa@gmail.com> References: <1393862536-9842-1-git-send-email-tomasz.figa@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, 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 df4b7b2..c930245 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c @@ -36,6 +36,7 @@ #include "regs-syscon-power.h" struct s3c64xx_pm_domain { + bool always_on; u32 ena; u32 pwr_stat; struct generic_pm_domain pd; @@ -85,6 +86,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 = "IROM", @@ -162,11 +164,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, @@ -312,12 +311,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))