From patchwork Wed Jul 9 13:40:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 4515981 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66158BEEAA for ; Wed, 9 Jul 2014 13:40:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98A9720377 for ; Wed, 9 Jul 2014 13:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D37972035C for ; Wed, 9 Jul 2014 13:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756073AbaGINks (ORCPT ); Wed, 9 Jul 2014 09:40:48 -0400 Received: from top.free-electrons.com ([176.31.233.9]:47389 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755676AbaGINkr (ORCPT ); Wed, 9 Jul 2014 09:40:47 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 1336B1557; Wed, 9 Jul 2014 15:40:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 94FA476; Wed, 9 Jul 2014 15:40:49 +0200 (CEST) From: Thomas Petazzoni To: Daniel Lezcano , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement Cc: Tawfik Bayouk , Nadav Haklai , Lior Amsalem , Ezequiel Garcia , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni Subject: [PATCHv2 14/17] cpuidle: mvebu: add Armada 38x support Date: Wed, 9 Jul 2014 15:40:18 +0200 Message-Id: <1404913221-17343-15-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1404913221-17343-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1404913221-17343-1-git-send-email-thomas.petazzoni@free-electrons.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit adds the list of cpuidle states supported by the Armada 38x SoC in the cpuidle-mvebu-v7 driver, as well as the necessary logic around it to support this SoC. Signed-off-by: Thomas Petazzoni --- drivers/cpuidle/cpuidle-mvebu-v7.c | 19 ++++++++++++++++++- include/linux/mvebu-v7-cpuidle.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c index 5de147f..8bfac4d 100644 --- a/drivers/cpuidle/cpuidle-mvebu-v7.c +++ b/drivers/cpuidle/cpuidle-mvebu-v7.c @@ -1,5 +1,5 @@ /* - * Marvell Armada 370 and Armada XP SoC cpuidle driver + * Marvell Armada 370, 38x and XP SoC cpuidle driver * * Copyright (C) 2014 Marvell * @@ -88,6 +88,21 @@ static struct cpuidle_driver armada370_cpuidle_driver = { .state_count = 2, }; +static struct cpuidle_driver armada38x_cpuidle_driver = { + .name = "armada_38x_idle", + .states[0] = ARM_CPUIDLE_WFI_STATE, + .states[1] = { + .enter = mvebu_v7_enter_idle, + .exit_latency = 10, + .power_usage = 5, + .target_residency = 100, + .flags = CPUIDLE_FLAG_TIME_VALID, + .name = "Idle", + .desc = "CPU and SCU power down", + }, + .state_count = 2, +}; + static int mvebu_v7_cpuidle_probe(struct platform_device *pdev) { struct cpuidle_driver *drv; @@ -98,6 +113,8 @@ static int mvebu_v7_cpuidle_probe(struct platform_device *pdev) drv = &armadaxp_cpuidle_driver; else if (pcpuidle->type == CPUIDLE_ARMADA_370) drv = &armada370_cpuidle_driver; + else if (pcpuidle->type == CPUIDLE_ARMADA_38X) + drv = &armada38x_cpuidle_driver; else return -EINVAL; diff --git a/include/linux/mvebu-v7-cpuidle.h b/include/linux/mvebu-v7-cpuidle.h index 6d54ae1..73f6d32 100644 --- a/include/linux/mvebu-v7-cpuidle.h +++ b/include/linux/mvebu-v7-cpuidle.h @@ -17,6 +17,7 @@ enum mvebu_v7_cpuidle_types { CPUIDLE_ARMADA_XP, CPUIDLE_ARMADA_370, + CPUIDLE_ARMADA_38X, }; struct mvebu_v7_cpuidle {