From patchwork Fri Apr 4 13:43:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 27832 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C900B20369 for ; Fri, 4 Apr 2014 13:43:27 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf8856990qac.0 for ; Fri, 04 Apr 2014 06:43:27 -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=dJU/fC6VdKmrbcQHqN7PXxUMkmIbuYIL3s/bMpk63Yw=; b=LGtxoVWMgZQmFZTev27DUTfSsajWWcdvC6tXxwrrDwQ0Nl/nF/66b/mQnL4BaAvfNK cZnKzhlAsVEkHXRO/VbDgipxgS9y1DpIA+UoVHyHGYNCAXGHTUdzyZz7Y89Zf2Grl+WG batQ0FNbe1jTVCpyApnQo6tD2Y5R2E3r6v7298S6KVn1/EcuLc8GvQ7EQKvpXCKNmaQz 6k1+9RSOzeSBC6k6GPynh6CHR0P3VpcmwubnLdrlQGLbjQBcnuIlYy3iw3UgUEvRwtLu DL64Y4WpcYftNSmFrKdPIqZR2LHNXxpsM1TQlM+IakH0w1II+NZNrSHWhxus1iUJMIK7 G00Q== X-Gm-Message-State: ALoCoQlpMXRCjDGpMQX8WQn+FVG3a9Vg//9GXKMRThBkyeq900B8bs5S53+Xlx5aoO1D+SbQAlT3 X-Received: by 10.59.10.40 with SMTP id dx8mr3757278ved.26.1396619007536; Fri, 04 Apr 2014 06:43:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.138 with SMTP id 10ls999337qgx.52.gmail; Fri, 04 Apr 2014 06:43:27 -0700 (PDT) X-Received: by 10.220.198.197 with SMTP id ep5mr2476105vcb.21.1396619007430; Fri, 04 Apr 2014 06:43:27 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id w10si1779623vck.104.2014.04.04.06.43.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 06:43:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so1486879veb.1 for ; Fri, 04 Apr 2014 06:43:27 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr1746304vcb.22.1396619007339; Fri, 04 Apr 2014 06:43:27 -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 v8csp115352vcv; Fri, 4 Apr 2014 06:43:26 -0700 (PDT) X-Received: by 10.68.135.42 with SMTP id pp10mr15325235pbb.58.1396619002247; Fri, 04 Apr 2014 06:43:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tk5si4616090pbc.252.2014.04.04.06.43.21; Fri, 04 Apr 2014 06:43:21 -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 S1752855AbaDDNnU (ORCPT + 9 others); Fri, 4 Apr 2014 09:43:20 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:55508 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbaDDNnS (ORCPT ); Fri, 4 Apr 2014 09:43:18 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so1287422wib.5 for ; Fri, 04 Apr 2014 06:43:17 -0700 (PDT) X-Received: by 10.180.107.136 with SMTP id hc8mr4720776wib.11.1396618997223; Fri, 04 Apr 2014 06:43:17 -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 cu6sm2845053wjb.8.2014.04.04.06.43.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 06:43:16 -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 V2 15/17] ARM: exynos: cpuidle: Pass the AFTR callback to the platform_data Date: Fri, 4 Apr 2014 15:43:07 +0200 Message-Id: <1396618989-2897-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396618989-2897-1-git-send-email-daniel.lezcano@linaro.org> References: <1396618989-2897-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.128.170 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 4b94181..149fdeb 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -18,12 +18,12 @@ #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; } @@ -80,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/exynos.c b/arch/arm/mach-exynos/exynos.c index b567361..451b371 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;