From: Jingoo Han <jg1.han@samsung.com> To: 'Jean-Christophe PLAGNIOL-VILLARD' <plagnioj@jcrosoft.com>, 'Michael Hennerich' <michael.hennerich@analog.com>, "'Rafael J. Wysocki'" <rjw@sisk.pl> Cc: 'Lars-Peter Clausen' <lars@metafoo.de>, 'Tomi Valkeinen' <tomi.valkeinen@ti.com>, linux-fbdev@vger.kernel.org, linux-pm@vger.kernel.org, Jingoo Han <jg1.han@samsung.com> Subject: Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops Date: Thu, 30 May 2013 09:32:34 +0900 [thread overview] Message-ID: <001801ce5ccd$2dd30be0$897923a0$@samsung.com> (raw) In-Reply-To: <20130529192013.GA19468@game.jcrosoft.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 <lars@metafoo.de> > > Acked-by: Michael Hennerich <michael.hennerich@analog.com> > > >--- > > > 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/) --- 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 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
WARNING: multiple messages have this Message-ID (diff)
From: Jingoo Han <jg1.han@samsung.com> To: 'Jean-Christophe PLAGNIOL-VILLARD' <plagnioj@jcrosoft.com>, 'Michael Hennerich' <michael.hennerich@analog.com>, "'Rafael J. Wysocki'" <rjw@sisk.pl> Cc: 'Lars-Peter Clausen' <lars@metafoo.de>, 'Tomi Valkeinen' <tomi.valkeinen@ti.com>, linux-fbdev@vger.kernel.org, linux-pm@vger.kernel.org, Jingoo Han <jg1.han@samsung.com> Subject: Re: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops Date: Thu, 30 May 2013 00:32:34 +0000 [thread overview] Message-ID: <001801ce5ccd$2dd30be0$897923a0$@samsung.com> (raw) In-Reply-To: <20130529192013.GA19468@game.jcrosoft.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 <lars@metafoo.de> > > Acked-by: Michael Hennerich <michael.hennerich@analog.com> > > >--- > > > 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/) --- 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 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
next prev parent reply other threads:[~2013-05-30 0:32 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-05-29 12:17 [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops Lars-Peter Clausen 2013-05-29 14:24 ` Michael Hennerich 2013-05-29 19:20 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-29 19:20 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-29 21:36 ` Rafael J. Wysocki 2013-05-29 21:36 ` Rafael J. Wysocki 2013-05-30 0:32 ` Jingoo Han [this message] 2013-05-30 0:32 ` Jingoo Han 2013-05-30 7:14 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 7:14 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 7:52 ` Lars-Peter Clausen 2013-05-30 7:52 ` Lars-Peter Clausen 2013-05-30 10:45 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 10:45 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 16:32 ` Lars-Peter Clausen 2013-05-30 16:32 ` Lars-Peter Clausen 2013-05-31 3:32 ` Jingoo Han 2013-05-31 3:32 ` Jingoo Han 2013-05-31 5:01 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-31 5:01 ` Jean-Christophe PLAGNIOL-VILLARD 2013-06-02 19:30 ` Rafael J. Wysocki 2013-06-02 19:30 ` Rafael J. Wysocki 2013-06-03 5:15 ` Jingoo Han 2013-06-03 5:15 ` Jingoo Han
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='001801ce5ccd$2dd30be0$897923a0$@samsung.com' \ --to=jg1.han@samsung.com \ --cc=lars@metafoo.de \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=michael.hennerich@analog.com \ --cc=plagnioj@jcrosoft.com \ --cc=rjw@sisk.pl \ --cc=tomi.valkeinen@ti.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.