10 #include <linux/input.h>
11 #include <linux/i2c.h>
12 #include <linux/module.h>
13 #include <linux/types.h>
17 static int adxl34x_smbus_read(
struct device *
dev,
unsigned char reg)
24 static int adxl34x_smbus_write(
struct device *
dev,
25 unsigned char reg,
unsigned char val)
32 static int adxl34x_smbus_read_block(
struct device *
dev,
41 static int adxl34x_i2c_read_block(
struct device *
dev,
64 .write = adxl34x_smbus_write,
65 .read = adxl34x_smbus_read,
66 .read_block = adxl34x_smbus_read_block,
71 .write = adxl34x_smbus_write,
72 .read = adxl34x_smbus_read,
73 .read_block = adxl34x_i2c_read_block,
82 error = i2c_check_functionality(client->
adapter,
85 dev_err(&client->
dev,
"SMBUS Byte Data not Supported\n");
90 i2c_check_functionality(client->
adapter,
92 &adxl34x_smbus_bops : &adxl34x_i2c_bops);
96 i2c_set_clientdata(client, ac);
103 struct adxl34x *ac = i2c_get_clientdata(client);
109 static int adxl34x_i2c_suspend(
struct device *dev)
112 struct adxl34x *ac = i2c_get_clientdata(client);
119 static int adxl34x_i2c_resume(
struct device *dev)
122 struct adxl34x *ac = i2c_get_clientdata(client);
144 .pm = &adxl34x_i2c_pm,
146 .probe = adxl34x_i2c_probe,
148 .id_table = adxl34x_id,