From patchwork Thu Feb 7 12:36:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: avinash philip X-Patchwork-Id: 2110681 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 63842DFB7B for ; Thu, 7 Feb 2013 12:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757124Ab3BGMiy (ORCPT ); Thu, 7 Feb 2013 07:38:54 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:54556 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751261Ab3BGMix (ORCPT ); Thu, 7 Feb 2013 07:38:53 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r17Cch61022307; Thu, 7 Feb 2013 06:38:44 -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 r17Cch0e014619; Thu, 7 Feb 2013 18:08:43 +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; Thu, 7 Feb 2013 18:08:42 +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 r17CcgaI024144; Thu, 7 Feb 2013 18:08:42 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 37911158003; Thu, 7 Feb 2013 18:08:42 +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 r17CcfR08388; Thu, 7 Feb 2013 18:08:41 +0530 (IST) From: Philip Avinash To: , , , , CC: , , , , , , , , Philip Avinash Subject: [PATCH v2 2/4] arm: gpmc: Low power transition support Date: Thu, 7 Feb 2013 18:06:56 +0530 Message-ID: <1360240618-11094-3-git-send-email-avinashphilip@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360240618-11094-1-git-send-email-avinashphilip@ti.com> References: <1360240618-11094-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 --- Changes since v1: Module disable & enable added using pm_runtime support. 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 b1cd6c1..cc57988 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1361,9 +1361,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(); + pm_runtime_put_sync(&pdev->dev); + return 0; +} + +static int gpmc_resume(struct platform_device *pdev) +{ + pm_runtime_get_sync(&pdev->dev); + 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,