11 #include <linux/module.h>
12 #include <linux/kernel.h>
15 #include <linux/pci.h>
23 #define SCL_DIR_MASK 0x0001
24 #define SCL_DIR 0x0002
25 #define SCL_VAL_MASK 0x0004
26 #define SCL_VAL_OUT 0x0008
27 #define SCL_VAL_IN 0x0010
28 #define SDA_DIR_MASK 0x0100
29 #define SDA_DIR 0x0200
30 #define SDA_VAL_MASK 0x0400
31 #define SDA_VAL_OUT 0x0800
32 #define SDA_VAL_IN 0x1000
37 #define DPRINTK(fmt, args...) printk(fmt,## args)
39 #define DPRINTK(fmt, args...)
42 static void i810i2c_setscl(
void *
data,
int state)
55 static void i810i2c_setsda(
void *
data,
int state)
68 static int i810i2c_getscl(
void *data)
79 static int i810i2c_getsda(
void *data)
97 chan->
adapter.dev.parent = &chan->
par->dev->dev;
98 chan->
algo.setsda = i810i2c_setsda;
99 chan->
algo.setscl = i810i2c_setscl;
100 chan->
algo.getsda = i810i2c_getsda;
101 chan->
algo.getscl = i810i2c_getscl;
102 chan->
algo.udelay = 10;
103 chan->
algo.timeout = (
HZ/2);
106 i2c_set_adapdata(&chan->
adapter, chan);
109 chan->
algo.setsda(chan, 1);
110 chan->
algo.setscl(chan, 1);
116 dev_dbg(&chan->
par->dev->dev,
"I2C bus %s registered.\n",name);
118 dev_warn(&chan->
par->dev->dev,
"Failed to register I2C bus "
128 par->
chan[0].par = par;
129 par->
chan[1].par = par;
130 par->
chan[2].par = par;
133 i810_setup_i2c_bus(&par->
chan[0],
"I810-DDC");
135 i810_setup_i2c_bus(&par->
chan[1],
"I810-I2C");
137 i810_setup_i2c_bus(&par->
chan[2],
"I810-GPIOC");
142 if (par->
chan[0].par)
146 if (par->
chan[1].par)
150 if (par->
chan[2].par)
160 DPRINTK(
"i810-i2c: Probe DDC%i Bus\n", conn+1);
167 DPRINTK(
"i810-i2c: Getting EDID from BIOS\n");
174 return (edid) ? 0 : 1;