From patchwork Fri Apr 4 07:48:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3936931 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7DE3B9F357 for ; Fri, 4 Apr 2014 07:48:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F093203DC for ; Fri, 4 Apr 2014 07:48:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA352203E5 for ; Fri, 4 Apr 2014 07:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752278AbaDDHsU (ORCPT ); Fri, 4 Apr 2014 03:48:20 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:60995 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193AbaDDHsI (ORCPT ); Fri, 4 Apr 2014 03:48:08 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so685536wib.10 for ; Fri, 04 Apr 2014 00:48:07 -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=Lpff/p+ozsTG5GC1O7bxjcSfqxEtjU3Zfn1fXSYjH8A=; b=gPs9mKfzUYGnpxHGndetsTmQZP8kkhtQsvnfAUG2S5sEbVf8kOuFOXoFD5qvFTge2W nFEd2gUR+Lv0fiFz4yqpxddVKrr4hKFOggs/WVoSu2BGb/HUwXd1+uzvR9KPPe074uQT fSxY9R58dknlsr4+49xdgDfR4LRtC+0PM6XpUW5YEcyP3f/WE2ZZERmW9170erVjl5el f9gSkqFOHBxfmXxUmHsKxd6I6Gag5rOD95SjY+C78buHxmI0TNRiPzbUWySuxRTD2YzT ardt/pyMAcW9td6teWSzvKWvxIqdDl2XixopiPIwZ7Gmj3y3pa8NMEppeFfk1qYtfEiU GLFw== X-Gm-Message-State: ALoCoQmILiauZsg5hx5KGV5bC8IZlqYnFBe3gkVGHlfKYz1BPbpgTPOoi+xl/y3zCqzXtTKEBMsR X-Received: by 10.180.9.42 with SMTP id w10mr2290925wia.20.1396597687690; Fri, 04 Apr 2014 00:48:07 -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 t1sm3028163wia.1.2014.04.04.00.48.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 00:48:06 -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, rjw@rjwysocki.net Subject: [PATCH 15/17] ARM: exynos: cpuidle: Pass the AFTR callback to the platform_data Date: Fri, 4 Apr 2014 09:48:01 +0200 Message-Id: <1396597683-6969-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396597683-6969-1-git-send-email-daniel.lezcano@linaro.org> References: <1396597683-6969-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.5 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 driver. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar --- arch/arm/mach-exynos/common.c | 5 +++-- arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/cpuidle.c | 8 ++++---- arch/arm/mach-exynos/pmu.c | 6 ++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index f18be40..d5fa21e 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -294,8 +294,9 @@ void exynos5_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/common.h b/arch/arm/mach-exynos/common.h index f76967b..3678a28 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -49,5 +49,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 1916dc6..f6b7aac0 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -18,13 +18,11 @@ #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; @@ -82,6 +80,8 @@ static int exynos_cpuidle_probe(struct platform_device *pdev) if (soc_is_exynos5440()) exynos_idle_driver.state_count = 1; + 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/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;