From patchwork Thu Mar 5 08:59:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5944171 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 7D93FBF440 for ; Thu, 5 Mar 2015 08:59:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4847202AE for ; Thu, 5 Mar 2015 08:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96E0B20304 for ; Thu, 5 Mar 2015 08:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754446AbbCEI7g (ORCPT ); Thu, 5 Mar 2015 03:59:36 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:56971 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754270AbbCEI7f (ORCPT ); Thu, 5 Mar 2015 03:59:35 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 05 Mar 2015 17:59:34 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 2D5DF50D3C; Thu, 5 Mar 2015 17:59:34 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 0C09C480A4; Thu, 5 Mar 2015 17:59:34 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 076C1480A3; Thu, 5 Mar 2015 17:59:34 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAE04274; Thu, 5 Mar 2015 17:59:34 +0900 X-IronPort-AV: E=Sophos;i="5.11,345,1422889200"; d="scan'208";a="182365002" Received: from mail-sg1lp0087.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.87]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 05 Mar 2015 17:59:33 +0900 Received: from localhost (211.11.155.147) by SIXPR06MB0575.apcprd06.prod.outlook.com (25.160.238.18) with Microsoft SMTP Server (TLS) id 15.1.99.14; Thu, 5 Mar 2015 08:59:32 +0000 From: Keita Kobayashi To: , CC: , , , , Keita Kobayashi Subject: [RFC/PATCH v2 4/6] ARM: shmobile: r8a7791: Add Core-Standby CPUIdle support for r8a7791 Date: Thu, 5 Mar 2015 17:59:01 +0900 Message-ID: <1425545943-1440-5-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: OS2PR01CA0002.jpnprd01.prod.outlook.com (25.161.74.140) To SIXPR06MB0575.apcprd06.prod.outlook.com (25.160.238.18) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB0575; X-Forefront-Antispam-Report: BMV:0; SFV:NSPM; SFS:(10019020)(979002)(6009001)(6069001)(76506005)(36756003)(78352002)(33646002)(62966003)(47776003)(66066001)(42186005)(48376002)(50226001)(92566002)(2950100001)(42382002)(19580405001)(87976001)(50466002)(229853001)(19580395003)(76176999)(77156002)(50986999)(40100003)(46102003)(122386002)(138113003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0575; H:localhost; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5001007)(5005006); SRVR:SIXPR06MB0575; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0575; X-Forefront-PRVS: 05066DEDBB X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2015 08:59:32.1019 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0575 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 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c index 25f107b..784c284 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,32 @@ static inline void r8a7791_sysc_init(void) {} #endif /* CONFIG_SMP */ +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, +}; + void __init r8a7791_pm_init(void) { void __iomem *p; @@ -70,4 +101,7 @@ void __init r8a7791_pm_init(void) r8a7791_sysc_init(); shmobile_smp_apmu_suspend_init(); + + if (IS_ENABLED(CONFIG_ARM_RENESAS_CPUIDLE)) + shmobile_cpuidle_set_driver(&r8a7791_data); }