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: 27952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF24520553 for ; Tue, 8 Apr 2014 12:19:55 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf2298382qcq.0 for ; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=og2eBVaZk8b2GzMJHqyM1je7YmtUjgZBBTXAMXF2oE8=; b=m5F8q6/uSO3TE8/qt0MymFCuJ6KRTToIOBorSaNQSRCdFcrzjlyZwtlRH7QcyabAgK DzKVuX7tN+/uhyMPfuwt5/Xh9jGSiqjJ0WDnQYpRq3qYAmV1KiL55zeVC1IqjL7WkpS8 SkaLLVDriCh5G3fM4nC+Jywg3gVp1ccUhx0O/2DmSO6ge2ok7PZvgy22JtJnuIpLds+i 5QOfobeBpXyvzoxHOb7T0wk7Y+fSTxPR+9rsxvYLfiB/r+6GUIYHzkkz8LZi2HUOUWE7 k1t6CzMxcfXrbhFQrWtN+UtTkoCcdIA1K4ufhxrf2tHMSNfy3ksBiKe8WmSMaRWUNbNQ BLCw== X-Gm-Message-State: ALoCoQmYJoyA9o9u6Nr63qOqbfoU/pJuXKsu0n0U17AOlWiauGleC5BtPVmvVIZV8+/s1zj6BXRI X-Received: by 10.224.167.8 with SMTP id o8mr1635432qay.0.1396959595660; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.177 with SMTP id t46ls188273qgt.16.gmail; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) X-Received: by 10.52.23.97 with SMTP id l1mr2523732vdf.11.1396959595555; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id tm8si360459vdc.44.2014.04.08.05.19.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 05:19:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so692360vcb.0 for ; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) X-Received: by 10.220.163.3 with SMTP id y3mr2992548vcx.7.1396959595481; Tue, 08 Apr 2014 05:19:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp240646vcv; Tue, 8 Apr 2014 05:19:54 -0700 (PDT) X-Received: by 10.68.139.137 with SMTP id qy9mr4170481pbb.11.1396959594499; Tue, 08 Apr 2014 05:19:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tx1si993786pbc.150.2014.04.08.05.19.53; Tue, 08 Apr 2014 05:19:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756628AbaDHMTx (ORCPT + 9 others); 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-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: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;