From patchwork Thu May 30 00:32:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2633221 Return-Path: X-Original-To: patchwork-linux-pm@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 D3E1ADFE82 for ; Thu, 30 May 2013 00:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967285Ab3E3Aci (ORCPT ); Wed, 29 May 2013 20:32:38 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:24044 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965596Ab3E3Ach (ORCPT ); Wed, 29 May 2013 20:32:37 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MNL00J2Q5IB9040@mailout1.samsung.com>; Thu, 30 May 2013 09:32:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id FF.B9.11618.22E96A15; Thu, 30 May 2013 09:32:34 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-c9-51a69e22c941 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BF.26.21068.22E96A15; Thu, 30 May 2013 09:32:34 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MNL00K6B5IA3D30@mmp1.samsung.com>; Thu, 30 May 2013 09:32:34 +0900 (KST) From: Jingoo Han To: 'Jean-Christophe PLAGNIOL-VILLARD' , 'Michael Hennerich' , "'Rafael J. Wysocki'" Cc: 'Lars-Peter Clausen' , 'Tomi Valkeinen' , linux-fbdev@vger.kernel.org, linux-pm@vger.kernel.org, Jingoo Han References: <1369829859-13405-1-git-send-email-lars@metafoo.de> <51A60F83.7070403@analog.com> <20130529192013.GA19468@game.jcrosoft.org> In-reply-to: <20130529192013.GA19468@game.jcrosoft.org> Subject: Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops Date: Thu, 30 May 2013 09:32:34 +0900 Message-id: <001801ce5ccd$2dd30be0$897923a0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQFlSNskbPQX9nW7XBi0xrEsv4aKbwKFJQTRATEN6R6Z0VQsEA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRmVeSWpSXmKPExsVy+t8zQ12lecsCDd59srG4vPASq8WSyfNZ LU70fWC1+Nx7hNFiwuHN7BbrHr5gsuhf2MtksX7+LTYHDo9XVx09Xl24w+Kx5M0hVo++LasY PR4tbmH0OH5jO5PH501yAexRXDYpqTmZZalF+nYJXBkn72kU3JGrWDz3B0sD42+JLkZODgkB E4nzt6+wQthiEhfurWfrYuTiEBJYxihx/ssVJpii6XdfM0EkFjFKXNnUygrh/GKU+HTsJQtI FZuAmsSXL4fZQRIiArMZJU78XMUI4jALbASqmnuAEaKli1Fi9pp3YC2cAuYSZ5Y1gm0XFrCW WPPhJlA7BweLgKrEtnMiIGFeAUuJmydPMUHYghI/Jt8Da2UW0JJYv/M4E4QtL7F5zVtmiFsV JHacfc0IYosIOEnMuDiHDaJGRGLfi3dgN0gItHJI7N08H2wvi4CAxLfJh1hA9koIyEpsOgA1 R1Li4IobLBMYJWYhWT0LyepZSFbPQrJiASPLKkbR1ILkguKk9CJTveLE3OLSvHS95PzcTYyQ +J64g/H+AetDjMlA6ycyS4km5wP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0YwZM32wVvZ9ht/Tp74l2Z0u9WLP7h0p/krN9xRG1a9P+NUaxznezclAX3ny+Xb3mz9llz cfQRh9bajxvztfhzinRmxCcvkjct2lKgsHH2J9F/ervmZCzKUm9OZj5/5NJMZY95XyV5z1SV 73mvxFKckWioxVxUnAgALnNKlGIDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thursday, May 30, 2013 4:20 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 16:24 Wed 29 May , Michael Hennerich wrote: > > On 05/29/2013 02:17 PM, Lars-Peter Clausen wrote: > > >Use dev_pm_ops instead of the legacy suspend/resume callbacks. > > > > > >Signed-off-by: Lars-Peter Clausen > > Acked-by: Michael Hennerich > > >--- > > > drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++-------- > > > 1 file changed, 14 insertions(+), 8 deletions(-) > > > > > >diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c > > >index 29d8c04..6084c17 100644 > > >--- a/drivers/video/bfin-lq035q1-fb.c > > >+++ b/drivers/video/bfin-lq035q1-fb.c > > >@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi) > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); > > > } > > >-#ifdef CONFIG_PM > > >-static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) > > >+#ifdef CONFIG_PM_SLEEP > > >+static int lq035q1_spidev_suspend(struct device *dev) > > > { > > >+ struct spi_device *spi = to_spi_device(dev); > > >+ > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); > > > } > > >-static int lq035q1_spidev_resume(struct spi_device *spi) > > >+static int lq035q1_spidev_resume(struct device *dev) > > > { > > >- int ret; > > >+ struct spi_device *spi = to_spi_device(dev); > > > struct spi_control *ctl = spi_get_drvdata(spi); > > >+ int ret; > > > ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); > > > if (ret) > > >@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi) > > > return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); > > > } > > >+ > > >+static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend, > > >+ lq035q1_spidev_resume); > > >+#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops) > > >+ > > > #else > > >-# define lq035q1_spidev_suspend NULL > > >-# define lq035q1_spidev_resume NULL > > >+#define LQ035Q1_SPIDEV_PM_OPS NULL > > > #endif > we really need to ahve a macro like for DT of_match_ptr to drop the #else Hi Jean-Christophe PLAGNIOL-VILLARD, I submitted the following patch. :) (https://patchwork.kernel.org/patch/2502971/) This patch was accepted by Rafael Wysocki, and will be merged to v3.11-rc1. Best regards, Jingoo Han > > I known it's related to this patch but someone should do it > > Rafael what do you think > > Best Regards, > J. > > > /* Power down all displays on reboot, poweroff or halt */ > > >@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) > > > info->spidrv.probe = lq035q1_spidev_probe; > > > info->spidrv.remove = lq035q1_spidev_remove; > > > info->spidrv.shutdown = lq035q1_spidev_shutdown; > > >- info->spidrv.suspend = lq035q1_spidev_suspend; > > >- info->spidrv.resume = lq035q1_spidev_resume; > > >+ info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS; > > > ret = spi_register_driver(&info->spidrv); > > > if (ret < 0) { > > > > > > -- > > Greetings, > > Michael > > > > -- > > Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen > > Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; > > Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, > > Margaret Seif > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Jean-Christophe PLAGNIOL-VILLARD --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -55,8 +55,10 @@ struct device; #ifdef CONFIG_PM extern const char power_group_name[]; /* = "power" */ +#define pm_ops_ptr(_ptr) (_ptr) #else #define power_group_name NULL +#define pm_ops_ptr(_ptr) NULL #endif