From patchwork Wed Mar 4 04:55:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5928661 X-Patchwork-Delegate: horms@verge.net.au 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 900489F318 for ; Wed, 4 Mar 2015 04:56:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A099B203EB for ; Wed, 4 Mar 2015 04:56:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9947203C1 for ; Wed, 4 Mar 2015 04:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757723AbbCDE4X (ORCPT ); Tue, 3 Mar 2015 23:56:23 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:63151 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757698AbbCDE4W (ORCPT ); Tue, 3 Mar 2015 23:56:22 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 04 Mar 2015 13:56:21 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 92C884BAEF; Wed, 4 Mar 2015 13:56:21 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 5CEB2480A5; Wed, 4 Mar 2015 13:56:21 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 56D76480A3; Wed, 4 Mar 2015 13:56:21 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id PAS27913; Wed, 4 Mar 2015 13:56:21 +0900 X-IronPort-AV: E=Sophos;i="5.09,685,1418050800"; d="scan'208";a="181119572" Received: from mail-sg1lp0092.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.92]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Mar 2015 13:56:20 +0900 Received: from localhost (211.11.155.147) by SIXPR06MB0573.apcprd06.prod.outlook.com (25.160.238.16) with Microsoft SMTP Server (TLS) id 15.1.99.14; Wed, 4 Mar 2015 04:56:19 +0000 From: Keita Kobayashi To: , CC: , , , Keita Kobayashi Subject: [RFC/PATCH 4/6] ARM: shmobile: r8a7791: Add Core-Standby CPUIdle support for r8a7791 Date: Wed, 4 Mar 2015 13:55:44 +0900 Message-ID: <1425444946-3084-5-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: OS2PR01CA0015.jpnprd01.prod.outlook.com (25.161.74.153) To SIXPR06MB0573.apcprd06.prod.outlook.com (25.160.238.16) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB0573; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:SIXPR06MB0573; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0573; X-Forefront-PRVS: 0505147DDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(66066001)(92566002)(50986999)(229853001)(87976001)(19580405001)(48376002)(50466002)(33646002)(76176999)(2950100001)(36756003)(62966003)(77156002)(78352002)(50226001)(19580395003)(40100003)(76506005)(47776003)(122386002)(46102003)(42186005)(42382002); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0573; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2015 04:56:19.3199 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0573 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 Add the wfi and Core-Standby for CPUIdle power states support for the r8a7791 SoC. Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/pm-r8a7791.c | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c index 25f107b..6c00d37 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -10,8 +10,13 @@ * for more details. */ +#include #include #include +#include +#include +#include +#include #include #include "common.h" #include "pm-rcar.h" @@ -43,6 +48,41 @@ static inline void r8a7791_sysc_init(void) {} #endif /* CONFIG_SMP */ +#ifdef CONFIG_ARM_RENESAS_CPUIDLE +static struct cpuidle_driver r8a7791_cpuidle_driver = { + .name = "rcar_r8a7791_cpuidle", + .owner = THIS_MODULE, + .states = { + [0] = ARM_CPUIDLE_WFI_STATE, + [1] = { + .name = "Core-Standby", + .desc = "Core Standby Mode", + .exit_latency = 2800, + .target_residency = 2800, + .enter = shmobile_smp_apmu_enter_cpuidle, + }, + }, + .state_count = 2, +}; + +static struct renesas_cpuidle_driver r8a7791_cpuidle = { + .target_cpu = ARM_CPU_PART_CORTEX_A15, + .renesas_drv = &r8a7791_cpuidle_driver, +}; + +static struct renesas_cpuidle r8a7791_data = { + .num_drvs = 1, + .rcd = &r8a7791_cpuidle, +}; + +static void __init r8a7791_cpuidle_init(void) +{ + shmobile_cpuidle_set_driver(&r8a7791_data); +} +#else +static void __init r8a7791_cpuidle_init(void) {} +#endif + void __init r8a7791_pm_init(void) { void __iomem *p; @@ -70,4 +110,5 @@ void __init r8a7791_pm_init(void) r8a7791_sysc_init(); shmobile_smp_apmu_suspend_init(); + r8a7791_cpuidle_init(); }