Input: adxl34 - make enable/disable separate from suspend/resume
Suspending and resuming the device should be separate from enabling
and disabling it through sysfs attribute and thus should not alter
ac->disabled flag.
[michael.hennerich@analog.com: various fixups]
Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c
index 7f99235..782de9e 100644
--- a/drivers/input/misc/adxl34x-spi.c
+++ b/drivers/input/misc/adxl34x-spi.c
@@ -94,26 +94,26 @@
}
#ifdef CONFIG_PM
-static int adxl34x_suspend(struct spi_device *spi, pm_message_t message)
+static int adxl34x_spi_suspend(struct spi_device *spi, pm_message_t message)
{
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
- adxl34x_disable(ac);
+ adxl34x_suspend(ac);
return 0;
}
-static int adxl34x_resume(struct spi_device *spi)
+static int adxl34x_spi_resume(struct spi_device *spi)
{
struct adxl34x *ac = dev_get_drvdata(&spi->dev);
- adxl34x_enable(ac);
+ adxl34x_resume(ac);
return 0;
}
#else
-# define adxl34x_suspend NULL
-# define adxl34x_resume NULL
+# define adxl34x_spi_suspend NULL
+# define adxl34x_spi_resume NULL
#endif
static struct spi_driver adxl34x_driver = {
@@ -124,8 +124,8 @@
},
.probe = adxl34x_spi_probe,
.remove = __devexit_p(adxl34x_spi_remove),
- .suspend = adxl34x_suspend,
- .resume = adxl34x_resume,
+ .suspend = adxl34x_spi_suspend,
+ .resume = adxl34x_spi_resume,
};
static int __init adxl34x_spi_init(void)