From patchwork Thu Mar 5 08:58:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5944131 Return-Path: X-Original-To: patchwork-linux-sh@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 2566EBF6C3 for ; Thu, 5 Mar 2015 08:59:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49ACA20364 for ; Thu, 5 Mar 2015 08:59:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4557B2037E for ; Thu, 5 Mar 2015 08:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754736AbbCEI7Y (ORCPT ); Thu, 5 Mar 2015 03:59:24 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:23368 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754433AbbCEI7W (ORCPT ); Thu, 5 Mar 2015 03:59:22 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie1.idc.renesas.com with ESMTP; 05 Mar 2015 17:59:21 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 8BB7E50D2A; Thu, 5 Mar 2015 17:59:21 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 68E912806D; Thu, 5 Mar 2015 17:59:21 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 662552806F; Thu, 5 Mar 2015 17:59:21 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id TAB13540; Thu, 5 Mar 2015 17:59:21 +0900 X-IronPort-AV: E=Sophos;i="5.11,345,1422889200"; d="scan'208";a="182364977" Received: from mail-hk1lp0118.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.118]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 05 Mar 2015 17:59:20 +0900 Received: from localhost (211.11.155.147) by HK2PR06MB0562.apcprd06.prod.outlook.com (25.161.183.155) with Microsoft SMTP Server (TLS) id 15.1.106.15; Thu, 5 Mar 2015 08:59:19 +0000 From: Keita Kobayashi To: , CC: , , , , Keita Kobayashi Subject: [RFC/PATCH v2 2/6] ARM: shmobile: Change CPUIdle InterFace Date: Thu, 5 Mar 2015 17:58:59 +0900 Message-ID: <1425545943-1440-3-git-send-email-keita.kobayashi.ym@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.2 In-Reply-To: <1425545943-1440-1-git-send-email-keita.kobayashi.ym@renesas.com> References: <1425545943-1440-1-git-send-email-keita.kobayashi.ym@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: TY1PR01CA0015.jpnprd01.prod.outlook.com (25.161.131.153) To HK2PR06MB0562.apcprd06.prod.outlook.com (25.161.183.155) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0562; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6069001)(6009001)(40100003)(122386002)(76176999)(48376002)(47776003)(36756003)(78352002)(50226001)(87976001)(229853001)(50986999)(92566002)(42382002)(77156002)(62966003)(33646002)(19580395003)(50466002)(66066001)(2950100001)(19580405001)(42186005)(76506005)(46102003); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0562; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002007)(5005006); SRVR:HK2PR06MB0562; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0562; X-Forefront-PRVS: 05066DEDBB X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2015 08:59:19.5805 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0562 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 This patch change the shmobile_cpuidle_init process to use Renesas CPUIdle driver. Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/common.h | 5 ++++- arch/arm/mach-shmobile/cpuidle.c | 31 ++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 8faf6e0..1ba3886 100644 --- a/arch/arm/mach-shmobile/common.h +++ b/arch/arm/mach-shmobile/common.h @@ -1,3 +1,5 @@ +#include + #ifndef __ARCH_MACH_COMMON_H #define __ARCH_MACH_COMMON_H @@ -23,7 +25,6 @@ struct clk; extern int shmobile_clk_init(void); extern struct platform_suspend_ops shmobile_suspend_ops; struct cpuidle_driver; -extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); #ifdef CONFIG_SUSPEND int shmobile_suspend_init(void); @@ -35,8 +36,10 @@ static inline void shmobile_smp_apmu_suspend_init(void) { } #ifdef CONFIG_CPU_IDLE int shmobile_cpuidle_init(void); +extern void shmobile_cpuidle_set_driver(struct renesas_cpuidle *drv); #else static inline int shmobile_cpuidle_init(void) { return 0; } +static inline void shmobile_cpuidle_set_driver(struct renesas_cpuidle *drv) {} #endif #ifdef CONFIG_CPU_FREQ diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 0afeb5c..cb81ad6 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -13,25 +13,34 @@ #include #include #include +#include +#include +#include #include #include +#include "common.h" -static struct cpuidle_driver shmobile_cpuidle_default_driver = { - .name = "shmobile_cpuidle", - .owner = THIS_MODULE, - .states[0] = ARM_CPUIDLE_WFI_STATE, - .safe_state_index = 0, /* C1 */ - .state_count = 1, +/* default */ +static struct renesas_cpuidle cpuidle_data = { + .num_drvs = 0, + .rcd = NULL, }; -static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver; - -void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) +void __init shmobile_cpuidle_set_driver(struct renesas_cpuidle *pd) { - cpuidle_drv = drv; + cpuidle_data = *pd; } +static struct platform_device renesas_cpuidle = { + .name = "cpuidle-renesas", + .id = -1, + .dev = { + .platform_data = &cpuidle_data, + }, +}; + int __init shmobile_cpuidle_init(void) { - return cpuidle_register(cpuidle_drv, NULL); + platform_device_register(&renesas_cpuidle); + return 0; }