17 #include <linux/module.h>
20 #include <linux/slab.h>
21 #include <linux/i2c.h>
25 static struct mfd_cell tps6507x_devs[] = {
27 .name =
"tps6507x-pmic",
30 .name =
"tps6507x-ts",
35 static int tps6507x_i2c_read_device(
struct tps6507x_dev *tps6507x,
char reg,
43 xfer[0].addr = i2c->
addr;
49 xfer[1].addr = i2c->
addr;
63 static int tps6507x_i2c_write_device(
struct tps6507x_dev *tps6507x,
char reg,
75 memcpy(&msg[1], src, bytes);
85 static int tps6507x_i2c_probe(
struct i2c_client *i2c,
95 i2c_set_clientdata(i2c, tps6507x);
98 tps6507x->
read_dev = tps6507x_i2c_read_device;
99 tps6507x->
write_dev = tps6507x_i2c_write_device;
116 static int tps6507x_i2c_remove(
struct i2c_client *i2c)
118 struct tps6507x_dev *tps6507x = i2c_get_clientdata(i2c);
133 static struct i2c_driver tps6507x_i2c_driver = {
138 .probe = tps6507x_i2c_probe,
139 .remove = tps6507x_i2c_remove,
140 .id_table = tps6507x_i2c_id,
143 static int __init tps6507x_i2c_init(
void)
145 return i2c_add_driver(&tps6507x_i2c_driver);
150 static void __exit tps6507x_i2c_exit(
void)