From patchwork Wed Mar 4 04:55:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5928621 X-Patchwork-Delegate: horms@verge.net.au 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 4E1B1BF440 for ; Wed, 4 Mar 2015 04:56:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68265203EB for ; Wed, 4 Mar 2015 04:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 757BB203C1 for ; Wed, 4 Mar 2015 04:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755300AbbCDE4J (ORCPT ); Tue, 3 Mar 2015 23:56:09 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:29788 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752665AbbCDE4I (ORCPT ); Tue, 3 Mar 2015 23:56:08 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 04 Mar 2015 13:56:06 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id D1EE84B30A; Wed, 4 Mar 2015 13:56:06 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id B5162480A4; Wed, 4 Mar 2015 13:56:06 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id AFE7E480A3; Wed, 4 Mar 2015 13:56:06 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id PAC27913; Wed, 4 Mar 2015 13:56:06 +0900 X-IronPort-AV: E=Sophos;i="5.09,685,1418050800"; d="scan'208";a="181119557" Received: from mail-sg1lp0085.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.85]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Mar 2015 13:56:05 +0900 Received: from localhost (211.11.155.147) by HKXPR06MB0567.apcprd06.prod.outlook.com (25.161.177.145) with Microsoft SMTP Server (TLS) id 15.1.99.14; Wed, 4 Mar 2015 04:56:04 +0000 From: Keita Kobayashi To: , CC: , , , Keita Kobayashi Subject: [RFC/PATCH 2/6] ARM: shmobile: Change CPUIdle InterFace Date: Wed, 4 Mar 2015 13:55:42 +0900 Message-ID: <1425444946-3084-3-git-send-email-keita.kobayashi.ym@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.2 In-Reply-To: <1425444946-3084-1-git-send-email-keita.kobayashi.ym@renesas.com> References: <1425444946-3084-1-git-send-email-keita.kobayashi.ym@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: OS2PR01CA0020.jpnprd01.prod.outlook.com (25.161.74.158) To HKXPR06MB0567.apcprd06.prod.outlook.com (25.161.177.145) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB0567; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:HKXPR06MB0567; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0567; X-Forefront-PRVS: 0505147DDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(77156002)(47776003)(19580405001)(19580395003)(92566002)(50226001)(78352002)(122386002)(87976001)(33646002)(76176999)(46102003)(42382002)(50466002)(229853001)(66066001)(76506005)(62966003)(40100003)(2950100001)(42186005)(50986999)(36756003)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0567; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2015 04:56:04.4195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0567 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 | 4 +++- arch/arm/mach-shmobile/cpuidle.c | 31 ++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 8faf6e0..4adecd4 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,6 +36,7 @@ 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; } #endif 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; }