From patchwork Mon Mar 31 15:15:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BCBC202E0 for ; Mon, 31 Mar 2014 15:17:29 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf12721186ykr.6 for ; Mon, 31 Mar 2014 08:17:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=NfaM7EpM4OiJw9AciiJFI6vzPe3W7PzF3nsZ8pRP4Bo=; b=V3l18vAvMpObGBUA8RlMuVsNKzGPdeSgW2kyAGnsYzdHzG/fXqIrOQv4P2nyVVvzyx 0KSzRJjIHk/kmr9XjteAZQG7YFhqVU2yX0LIHb38HE+OrXveRsOrwsgIKLJNobqezJfW cxHj7NBc8bO3O3Mrbla2q/ayuUHm7XXaxflDd3LxYLWWLZDPfZvPvI8TqqMePYB38LNw 0WStKoW+Mmhr5w61XdxDape6knpDy+4GIblHmY8VivVJsO+1ongHW3Rb42M4Zt3bOe+B 7qbJSS6bjy0tYZlqLvC+y3iSEn4WCZB7OsQIDUAlNlxZ+b0Zq2n5g/QmAtq+e8MXKz3j DRag== X-Gm-Message-State: ALoCoQlU0GKTfm+9MT5WdMg2ApbIj88roJ2A4It+2WPWWjKu4esiTD24cQDJfT7wNo9L07nQM2JX X-Received: by 10.224.167.8 with SMTP id o8mr10150563qay.0.1396279049107; Mon, 31 Mar 2014 08:17:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.70 with SMTP id 64ls154442qgy.48.gmail; Mon, 31 Mar 2014 08:17:29 -0700 (PDT) X-Received: by 10.52.65.132 with SMTP id x4mr407791vds.36.1396279048975; Mon, 31 Mar 2014 08:17:28 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id tx7si2920127vcb.116.2014.03.31.08.17.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:17:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so8685115vcb.0 for ; Mon, 31 Mar 2014 08:17:28 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr19656070vdc.1.1396279048868; Mon, 31 Mar 2014 08:17:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp150639vcv; Mon, 31 Mar 2014 08:17:28 -0700 (PDT) X-Received: by 10.68.164.229 with SMTP id yt5mr25853194pbb.28.1396279048152; Mon, 31 Mar 2014 08:17:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb4si4132536pbc.495.2014.03.31.08.17.26; Mon, 31 Mar 2014 08:17:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbaCaPRY (ORCPT + 5 others); Mon, 31 Mar 2014 11:17:24 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:39084 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbaCaPRX (ORCPT ); Mon, 31 Mar 2014 11:17:23 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2VFH1mJ004543; Mon, 31 Mar 2014 10:17:01 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFH1ic013494; Mon, 31 Mar 2014 10:17:01 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 31 Mar 2014 10:17:00 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFGm3r013169; Mon, 31 Mar 2014 10:16:59 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 06/55] ARM: OMAP3/4: PRM: add support of late_init call to prm_ll_ops Date: Mon, 31 Mar 2014 18:15:45 +0300 Message-ID: <1396278994-12624-7-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396278994-12624-1-git-send-email-t-kristo@ti.com> References: <1396278994-12624-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , SoC specific late_init call is now registered during PRM init, and will be called automatically by PRM core. This helps to get rid of some redundant initcalls and cpu_is_X checks from the PRM code. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/prm.h | 2 ++ arch/arm/mach-omap2/prm3xxx.c | 7 +++---- arch/arm/mach-omap2/prm44xx.c | 7 +++---- arch/arm/mach-omap2/prm_common.c | 8 ++++++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index 04426c4..48480d5 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h @@ -126,6 +126,7 @@ struct prm_reset_src_map { * @read_reset_sources: ptr to the SoC PRM-specific get_reset_source impl * @was_any_context_lost_old: ptr to the SoC PRM context loss test fn * @clear_context_loss_flags_old: ptr to the SoC PRM context loss flag clear fn + * @late_init: ptr to the late init function * * XXX @was_any_context_lost_old and @clear_context_loss_flags_old are * deprecated. @@ -134,6 +135,7 @@ struct prm_ll_data { u32 (*read_reset_sources)(void); bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx); void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx); + int (*late_init)(void); }; extern int prm_register(struct prm_ll_data *pld); diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index fcbe854..f92de79 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -634,8 +634,11 @@ struct pwrdm_ops omap3_pwrdm_operations = { * */ +static int omap3xxx_prm_late_init(void); + static struct prm_ll_data omap3xxx_prm_ll_data = { .read_reset_sources = &omap3xxx_prm_read_reset_sources, + .late_init = &omap3xxx_prm_late_init, }; int __init omap3xxx_prm_init(void) @@ -650,9 +653,6 @@ static int __init omap3xxx_prm_late_init(void) { int ret; - if (!cpu_is_omap34xx()) - return 0; - if (!(prm_features & PRM_HAS_IO_WAKEUP)) return 0; @@ -664,7 +664,6 @@ static int __init omap3xxx_prm_late_init(void) return ret; } -omap_subsys_initcall(omap3xxx_prm_late_init); static void __exit omap3xxx_prm_exit(void) { diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index dc357df..60b9b05 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -650,6 +650,8 @@ struct pwrdm_ops omap4_pwrdm_operations = { .pwrdm_has_voltdm = omap4_check_vcvp, }; +static int omap44xx_prm_late_init(void); + /* * XXX document */ @@ -657,6 +659,7 @@ static struct prm_ll_data omap44xx_prm_ll_data = { .read_reset_sources = &omap44xx_prm_read_reset_sources, .was_any_context_lost_old = &omap44xx_prm_was_any_context_lost_old, .clear_context_loss_flags_old = &omap44xx_prm_clear_context_loss_flags_old, + .late_init = &omap44xx_prm_late_init, }; int __init omap44xx_prm_init(void) @@ -669,9 +672,6 @@ int __init omap44xx_prm_init(void) static int __init omap44xx_prm_late_init(void) { - if (!cpu_is_omap44xx()) - return 0; - if (!(prm_features & PRM_HAS_IO_WAKEUP)) return 0; @@ -679,7 +679,6 @@ static int __init omap44xx_prm_late_init(void) return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); } -omap_subsys_initcall(omap44xx_prm_late_init); static void __exit omap44xx_prm_exit(void) { diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index f98c01a..76ca320 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -529,3 +529,11 @@ int __init of_prcm_init(void) return 0; } + +static int __init prm_late_init(void) +{ + if (prm_ll_data->late_init) + return prm_ll_data->late_init(); + return 0; +} +subsys_initcall(prm_late_init);