From patchwork Tue Apr 8 12:19:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3948501 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 F1247BFF02 for ; Tue, 8 Apr 2014 12:20:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2B972037E for ; Tue, 8 Apr 2014 12:20:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9348E20395 for ; Tue, 8 Apr 2014 12:19:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756628AbaDHMTx (ORCPT ); Tue, 8 Apr 2014 08:19:53 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:58509 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756227AbaDHMTw (ORCPT ); Tue, 8 Apr 2014 08:19:52 -0400 Received: by mail-we0-f179.google.com with SMTP id x48so841585wes.38 for ; Tue, 08 Apr 2014 05:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=REX/Uwp+0lrr+GjM+ASL8+6trgWjMRADhQnwVh7OGWo=; b=Hw5E6U1S6Lyk4lyAE8ichj+h3VxHZsF13He+8K9d6EX1wK3sJQKUPSg1N/1JSvn3Cr T9fVsbH/m8+wlQ5uW4fFvq5o2SvCTyZY4/TVM0Rgc+ry5sVQ9VghC8ydERNJyOgs2Xnj N5VmHrYCJCQfJNoj6PxlLQo3FBmVCj6+YHvi1YHq8HzvXc66vSz3gh4PpVo1f16yVYe3 nE0Q4YlqZA7JhsCdRdAZcovCzsLxzRc/cPA1sfHOWtEjCbtK72BRipEc3Lbnt6Q0E6mT NV5MYNVXthDJMtgq83ivbEkrnsLoGk2WwKULOPLAunIaE0rdA02x3m8SRoVi4nSVzc7q jomg== X-Gm-Message-State: ALoCoQmuuYCxCom68Blzk2o9r+VUHL5rEzM1LX1rOmgDT8pOL/1EFcP+EzhqA8oWV9+lWbX4EewH X-Received: by 10.180.109.231 with SMTP id hv7mr31930724wib.38.1396959591834; Tue, 08 Apr 2014 05:19:51 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-451-172.w83-205.abo.wanadoo.fr. [83.205.74.172]) by mx.google.com with ESMTPSA id u1sm3000063wjx.16.2014.04.08.05.19.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:19:51 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, t.figa@samsung.com, linaro-kernel@lists.linaro.org, b.zolnierkie@samsung.com, sachin.kamat@linaro.org, viresh.kumar@linaro.org, rjw@rjwysocki.net Subject: [PATCH V3 16/17] ARM: exynos: cpuidle: Pass the AFTR callback to the platform_data Date: Tue, 8 Apr 2014 14:19:38 +0200 Message-Id: <1396959579-18268-17-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396959579-18268-1-git-send-email-daniel.lezcano@linaro.org> References: <1396959579-18268-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 No more dependency on the arch code. The platform_data field is used to set the PM callback as the other cpuidle drivers. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar Reviewed-by: Bartlomiej Zolnierkiewicz --- arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/cpuidle.c | 6 ++++-- arch/arm/mach-exynos/exynos.c | 5 +++-- arch/arm/mach-exynos/pmu.c | 6 ++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 9ef3f83..7d9432e 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -62,5 +62,6 @@ struct exynos_pmu_conf { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +extern void exynos_sys_powerdown_aftr(void); #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index a1f111e..25d2fad 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -16,12 +16,12 @@ #include #include -#include "common.h" +static void (*exynos_aftr)(void); static int idle_finisher(unsigned long flags) { /* Set value of power down register for aftr mode */ - exynos_sys_powerdown_conf(SYS_AFTR); + exynos_aftr(); cpu_do_idle(); return 1; } @@ -75,6 +75,8 @@ static int exynos_cpuidle_probe(struct platform_device *pdev) { int ret; + exynos_aftr = (void *)(pdev->dev.platform_data); + ret = cpuidle_register(&exynos_idle_driver, NULL); if (ret) { dev_err(&pdev->dev, "failed to register cpuidle driver\n"); diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index fe8dac8..a7ab561 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -221,8 +221,9 @@ void exynos_restart(enum reboot_mode mode, const char *cmd) } static struct platform_device exynos_cpuidle = { - .name = "exynos_cpuidle", - .id = -1, + .name = "exynos_cpuidle", + .dev.platform_data = exynos_sys_powerdown_aftr, + .id = -1, }; void __init exynos_cpuidle_init(void) diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 05c7ce1..fd1ae22 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -389,6 +389,12 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) } } +/* Set value of power down register for aftr mode */ +void exynos_sys_powerdown_aftr(void) +{ + exynos_sys_powerdown_conf(SYS_AFTR); +} + static int __init exynos_pmu_init(void) { unsigned int value;