From patchwork Tue Feb 18 03:25:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Badarkhe X-Patchwork-Id: 3667081 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 281C4BF13A for ; Tue, 18 Feb 2014 03:25:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 317F020176 for ; Tue, 18 Feb 2014 03:25:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51458200F3 for ; Tue, 18 Feb 2014 03:25:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103AbaBRDZr (ORCPT ); Mon, 17 Feb 2014 22:25:47 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:55957 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbaBRDZq (ORCPT ); Mon, 17 Feb 2014 22:25:46 -0500 Received: by mail-pb0-f48.google.com with SMTP id rr13so16155986pbb.35 for ; Mon, 17 Feb 2014 19:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LB5BA66wmYOOm93WTRw2LVmUO9EYPsONAkl50rIQrlc=; b=N858/iUEiOJs+IGg4MO+OMGpzhfiZ26GHZns399IolfoWjeISLRjODEnOC7kL/+bXn /tMGtRO+iRvFKYIN6A/HbZGIGEh9+jDnnU/sfIrrce1wuNq4Hhf0QKVwm5Eadf3RHLi+ ffb1qsDpmCQYLD9MMjr0R5uFFKDNQdfAFcINbP6w6diTogOsX0FspoIk48HLzDuFCMyk spR7DC4fXBTf+OLaAGlHHt40DggeOBRRqRCEf3HFG5hO9BHCuCT1HGRufnYrZ+dBUluS SN3DZEfL5xPE0z2eUvDA7VWgO6o7Ki4UkCxsxq57LcZkj4YsPVXU2ugdtfSGcKobEI49 Bhfw== X-Received: by 10.68.204.161 with SMTP id kz1mr7250517pbc.156.1392693946268; Mon, 17 Feb 2014 19:25:46 -0800 (PST) Received: from manish-HP-Pavilion-dv4-Notebook-PC.connectify ([113.193.145.132]) by mx.google.com with ESMTPSA id nz11sm131124097pab.6.2014.02.17.19.25.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 19:25:45 -0800 (PST) From: Manish Badarkhe To: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com Cc: tomi.valkeinen@ti.com, plagnioj@jcrosoft.com, nsekhar@ti.com, badarkhe.manish@gmail.com Subject: [PATCH] video: da8xx-fb: Use "SIMPLE_DEV_PM_OPS" macro Date: Tue, 18 Feb 2014 08:55:36 +0530 Message-Id: <1392693936-23862-1-git-send-email-badarkhe.manish@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Update driver to use SIMPLE_DEV_PM_OPS macro for power management suspend and resume operations. Signed-off-by: Manish Badarkhe --- :100644 100644 a1d74dd... 0c0ba92... M drivers/video/da8xx-fb.c drivers/video/da8xx-fb.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index a1d74dd..0c0ba92 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -1546,7 +1546,7 @@ err_pm_runtime_disable: return ret; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static struct lcdc_context { u32 clk_enable; u32 ctrl; @@ -1610,9 +1610,9 @@ static void lcd_context_restore(void) return; } -static int fb_suspend(struct platform_device *dev, pm_message_t state) +static int fb_suspend(struct device *dev) { - struct fb_info *info = platform_get_drvdata(dev); + struct fb_info *info = dev_get_drvdata(dev); struct da8xx_fb_par *par = info->par; console_lock(); @@ -1622,18 +1622,18 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state) fb_set_suspend(info, 1); lcd_disable_raster(DA8XX_FRAME_WAIT); lcd_context_save(); - pm_runtime_put_sync(&dev->dev); + pm_runtime_put_sync(dev); console_unlock(); return 0; } -static int fb_resume(struct platform_device *dev) +static int fb_resume(struct device *dev) { - struct fb_info *info = platform_get_drvdata(dev); + struct fb_info *info = dev_get_drvdata(dev); struct da8xx_fb_par *par = info->par; console_lock(); - pm_runtime_get_sync(&dev->dev); + pm_runtime_get_sync(dev); lcd_context_restore(); if (par->blank == FB_BLANK_UNBLANK) { lcd_enable_raster(); @@ -1647,19 +1647,17 @@ static int fb_resume(struct platform_device *dev) return 0; } -#else -#define fb_suspend NULL -#define fb_resume NULL #endif +static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume); + static struct platform_driver da8xx_fb_driver = { .probe = fb_probe, .remove = fb_remove, - .suspend = fb_suspend, - .resume = fb_resume, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, + .pm = &fb_pm_ops, }, }; module_platform_driver(da8xx_fb_driver);