21 #include <linux/kernel.h>
22 #include <linux/module.h>
26 #include <linux/slab.h>
29 #include <linux/i2c.h>
39 #define CMD_SET_SDA (1<<2)
40 #define CMD_SET_SCL (1<<3)
42 #define STATE_SDA (1<<0)
43 #define STATE_SCL (1<<1)
47 static void simtec_i2c_setsda(
void *
pw,
int state)
53 static void simtec_i2c_setscl(
void *
pw,
int state)
59 static int simtec_i2c_getsda(
void *pw)
65 static int simtec_i2c_getscl(
void *pw)
82 dev_err(&dev->
dev,
"cannot allocate private data\n");
86 platform_set_drvdata(dev, pd);
90 dev_err(&dev->
dev,
"cannot find IO resource\n");
95 size = resource_size(res);
115 pd->
adap.dev.parent = &dev->
dev;
120 pd->
bit.setsda = simtec_i2c_setsda;
121 pd->
bit.setscl = simtec_i2c_setscl;
122 pd->
bit.getsda = simtec_i2c_getsda;
123 pd->
bit.getscl = simtec_i2c_getscl;
124 pd->
bit.timeout =
HZ;
163 .name =
"simtec-i2c",
166 .probe = simtec_i2c_probe,
167 .remove = simtec_i2c_remove,