3 #include <linux/module.h>
4 #include <linux/kernel.h>
17 static void radeon_gpio_setscl(
void*
data,
int state)
27 OUTREG(chan->ddc_reg, val);
31 static void radeon_gpio_setsda(
void* data,
int state)
41 OUTREG(chan->ddc_reg, val);
45 static int radeon_gpio_getscl(
void* data)
51 val =
INREG(chan->ddc_reg);
56 static int radeon_gpio_getsda(
void* data)
62 val =
INREG(chan->ddc_reg);
75 chan->
adapter.dev.parent = &chan->rinfo->pdev->
dev;
76 chan->
algo.setsda = radeon_gpio_setsda;
77 chan->
algo.setscl = radeon_gpio_setscl;
78 chan->
algo.getsda = radeon_gpio_getsda;
79 chan->
algo.getscl = radeon_gpio_getscl;
80 chan->
algo.udelay = 10;
81 chan->
algo.timeout = 20;
82 chan->
algo.data = chan;
84 i2c_set_adapdata(&chan->
adapter, chan);
87 radeon_gpio_setsda(chan, 1);
88 radeon_gpio_setscl(chan, 1);
93 dev_dbg(&chan->rinfo->pdev->
dev,
"I2C bus %s registered.\n", name);
95 dev_warn(&chan->rinfo->pdev->
dev,
"Failed to register I2C bus %s.\n", name);
101 rinfo->i2c[0].rinfo = rinfo;
106 radeon_setup_i2c_bus(&rinfo->i2c[0],
"monid");
108 rinfo->i2c[1].rinfo = rinfo;
110 radeon_setup_i2c_bus(&rinfo->i2c[1],
"dvi");
112 rinfo->i2c[2].rinfo = rinfo;
114 radeon_setup_i2c_bus(&rinfo->i2c[2],
"vga");
116 rinfo->i2c[3].rinfo = rinfo;
118 radeon_setup_i2c_bus(&rinfo->i2c[3],
"crt2");
123 if (rinfo->i2c[0].rinfo)
125 rinfo->i2c[0].rinfo =
NULL;
127 if (rinfo->i2c[1].rinfo)
129 rinfo->i2c[1].rinfo =
NULL;
131 if (rinfo->i2c[2].rinfo)
133 rinfo->i2c[2].rinfo =
NULL;
135 if (rinfo->i2c[3].rinfo)
137 rinfo->i2c[3].rinfo =
NULL;
150 pr_debug(
"radeonfb: I2C (port %d) ... not found\n", conn);
153 if (edid[0x14] & 0x80) {
157 pr_debug(
"radeonfb: I2C (port %d) ... found LVDS panel\n", conn);
160 pr_debug(
"radeonfb: I2C (port %d) ... found TMDS panel\n", conn);
164 pr_debug(
"radeonfb: I2C (port %d) ... found CRT display\n", conn);