7 #include <linux/module.h>
8 #include <linux/kernel.h>
9 #include <linux/types.h>
10 #include <linux/slab.h>
11 #include <linux/sched.h>
12 #include <linux/wait.h>
24 #define I2C_PCF_PIN 0x80
25 #define I2C_PCF_ESO 0x40
26 #define I2C_PCF_ES1 0x20
27 #define I2C_PCF_ES2 0x10
28 #define I2C_PCF_ENI 0x08
29 #define I2C_PCF_STA 0x04
30 #define I2C_PCF_STO 0x02
31 #define I2C_PCF_ACK 0x01
33 #define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ENI | I2C_PCF_STA | I2C_PCF_ACK)
34 #define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
35 #define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
36 #define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
38 #define I2C_PCF_INI 0x40
39 #define I2C_PCF_STS 0x20
40 #define I2C_PCF_BER 0x10
41 #define I2C_PCF_AD0 0x08
42 #define I2C_PCF_LRB 0x08
43 #define I2C_PCF_AAS 0x04
44 #define I2C_PCF_LAB 0x02
45 #define I2C_PCF_BB 0x01
59 if (bp->
devs[i].device == op) {
66 #define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1)
67 #define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0)
75 if (!(op = bp->
devs[
i].device))
106 client->
bus = reg[0];
131 while (limit-- > 0) {
162 if (wait_for_pin(bp, &status))
166 if (wait_for_pin(bp, &status) ||
171 if (wait_for_pin(bp, &status))
192 if (wait_for_pin(bp, &status))
196 if (wait_for_pin(bp, &status) ||
206 if (wait_for_pin(bp, &status))
213 if (wait_for_pin(bp, &status))
218 if (wait_for_pin(bp, &status))
231 char *
buf,
int len,
int off)
247 char *
buf,
int len,
int off)
324 for (dp = op->
dev.of_node->child;
339 printk(
KERN_INFO "i2c-%d: Regs at %p, %d devices, own %02x, clock %02x.\n",
363 bp = attach_one_i2c(op, index);
403 .compatible =
"SUNW,bbc-i2c",
413 .of_match_table = bbc_i2c_match,
415 .probe = bbc_i2c_probe,