[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB904C5425BA6F4E8424B3B51A1414D171409B8860@NWD2CMBX1.ad.analog.com>
Date: Wed, 11 Jul 2012 22:51:45 -0400
From: "Zhang, Sonic" <Sonic.Zhang@...log.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>,
LKML <linux-kernel@...r.kernel.org>
CC: Linux PM list <linux-pm@...r.kernel.org>,
Linus Walleij <linus.walleij@...ricsson.com>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
Jean Delvare <khali@...ux-fr.org>,
Ben Dooks <ben-linux@...ff.org>,
Wolfram Sang <w.sang@...gutronix.de>,
Peter Korsgaard <jacmet@...site.dk>,
Guan Xuetao <gxt@...c.pku.edu.cn>,
Vitaly Wool <vitalywool@...il.com>,
Colin Cross <ccross@...roid.com>,
Stephen Warren <swarren@...dotorg.org>
Subject: RE: [PATCH 2/7] i2c-bfin-twi: Use struct dev_pm_ops for power
management
Acked-by: Sonic Zhang <sonic.zhang@...log.com>
>-----Original Message-----
>From: Rafael J. Wysocki [mailto:rjw@...k.pl]
>Sent: Thursday, July 12, 2012 3:24 AM
>To: LKML
>Cc: Linux PM list; Linus Walleij; linux-i2c@...r.kernel.org; Zhang, Sonic; Jean
>Delvare; Ben Dooks; Wolfram Sang; Peter Korsgaard; Guan Xuetao; Vitaly Wool;
>Colin Cross; Stephen Warren
>Subject: [PATCH 2/7] i2c-bfin-twi: Use struct dev_pm_ops for power management
>
>From: Rafael J. Wysocki <rjw@...k.pl>
>
>Make the Blackfin On-Chip Two Wire Interface driver define its PM
>callbacks through a struct dev_pm_ops object rather than by using
>legacy PM hooks in struct platform_driver.
>
>Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
>---
> drivers/i2c/busses/i2c-bfin-twi.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
>Index: linux/drivers/i2c/busses/i2c-bfin-twi.c
>=============================================================
>======
>--- linux.orig/drivers/i2c/busses/i2c-bfin-twi.c
>+++ linux/drivers/i2c/busses/i2c-bfin-twi.c
>@@ -611,9 +611,9 @@ static struct i2c_algorithm bfin_twi_alg
> .functionality = bfin_twi_functionality,
> };
>
>-static int i2c_bfin_twi_suspend(struct platform_device *pdev, pm_message_t
>state)
>+static int i2c_bfin_twi_suspend(struct device *dev)
> {
>- struct bfin_twi_iface *iface = platform_get_drvdata(pdev);
>+ struct bfin_twi_iface *iface = dev_get_drvdata(dev);
>
> iface->saved_clkdiv = read_CLKDIV(iface);
> iface->saved_control = read_CONTROL(iface);
>@@ -626,14 +626,14 @@ static int i2c_bfin_twi_suspend(struct p
> return 0;
> }
>
>-static int i2c_bfin_twi_resume(struct platform_device *pdev)
>+static int i2c_bfin_twi_resume(struct device *dev)
> {
>- struct bfin_twi_iface *iface = platform_get_drvdata(pdev);
>+ struct bfin_twi_iface *iface = dev_get_drvdata(dev);
>
> int rc = request_irq(iface->irq, bfin_twi_interrupt_entry,
>- 0, pdev->name, iface);
>+ 0, to_platform_device(dev)->name, iface);
> if (rc) {
>- dev_err(&pdev->dev, "Can't get IRQ %d !\n", iface->irq);
>+ dev_err(dev, "Can't get IRQ %d !\n", iface->irq);
> return -ENODEV;
> }
>
>@@ -646,6 +646,9 @@ static int i2c_bfin_twi_resume(struct pl
> return 0;
> }
>
>+static SIMPLE_DEV_PM_OPS(i2c_bfin_twi_pm,
>+ i2c_bfin_twi_suspend, i2c_bfin_twi_resume);
>+
> static int i2c_bfin_twi_probe(struct platform_device *pdev)
> {
> struct bfin_twi_iface *iface;
>@@ -770,11 +773,10 @@ static int i2c_bfin_twi_remove(struct pl
> static struct platform_driver i2c_bfin_twi_driver = {
> .probe = i2c_bfin_twi_probe,
> .remove = i2c_bfin_twi_remove,
>- .suspend = i2c_bfin_twi_suspend,
>- .resume = i2c_bfin_twi_resume,
> .driver = {
> .name = "i2c-bfin-twi",
> .owner = THIS_MODULE,
>+ .pm = &i2c_bfin_twi_pm,
> },
> };
>
>
Powered by blists - more mailing lists