13 #include <linux/kernel.h>
14 #include <linux/module.h>
16 #include <linux/slab.h>
19 #include <linux/errno.h>
20 #include <linux/i2c.h>
43 static int i2c_pca_pf_readbyte8(
void *pd,
int reg)
49 static int i2c_pca_pf_readbyte16(
void *pd,
int reg)
55 static int i2c_pca_pf_readbyte32(
void *pd,
int reg)
61 static void i2c_pca_pf_writebyte8(
void *pd,
int reg,
int val)
67 static void i2c_pca_pf_writebyte16(
void *pd,
int reg,
int val)
73 static void i2c_pca_pf_writebyte32(
void *pd,
int reg,
int val)
80 static int i2c_pca_pf_waitforcompletion(
void *pd)
105 static void i2c_pca_pf_dummyreset(
void *pd)
112 static void i2c_pca_pf_resetchip(
void *pd)
139 pdev->
dev.platform_data;
171 i2c->
io_size = resource_size(res);
177 "PCA9564/PCA9665 at 0x%08lx",
178 (
unsigned long) res->
start);
180 i2c->
adap.dev.parent = &pdev->
dev;
193 i2c->
algo_data.wait_for_completion = i2c_pca_pf_waitforcompletion;
194 i2c->
algo_data.reset_chip = i2c_pca_pf_dummyreset;
198 i2c->
algo_data.write_byte = i2c_pca_pf_writebyte32;
199 i2c->
algo_data.read_byte = i2c_pca_pf_readbyte32;
202 i2c->
algo_data.write_byte = i2c_pca_pf_writebyte16;
203 i2c->
algo_data.read_byte = i2c_pca_pf_readbyte16;
207 i2c->
algo_data.write_byte = i2c_pca_pf_writebyte8;
208 i2c->
algo_data.read_byte = i2c_pca_pf_readbyte8;
213 if (i2c->
gpio > -1) {
217 i2c->
algo_data.reset_chip = i2c_pca_pf_resetchip;
237 platform_set_drvdata(pdev, i2c);
256 printk(
KERN_ERR "Registering PCA9564/PCA9665 FAILED! (%d)\n", ret);
263 platform_set_drvdata(pdev,
NULL);
281 .probe = i2c_pca_pf_probe,
284 .name =
"i2c-pca-platform",