From patchwork Wed Jan 23 09:45:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: avinash philip X-Patchwork-Id: 2023051 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5D4C9DF280 for ; Wed, 23 Jan 2013 09:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754693Ab3AWJpu (ORCPT ); Wed, 23 Jan 2013 04:45:50 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:44451 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104Ab3AWJps (ORCPT ); Wed, 23 Jan 2013 04:45:48 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0N9jcB1011305; Wed, 23 Jan 2013 03:45:38 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0N9jbe8004105; Wed, 23 Jan 2013 15:15:37 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 23 Jan 2013 15:15:37 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r0N9jb7C003366; Wed, 23 Jan 2013 15:15:37 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 3F4D4158003; Wed, 23 Jan 2013 15:15:35 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r0N9jYR28809; Wed, 23 Jan 2013 15:15:34 +0530 (IST) From: Philip Avinash To: , , , CC: , , , , , , , Philip Avinash Subject: [PATCH 3/4] arm: gpmc: Low power transition support Date: Wed, 23 Jan 2013 15:15:45 +0530 Message-ID: <1358934346-16822-4-git-send-email-avinashphilip@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358933176-12409-1-git-send-email-avinashphilip@ti.com> References: <1358933176-12409-1-git-send-email-avinashphilip@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org With GPMC converted to platform driver recently, adds low power transition support in driver itself. Signed-off-by: Philip Avinash --- arch/arm/mach-omap2/gpmc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index aed958a..af10617 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1357,9 +1357,29 @@ static __devexit int gpmc_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM +static int gpmc_suspend(struct platform_device *pdev, pm_message_t state) +{ + omap3_gpmc_save_context(); + clk_disable_unprepare(gpmc_l3_clk); + return 0; +} + +static int gpmc_resume(struct platform_device *pdev) +{ + clk_prepare_enable(gpmc_l3_clk); + omap3_gpmc_restore_context(); + return 0; +} +#endif + static struct platform_driver gpmc_driver = { .probe = gpmc_probe, .remove = __devexit_p(gpmc_remove), +#ifdef CONFIG_PM + .suspend = gpmc_suspend, + .resume = gpmc_resume, +#endif .driver = { .name = DEVICE_NAME, .owner = THIS_MODULE,