aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/adxl34x-i2c.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-20 01:27:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-20 01:27:06 -0400
commita952baa034ae7c2e4a66932005cbc7ebbccfe28d (patch)
treeff5abe0c77f5b129946300677d9b57b00d926a1e /drivers/input/misc/adxl34x-i2c.c
parent5bab188a316718a26346cdb25c4cc6b319f8f907 (diff)
parent97eb3f24352ec6632c2127b35d8087d2a809a9b9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (64 commits) Input: tsc2005 - remove 'disable' sysfs attribute Input: tsc2005 - add open/close Input: tsc2005 - handle read errors from SPI layer Input: tsc2005 - do not rearm timer in hardirq handler Input: tsc2005 - don't use work for 'pen up' handling Input: tsc2005 - do not use 0 in place of NULL Input: tsc2005 - use true/false for boolean variables Input: tsc2005 - hide selftest attribute if we can't reset Input: tsc2005 - rework driver initialization code Input: tsc2005 - set up bus type in input device Input: tsc2005 - set up parent device Input: tsc2005 - clear driver data after unbinding Input: tsc2005 - add module description Input: tsc2005 - remove driver banner message Input: tsc2005 - remove incorrect module alias Input: tsc2005 - convert to using dev_pm_ops Input: tsc2005 - use spi_get/set_drvdata() Input: introduce tsc2005 driver Input: xen-kbdfront - move to drivers/input/misc Input: xen-kbdfront - add grant reference for shared page ...
Diffstat (limited to 'drivers/input/misc/adxl34x-i2c.c')
-rw-r--r--drivers/input/misc/adxl34x-i2c.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c
index 0779724af7e7..ccacf2bb06a4 100644
--- a/drivers/input/misc/adxl34x-i2c.c
+++ b/drivers/input/misc/adxl34x-i2c.c
@@ -11,6 +11,7 @@
11#include <linux/i2c.h> 11#include <linux/i2c.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/pm.h>
14#include "adxl34x.h" 15#include "adxl34x.h"
15 16
16static int adxl34x_smbus_read(struct device *dev, unsigned char reg) 17static int adxl34x_smbus_read(struct device *dev, unsigned char reg)
@@ -105,8 +106,9 @@ static int __devexit adxl34x_i2c_remove(struct i2c_client *client)
105} 106}
106 107
107#ifdef CONFIG_PM 108#ifdef CONFIG_PM
108static int adxl34x_i2c_suspend(struct i2c_client *client, pm_message_t message) 109static int adxl34x_i2c_suspend(struct device *dev)
109{ 110{
111 struct i2c_client *client = to_i2c_client(dev);
110 struct adxl34x *ac = i2c_get_clientdata(client); 112 struct adxl34x *ac = i2c_get_clientdata(client);
111 113
112 adxl34x_suspend(ac); 114 adxl34x_suspend(ac);
@@ -114,19 +116,20 @@ static int adxl34x_i2c_suspend(struct i2c_client *client, pm_message_t message)
114 return 0; 116 return 0;
115} 117}
116 118
117static int adxl34x_i2c_resume(struct i2c_client *client) 119static int adxl34x_i2c_resume(struct device *dev)
118{ 120{
121 struct i2c_client *client = to_i2c_client(dev);
119 struct adxl34x *ac = i2c_get_clientdata(client); 122 struct adxl34x *ac = i2c_get_clientdata(client);
120 123
121 adxl34x_resume(ac); 124 adxl34x_resume(ac);
122 125
123 return 0; 126 return 0;
124} 127}
125#else
126# define adxl34x_i2c_suspend NULL
127# define adxl34x_i2c_resume NULL
128#endif 128#endif
129 129
130static SIMPLE_DEV_PM_OPS(adxl34x_i2c_pm, adxl34x_i2c_suspend,
131 adxl34x_i2c_resume);
132
130static const struct i2c_device_id adxl34x_id[] = { 133static const struct i2c_device_id adxl34x_id[] = {
131 { "adxl34x", 0 }, 134 { "adxl34x", 0 },
132 { } 135 { }
@@ -138,11 +141,10 @@ static struct i2c_driver adxl34x_driver = {
138 .driver = { 141 .driver = {
139 .name = "adxl34x", 142 .name = "adxl34x",
140 .owner = THIS_MODULE, 143 .owner = THIS_MODULE,
144 .pm = &adxl34x_i2c_pm,
141 }, 145 },
142 .probe = adxl34x_i2c_probe, 146 .probe = adxl34x_i2c_probe,
143 .remove = __devexit_p(adxl34x_i2c_remove), 147 .remove = __devexit_p(adxl34x_i2c_remove),
144 .suspend = adxl34x_i2c_suspend,
145 .resume = adxl34x_i2c_resume,
146 .id_table = adxl34x_id, 148 .id_table = adxl34x_id,
147}; 149};
148 150