15 #include <linux/module.h>
16 #include <linux/kernel.h>
18 #include <linux/pci.h>
27 static void riva_gpio_setscl(
void*
data,
int state)
45 static void riva_gpio_setsda(
void* data,
int state)
63 static int riva_gpio_getscl(
void* data)
76 static int riva_gpio_getsda(
void* data)
91 unsigned int i2c_class)
97 chan->
adapter.class = i2c_class;
99 chan->
adapter.dev.parent = &chan->
par->pdev->dev;
100 chan->
algo.setsda = riva_gpio_setsda;
101 chan->
algo.setscl = riva_gpio_setscl;
102 chan->
algo.getsda = riva_gpio_getsda;
103 chan->
algo.getscl = riva_gpio_getscl;
104 chan->
algo.udelay = 40;
108 i2c_set_adapdata(&chan->
adapter, chan);
111 riva_gpio_setsda(chan, 1);
112 riva_gpio_setscl(chan, 1);
117 dev_dbg(&chan->
par->pdev->dev,
"I2C bus %s registered.\n", name);
120 "Failed to register I2C bus %s.\n", name);
129 par->
chan[0].par = par;
130 par->
chan[1].par = par;
131 par->
chan[2].par = par;
133 par->
chan[0].ddc_base = 0x36;
134 par->
chan[1].ddc_base = 0x3e;
135 par->
chan[2].ddc_base = 0x50;
137 riva_setup_i2c_bus(&par->
chan[1],
"BUS2", 0);
138 riva_setup_i2c_bus(&par->
chan[2],
"BUS3", 0);
145 for (i = 0; i < 3; i++) {
146 if (!par->
chan[i].par)
157 if (par->
chan[conn].par)