From patchwork Fri Aug 1 09:48:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 4662041 Return-Path: X-Original-To: patchwork-linux-sh@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 469799F319 for ; Fri, 1 Aug 2014 09:48:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4350A20219 for ; Fri, 1 Aug 2014 09:48:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CA4E2020F for ; Fri, 1 Aug 2014 09:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515AbaHAJsv (ORCPT ); Fri, 1 Aug 2014 05:48:51 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:24165 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750783AbaHAJsu (ORCPT ); Fri, 1 Aug 2014 05:48:50 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 01 Aug 2014 18:48:49 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 935983B614; Fri, 1 Aug 2014 18:48:49 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 795FA280A6; Fri, 1 Aug 2014 18:48:49 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 734B2280A0; Fri, 1 Aug 2014 18:48:49 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id UAA26855; Fri, 1 Aug 2014 18:48:49 +0900 X-IronPort-AV: E=Sophos;i="5.01,778,1399993200"; d="scan'208";a="167018892" Received: from mail-hk1lp0125.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.125]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 01 Aug 2014 18:48:48 +0900 Received: from [10.161.20.223] (211.11.155.147) by HKNPR06MB114.apcprd06.prod.outlook.com (10.242.102.145) with Microsoft SMTP Server (TLS) id 15.0.995.14; Fri, 1 Aug 2014 09:48:47 +0000 Message-ID: <53DB627C.40104@renesas.com> Date: Fri, 1 Aug 2014 18:48:44 +0900 From: keita kobayashi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: , CC: , Magnus Damm , Subject: [PATCH 4/6] ARM: shmobile: Add initialization cpuidle X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: HKXPR06CA011.apcprd06.prod.outlook.com (10.141.129.41) To HKNPR06MB114.apcprd06.prod.outlook.com (10.242.102.145) X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 029097202E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6049001)(6009001)(189002)(199002)(33656002)(46102001)(47776003)(102836001)(95666004)(105586002)(64706001)(74662001)(74502001)(19580405001)(21056001)(99396002)(81342001)(83506001)(19580395003)(86152002)(83072002)(76482001)(20776003)(101416001)(85306004)(36756003)(77096002)(92726001)(85852003)(83322001)(575784001)(23736002)(86362001)(50466002)(81542001)(107046002)(80022001)(65816999)(77982001)(65956001)(79102001)(65806001)(66066001)(4396001)(54356999)(42186005)(87976001)(106356001)(229853001)(50986999); DIR:OUT; SFP:; SCL:1; SRVR:HKNPR06MB114; H:[10.161.20.223]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; LANG:en; X-OriginatorOrg: renesas.com Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/cpuidle.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 0afeb5c..19c0c98 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -8,13 +8,17 @@ * for more details. */ +#include #include #include #include #include #include +#include +#include #include #include +#include "common.h" static struct cpuidle_driver shmobile_cpuidle_default_driver = { .name = "shmobile_cpuidle", @@ -31,7 +35,25 @@ void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) cpuidle_drv = drv; } +static struct platform_device shmobile_cpuidle = { + .name = "cpuidle-shmobile", + .dev.platform_data = shmobile_smp_apmu_enter_cpuidle, + .id = -1, +}; + int __init shmobile_cpuidle_init(void) { + int cpu; + + /* Make sure boot CPU also gets CPUIdle initialized */ + for_each_online_cpu(cpu) { + shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0); + } + +#ifdef CONFIG_ARCH_SHMOBILE_MULTI + platform_device_register(&shmobile_cpuidle); + return 0; +#else return cpuidle_register(cpuidle_drv, NULL); +#endif }