21 #include <linux/kernel.h>
23 #include <linux/module.h>
29 #include <linux/wait.h>
31 #include <linux/i2c.h>
37 #define DRIVER "i2c-pca-isa"
40 static unsigned long base;
45 static int clock = 59000;
50 static void pca_isa_writebyte(
void *pd,
int reg,
int val)
53 static char *names[] = {
"T/O",
"DAT",
"ADR",
"CON" };
60 static int pca_isa_readbyte(
void *pd,
int reg)
65 static char *names[] = {
"STA",
"DAT",
"ADR",
"CON" };
72 static int pca_isa_waitforcompletion(
void *pd)
83 timeout =
jiffies + pca_isa_ops.timeout;
96 static void pca_isa_resetchip(
void *pd)
109 .write_byte = pca_isa_writebyte,
110 .read_byte = pca_isa_readbyte,
111 .wait_for_completion = pca_isa_waitforcompletion,
112 .reset_chip = pca_isa_resetchip,
117 .algo_data = &pca_isa_data,
118 .name =
"PCA9564/PCA9665 ISA Adapter",
128 dev_warn(dev,
"Using polling mode (specify irq)\n");
130 dev_err(dev,
"Please specify I/O base\n");
135 static int __devinit pca_isa_probe(
struct device *dev,
unsigned int id)
139 dev_info(dev,
"i/o base %#08lx. irq %d\n", base, irq);
143 dev_err(dev,
"I/O address %#08lx is not available\n", base);
149 dev_err(dev,
"I/O address %#08lx is in use\n", base);
154 if (
request_irq(irq, pca_handler, 0,
"i2c-pca-isa", &pca_isa_ops) < 0) {
155 dev_err(dev,
"Request irq%d failed\n", irq);
162 dev_err(dev,
"Failed to add i2c bus\n");
177 static int __devexit pca_isa_remove(
struct device *dev,
unsigned int id)
191 .match = pca_isa_match,
192 .probe = pca_isa_probe,
200 static int __init pca_isa_init(
void)
205 static void __exit pca_isa_exit(
void)
221 "For PCA9564: 330000,288000,217000,146000,"
222 "88000,59000,44000,36000\n"
223 "\t\tFor PCA9665:\tStandard: 60300 - 100099\n"
224 "\t\t\t\tFast: 100100 - 400099\n"
225 "\t\t\t\tFast+: 400100 - 10000099\n"
226 "\t\t\t\tTurbo: Up to 1265800");