11 #include <linux/kernel.h>
12 #include <linux/module.h>
13 #include <linux/i2c.h>
17 #include <linux/slab.h>
21 #define I2C_CONTROL 0x00
22 #define I2C_CONTROLS 0x00
23 #define I2C_CONTROLC 0x04
33 static void i2c_versatile_setsda(
void *
data,
int state)
40 static void i2c_versatile_setscl(
void *
data,
int state)
47 static int i2c_versatile_getsda(
void *
data)
53 static int i2c_versatile_getscl(
void *
data)
60 .setsda = i2c_versatile_setsda,
61 .setscl = i2c_versatile_setscl,
62 .getsda = i2c_versatile_getsda,
63 .getscl = i2c_versatile_getscl,
100 strlcpy(i2c->
adap.name,
"Versatile I2C adapter",
sizeof(i2c->
adap.name));
102 i2c->
adap.dev.parent = &dev->
dev;
103 i2c->
adap.dev.of_node = dev->
dev.of_node;
104 i2c->
algo = i2c_versatile_algo;
105 i2c->
algo.data = i2c;
110 platform_set_drvdata(dev, i2c);
128 platform_set_drvdata(dev,
NULL);
134 static const struct of_device_id i2c_versatile_match[] = {
135 { .compatible =
"arm,versatile-i2c", },
141 .probe = i2c_versatile_probe,
142 .remove = i2c_versatile_remove,
144 .name =
"versatile-i2c",
146 .of_match_table = i2c_versatile_match,
150 static int __init i2c_versatile_init(
void)
155 static void __exit i2c_versatile_exit(
void)