* [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops
@ 2011-01-20 21:10 Mark Brown
2011-01-20 21:10 ` [PATCH 2/3] Input: ad7879 - Convert SPI " Mark Brown
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Mark Brown @ 2011-01-20 21:10 UTC (permalink / raw)
To: Michael Hennerich, Dmitry Torokhov, Mike Frysinger
Cc: linux-input, Mark Brown
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the ad7879 SPI driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/input/touchscreen/ad7877.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index a1952fc..714d4e0 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -41,6 +41,7 @@
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/interrupt.h>
+#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/ad7877.h>
@@ -826,39 +827,37 @@ static int __devexit ad7877_remove(struct spi_device *spi)
return 0;
}
-#ifdef CONFIG_PM
-static int ad7877_suspend(struct spi_device *spi, pm_message_t message)
+#ifdef CONFIG_PM_SLEEP
+static int ad7877_suspend(struct device *dev)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = dev_get_drvdata(dev);
ad7877_disable(ts);
return 0;
}
-static int ad7877_resume(struct spi_device *spi)
+static int ad7877_resume(struct device *dev)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = dev_get_drvdata(dev);
ad7877_enable(ts);
return 0;
}
-#else
-#define ad7877_suspend NULL
-#define ad7877_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
+
static struct spi_driver ad7877_driver = {
.driver = {
.name = "ad7877",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
+ .pm = &ad7877_pm,
},
.probe = ad7877_probe,
.remove = __devexit_p(ad7877_remove),
- .suspend = ad7877_suspend,
- .resume = ad7877_resume,
};
static int __init ad7877_init(void)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] Input: ad7879 - Convert SPI to dev_pm_ops
2011-01-20 21:10 [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops Mark Brown
@ 2011-01-20 21:10 ` Mark Brown
2011-01-20 21:19 ` Hennerich, Michael
2011-01-20 21:10 ` [PATCH 3/3] Input: ads7846 - Convert " Mark Brown
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2011-01-20 21:10 UTC (permalink / raw)
To: Michael Hennerich, Dmitry Torokhov, Mike Frysinger
Cc: linux-input, Mark Brown
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the ad7979 SPI driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/input/touchscreen/ad7879-spi.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/input/touchscreen/ad7879-spi.c b/drivers/input/touchscreen/ad7879-spi.c
index 59c6e68..ddf732f 100644
--- a/drivers/input/touchscreen/ad7879-spi.c
+++ b/drivers/input/touchscreen/ad7879-spi.c
@@ -7,6 +7,7 @@
*/
#include <linux/input.h> /* BUS_SPI */
+#include <linux/pm.h>
#include <linux/spi/spi.h>
#include "ad7879.h"
@@ -20,9 +21,10 @@
#define AD7879_WRITECMD(reg) (AD7879_CMD(reg))
#define AD7879_READCMD(reg) (AD7879_CMD(reg) | AD7879_CMD_READ)
-#ifdef CONFIG_PM
-static int ad7879_spi_suspend(struct spi_device *spi, pm_message_t message)
+#ifdef CONFIG_PM_SLEEP
+static int ad7879_spi_suspend(struct device *dev)
{
+ struct spi_device *spi = to_spi_device(dev);
struct ad7879 *ts = spi_get_drvdata(spi);
ad7879_suspend(ts);
@@ -30,19 +32,19 @@ static int ad7879_spi_suspend(struct spi_device *spi, pm_message_t message)
return 0;
}
-static int ad7879_spi_resume(struct spi_device *spi)
+static int ad7879_spi_resume(struct device *dev)
{
+ struct spi_device *spi = to_spi_device(dev);
struct ad7879 *ts = spi_get_drvdata(spi);
ad7879_resume(ts);
return 0;
}
-#else
-# define ad7879_spi_suspend NULL
-# define ad7879_spi_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(ad7879_spi_pm, ad7879_spi_suspend, ad7879_spi_resume);
+
/*
* ad7879_read/write are only used for initial setup and for sysfs controls.
* The main traffic is done in ad7879_collect().
@@ -173,11 +175,10 @@ static struct spi_driver ad7879_spi_driver = {
.name = "ad7879",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
+ .pm = &ad7879_spi_pm,
},
.probe = ad7879_spi_probe,
.remove = __devexit_p(ad7879_spi_remove),
- .suspend = ad7879_spi_suspend,
- .resume = ad7879_spi_resume,
};
static int __init ad7879_spi_init(void)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH 2/3] Input: ad7879 - Convert SPI to dev_pm_ops
2011-01-20 21:10 ` [PATCH 2/3] Input: ad7879 - Convert SPI " Mark Brown
@ 2011-01-20 21:19 ` Hennerich, Michael
0 siblings, 0 replies; 8+ messages in thread
From: Hennerich, Michael @ 2011-01-20 21:19 UTC (permalink / raw)
To: Mark Brown, Dmitry Torokhov, Mike Frysinger
Cc: linux-input@vger.kernel.org,
device-drivers-devel@blackfin.uclinux.org
Mark Brown wrote on 2011-01-20:
> There is a move to deprecate bus-specific PM operations and move to
> using dev_pm_ops instead in order to reduce the amount of boilerplate
> code in buses and facilitiate updates to the PM core. Do this move for
> the ad7979 SPI driver.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com>
> ---
> drivers/input/touchscreen/ad7879-spi.c | 17 +++++++++--------
> 1 files changed, 9 insertions(+), 8 deletions(-)
> diff --git a/drivers/input/touchscreen/ad7879-spi.c
> b/drivers/input/touchscreen/ad7879-spi.c index 59c6e68..ddf732f 100644
> --- a/drivers/input/touchscreen/ad7879-spi.c +++
> b/drivers/input/touchscreen/ad7879-spi.c @@ -7,6 +7,7 @@
> */
> #include <linux/input.h> /* BUS_SPI */ +#include <linux/pm.h> #include
> <linux/spi/spi.h>
>
> #include "ad7879.h" @@ -20,9 +21,10 @@ #define AD7879_WRITECMD(reg)
> (AD7879_CMD(reg)) #define
> AD7879_READCMD(reg) (AD7879_CMD(reg) | AD7879_CMD_READ)
>
> -#ifdef CONFIG_PM -static int ad7879_spi_suspend(struct spi_device *spi,
> pm_message_t message) +#ifdef CONFIG_PM_SLEEP +static int
> ad7879_spi_suspend(struct device *dev)
> { + struct spi_device *spi = to_spi_device(dev); struct ad7879 *ts =
> spi_get_drvdata(spi);
>
> ad7879_suspend(ts);
> @@ -30,19 +32,19 @@ static int ad7879_spi_suspend(struct spi_device
> *spi, pm_message_t message)
> return 0;
> }
> -static int ad7879_spi_resume(struct spi_device *spi)
> +static int ad7879_spi_resume(struct device *dev)
> { + struct spi_device *spi = to_spi_device(dev); struct ad7879 *ts =
> spi_get_drvdata(spi);
>
> ad7879_resume(ts);
>
> return 0;
> }
> -#else
> -# define ad7879_spi_suspend NULL
> -# define ad7879_spi_resume NULL
> #endif
> +static SIMPLE_DEV_PM_OPS(ad7879_spi_pm, ad7879_spi_suspend,
> +ad7879_spi_resume); +
> /*
> * ad7879_read/write are only used for initial setup and for sysfs
> controls. * The main traffic is done in ad7879_collect().
> @@ -173,11 +175,10 @@ static struct spi_driver ad7879_spi_driver = {
> .name = "ad7879", .bus = &spi_bus_type, .owner = THIS_MODULE,
> + .pm = &ad7879_spi_pm, }, .probe = ad7879_spi_probe, .remove =
> __devexit_p(ad7879_spi_remove),
> - .suspend = ad7879_spi_suspend,
> - .resume = ad7879_spi_resume,
> };
>
> static int __init ad7879_spi_init(void)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] Input: ads7846 - Convert to dev_pm_ops
2011-01-20 21:10 [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops Mark Brown
2011-01-20 21:10 ` [PATCH 2/3] Input: ad7879 - Convert SPI " Mark Brown
@ 2011-01-20 21:10 ` Mark Brown
2011-01-20 21:20 ` Hennerich, Michael
2011-01-20 21:19 ` [PATCH 1/3] Input: ad7877 " Hennerich, Michael
2011-01-21 6:56 ` Dmitry Torokhov
3 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2011-01-20 21:10 UTC (permalink / raw)
To: Michael Hennerich, Dmitry Torokhov, Mike Frysinger
Cc: linux-input, Mark Brown
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the ads7846 driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/input/touchscreen/ads7846.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 14ea54b..b31e90f 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -26,6 +26,7 @@
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
+#include <linux/pm.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
@@ -892,9 +893,10 @@ static irqreturn_t ads7846_irq(int irq, void *handle)
return IRQ_HANDLED;
}
-static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
+#ifdef CONFIG_PM_SLEEP
+static int ads7846_suspend(struct device *dev)
{
- struct ads7846 *ts = dev_get_drvdata(&spi->dev);
+ struct ads7846 *ts = dev_get_drvdata(dev);
mutex_lock(&ts->lock);
@@ -914,9 +916,9 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
return 0;
}
-static int ads7846_resume(struct spi_device *spi)
+static int ads7846_resume(struct device *dev)
{
- struct ads7846 *ts = dev_get_drvdata(&spi->dev);
+ struct ads7846 *ts = dev_get_drvdata(dev);
mutex_lock(&ts->lock);
@@ -935,6 +937,9 @@ static int ads7846_resume(struct spi_device *spi)
return 0;
}
+#endif
+
+static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts)
{
@@ -1402,11 +1407,10 @@ static struct spi_driver ads7846_driver = {
.name = "ads7846",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
+ .pm = &ads7846_pm,
},
.probe = ads7846_probe,
.remove = __devexit_p(ads7846_remove),
- .suspend = ads7846_suspend,
- .resume = ads7846_resume,
};
static int __init ads7846_init(void)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH 3/3] Input: ads7846 - Convert to dev_pm_ops
2011-01-20 21:10 ` [PATCH 3/3] Input: ads7846 - Convert " Mark Brown
@ 2011-01-20 21:20 ` Hennerich, Michael
0 siblings, 0 replies; 8+ messages in thread
From: Hennerich, Michael @ 2011-01-20 21:20 UTC (permalink / raw)
To: Mark Brown, Dmitry Torokhov, Mike Frysinger; +Cc: linux-input@vger.kernel.org
Mark Brown wrote on 2011-01-20:
> There is a move to deprecate bus-specific PM operations and move to
> using dev_pm_ops instead in order to reduce the amount of boilerplate
> code in buses and facilitiate updates to the PM core. Do this move for
> the ads7846 driver.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Looks good to me.
Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com>
> ---
> drivers/input/touchscreen/ads7846.c | 16 ++++++++++------
> 1 files changed, 10 insertions(+), 6 deletions(-)
> diff --git a/drivers/input/touchscreen/ads7846.c
> b/drivers/input/touchscreen/ads7846.c index 14ea54b..b31e90f 100644 ---
> a/drivers/input/touchscreen/ads7846.c +++
> b/drivers/input/touchscreen/ads7846.c @@ -26,6 +26,7 @@
> #include <linux/input.h> #include <linux/interrupt.h> #include
> <linux/slab.h> +#include <linux/pm.h> #include <linux/gpio.h> #include
> <linux/spi/spi.h> #include <linux/spi/ads7846.h>
> @@ -892,9 +893,10 @@ static irqreturn_t ads7846_irq(int irq, void
> *handle)
> return IRQ_HANDLED;
> }
> -static int ads7846_suspend(struct spi_device *spi, pm_message_t
> message) +#ifdef CONFIG_PM_SLEEP +static int ads7846_suspend(struct
> device *dev)
> {
> - struct ads7846 *ts = dev_get_drvdata(&spi->dev);
> + struct ads7846 *ts = dev_get_drvdata(dev);
>
> mutex_lock(&ts->lock);
> @@ -914,9 +916,9 @@ static int ads7846_suspend(struct spi_device *spi,
> pm_message_t message)
> return 0;
> }
> -static int ads7846_resume(struct spi_device *spi)
> +static int ads7846_resume(struct device *dev)
> {
> - struct ads7846 *ts = dev_get_drvdata(&spi->dev);
> + struct ads7846 *ts = dev_get_drvdata(dev);
>
> mutex_lock(&ts->lock);
> @@ -935,6 +937,9 @@ static int ads7846_resume(struct spi_device *spi)
>
> return 0;
> }
> +#endif + +static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend,
> +ads7846_resume);
>
> static int __devinit ads7846_setup_pendown(struct spi_device *spi,
> struct ads7846 *ts) { @@ -1402,11 +1407,10 @@ static struct
> spi_driver ads7846_driver = {
> .name = "ads7846", .bus = &spi_bus_type, .owner = THIS_MODULE,
> + .pm = &ads7846_pm, }, .probe = ads7846_probe, .remove =
> __devexit_p(ads7846_remove),
> - .suspend = ads7846_suspend,
> - .resume = ads7846_resume,
> };
>
> static int __init ads7846_init(void)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops
2011-01-20 21:10 [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops Mark Brown
2011-01-20 21:10 ` [PATCH 2/3] Input: ad7879 - Convert SPI " Mark Brown
2011-01-20 21:10 ` [PATCH 3/3] Input: ads7846 - Convert " Mark Brown
@ 2011-01-20 21:19 ` Hennerich, Michael
2011-01-21 6:56 ` Dmitry Torokhov
3 siblings, 0 replies; 8+ messages in thread
From: Hennerich, Michael @ 2011-01-20 21:19 UTC (permalink / raw)
To: Mark Brown, Dmitry Torokhov, Mike Frysinger
Cc: linux-input@vger.kernel.org,
device-drivers-devel@blackfin.uclinux.org
Mark Brown wrote on 2011-01-20:
> There is a move to deprecate bus-specific PM operations and move to
> using dev_pm_ops instead in order to reduce the amount of boilerplate
> code in buses and facilitiate updates to the PM core. Do this move for
> the ad7879 SPI driver.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com>
> ---
> drivers/input/touchscreen/ad7877.c | 19 +++++++++----------
> 1 files changed, 9 insertions(+), 10 deletions(-)
> diff --git a/drivers/input/touchscreen/ad7877.c
> b/drivers/input/touchscreen/ad7877.c index a1952fc..714d4e0 100644 ---
> a/drivers/input/touchscreen/ad7877.c +++
> b/drivers/input/touchscreen/ad7877.c @@ -41,6 +41,7 @@
> #include <linux/delay.h> #include <linux/input.h> #include
> <linux/interrupt.h> +#include <linux/pm.h> #include <linux/slab.h>
> #include <linux/spi/spi.h> #include <linux/spi/ad7877.h>
> @@ -826,39 +827,37 @@ static int __devexit ad7877_remove(struct
> spi_device *spi)
> return 0;
> }
> -#ifdef CONFIG_PM -static int ad7877_suspend(struct spi_device *spi,
> pm_message_t message) +#ifdef CONFIG_PM_SLEEP +static int
> ad7877_suspend(struct device *dev)
> {
> - struct ad7877 *ts = dev_get_drvdata(&spi->dev);
> + struct ad7877 *ts = dev_get_drvdata(dev);
>
> ad7877_disable(ts);
>
> return 0;
> }
> -static int ad7877_resume(struct spi_device *spi)
> +static int ad7877_resume(struct device *dev)
> {
> - struct ad7877 *ts = dev_get_drvdata(&spi->dev);
> + struct ad7877 *ts = dev_get_drvdata(dev);
>
> ad7877_enable(ts);
>
> return 0;
> }
> -#else
> -#define ad7877_suspend NULL
> -#define ad7877_resume NULL
> #endif
> +static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
> +
> static struct spi_driver ad7877_driver = { .driver = { .name =
> "ad7877", .bus = &spi_bus_type, .owner = THIS_MODULE, + .pm =
> &ad7877_pm, }, .probe = ad7877_probe, .remove =
> __devexit_p(ad7877_remove),
> - .suspend = ad7877_suspend,
> - .resume = ad7877_resume,
> };
>
> static int __init ad7877_init(void)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops
2011-01-20 21:10 [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops Mark Brown
` (2 preceding siblings ...)
2011-01-20 21:19 ` [PATCH 1/3] Input: ad7877 " Hennerich, Michael
@ 2011-01-21 6:56 ` Dmitry Torokhov
3 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2011-01-21 6:56 UTC (permalink / raw)
To: Mark Brown; +Cc: Michael Hennerich, Mike Frysinger, linux-input
On Thu, Jan 20, 2011 at 09:10:21PM +0000, Mark Brown wrote:
> There is a move to deprecate bus-specific PM operations and move to
> using dev_pm_ops instead in order to reduce the amount of boilerplate
> code in buses and facilitiate updates to the PM core. Do this move for
> the ad7879 SPI driver.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Applied all 3 to next, thanks Mark.
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops
@ 2011-01-19 12:45 Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2011-01-19 12:45 UTC (permalink / raw)
To: Michael Hennerich, Dmitry Torokhov
Cc: Mike Frysinger, linux-input, Mark Brown
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the ad7879 SPI driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/input/touchscreen/ad7877.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index a1952fc..6ee868f 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -41,6 +41,7 @@
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/interrupt.h>
+#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/ad7877.h>
@@ -827,26 +828,25 @@ static int __devexit ad7877_remove(struct spi_device *spi)
}
#ifdef CONFIG_PM
-static int ad7877_suspend(struct spi_device *spi, pm_message_t message)
+static int ad7877_suspend(struct device *dev)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = dev_get_drvdata(dev);
ad7877_disable(ts);
return 0;
}
-static int ad7877_resume(struct spi_device *spi)
+static int ad7877_resume(struct device *dev)
{
- struct ad7877 *ts = dev_get_drvdata(&spi->dev);
+ struct ad7877 *ts = dev_get_drvdata(dev);
ad7877_enable(ts);
return 0;
}
-#else
-#define ad7877_suspend NULL
-#define ad7877_resume NULL
+
+static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
#endif
static struct spi_driver ad7877_driver = {
@@ -854,11 +854,12 @@ static struct spi_driver ad7877_driver = {
.name = "ad7877",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &ad7877_pm,
+#endif
},
.probe = ad7877_probe,
.remove = __devexit_p(ad7877_remove),
- .suspend = ad7877_suspend,
- .resume = ad7877_resume,
};
static int __init ad7877_init(void)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-01-21 6:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 21:10 [PATCH 1/3] Input: ad7877 - Convert to dev_pm_ops Mark Brown
2011-01-20 21:10 ` [PATCH 2/3] Input: ad7879 - Convert SPI " Mark Brown
2011-01-20 21:19 ` Hennerich, Michael
2011-01-20 21:10 ` [PATCH 3/3] Input: ads7846 - Convert " Mark Brown
2011-01-20 21:20 ` Hennerich, Michael
2011-01-20 21:19 ` [PATCH 1/3] Input: ad7877 " Hennerich, Michael
2011-01-21 6:56 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2011-01-19 12:45 Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).