[PATCH] i810fb: Do not probe the third i2c bus by default

Subsystems: framebuffer layer, the rest

STALE7530d

3 messages, 2 authors, 2006-01-29 · open the first message on its own page

[PATCH] i810fb: Do not probe the third i2c bus by default

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2006-01-29 02:14:08

From: Manuel Lauss <redacted>

Some time before 2.6.15, a third DDC channel was added to i810fb.
On systems where these ddc pins are not connected, the probe
takes about 10 seconds.

Add a boot/module  option for i810fb to explicitly probe for the 3rd
ddc bus if needed.

Signed-off-by: Antonino Daplas <redacted>
---

 drivers/video/i810/i810-i2c.c  |    6 +++---
 drivers/video/i810/i810.h      |    1 +
 drivers/video/i810/i810_main.c |   13 ++++++++++---
 3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c
index bd410e0..e3c8b5f 100644
--- a/drivers/video/i810/i810-i2c.c
+++ b/drivers/video/i810/i810-i2c.c
@@ -191,11 +191,11 @@ int i810_probe_i2c_connector(struct fb_i
         u8 *edid = NULL;
         int i;
 
-	DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn);
-	if (conn < 4) {
+	DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn+1);
+	if (conn < par->ddc_num) {
 		for (i = 0; i < 3; i++) {
 			/* Do the real work */
-			edid = i810_do_probe_i2c_edid(&par->chan[conn-1]);
+			edid = i810_do_probe_i2c_edid(&par->chan[conn]);
 			if (edid)
 				break;
 		}
diff --git a/drivers/video/i810/i810.h b/drivers/video/i810/i810.h
index 6c187d5..579195c 100644
--- a/drivers/video/i810/i810.h
+++ b/drivers/video/i810/i810.h
@@ -280,6 +280,7 @@ struct i810fb_par {
 	u32 blit_bpp;
 	u32 ovract;
 	u32 cur_state;
+	u32 ddc_num;
 	int mtrr_reg;
 	u16 bltcntl;
 	u8 interlace;
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 266d0ab..d8467c0 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -149,6 +149,7 @@ static int vyres      __devinitdata;
 static int sync       __devinitdata;
 static int extvga     __devinitdata;
 static int dcolor     __devinitdata;
+static int ddc3       __devinitdata = 2;
 
 /*------------------------------------------------------------*/
 
@@ -1763,6 +1764,8 @@ static void __devinit i810_init_defaults
 	if (sync) 
 		par->dev_flags |= ALWAYS_SYNC;
 
+	par->ddc_num = ddc3;
+
 	if (bpp < 8)
 		bpp = 8;
 	
@@ -1885,7 +1888,7 @@ static void __devinit i810fb_find_init_m
 	int found = 0;
 #ifdef CONFIG_FB_I810_I2C
 	int i;
-	int err;
+	int err = 1;
 	struct i810fb_par *par = info->par;
 #endif
 
@@ -1895,8 +1898,8 @@ static void __devinit i810fb_find_init_m
 #ifdef CONFIG_FB_I810_I2C
 	i810_create_i2c_busses(par);
 
-	for (i = 0; i < 4; i++) {
-		err = i810_probe_i2c_connector(info, &par->edid, i+1);
+	for (i = 0; i < par->ddc_num + 1; i++) {
+		err = i810_probe_i2c_connector(info, &par->edid, i);
 		if (!err)
 			break;
 	}
@@ -1983,6 +1986,8 @@ static int __devinit i810fb_setup(char *
 			vsync2 = simple_strtoul(this_opt+7, NULL, 0);
 		else if (!strncmp(this_opt, "dcolor", 6))
 			dcolor = 1;
+		else if (!strncmp(this_opt, "ddc3", 4))
+			ddc3 = 3;
 		else
 			mode_option = this_opt;
 	}
@@ -2190,6 +2195,8 @@ MODULE_PARM_DESC(sync, "wait for accel e
 module_param(dcolor, bool, 0);
 MODULE_PARM_DESC(dcolor, "use DirectColor visuals"
 		 " (default = 0 = TrueColor)");
+module_param(ddc3, bool, 0);
+MODULE_PARM_DESC(ddc3, "Probe DDC bus 3 (default = 0 = no)");
 module_param(mode_option, charp, 0);
 MODULE_PARM_DESC(mode_option, "Specify initial video mode");
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

Re: [PATCH] i810fb: Do not probe the third i2c bus by default

From: Andrew Morton <hidden>
Date: 2006-01-29 08:16:54

"Antonino A. Daplas" [off-list ref] wrote:

 Some time before 2.6.15, a third DDC channel was added to i810fb.
 On systems where these ddc pins are not connected, the probe
 takes about 10 seconds.

 Add a boot/module  option for i810fb to explicitly probe for the 3rd
 ddc bus if needed.
argh.  We really shouldn't be adding options like this.  People just won't
know that the option exists and they'll sit there wondering why their
kernel doesn't work right.  Or we invert the sense of the option and they
sit there wondering why the bootup is so slow.

Is there not any way in which to fix this so things just work?  A 10-second
timeout sounds crazy.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

Re: [PATCH] i810fb: Do not probe the third i2c bus by default

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2006-01-29 10:40:05

Andrew Morton wrote:
"Antonino A. Daplas" [off-list ref] wrote:
quoted
 Some time before 2.6.15, a third DDC channel was added to i810fb.
 On systems where these ddc pins are not connected, the probe
 takes about 10 seconds.

 Add a boot/module  option for i810fb to explicitly probe for the 3rd
 ddc bus if needed.
argh.  We really shouldn't be adding options like this.  People just won't
Me too.
know that the option exists and they'll sit there wondering why their
kernel doesn't work right.  Or we invert the sense of the option and they
sit there wondering why the bootup is so slow.
Well the 3rd i2c bus is undocumented, even by Intel. But it's supposed to
exist to allow attaching of daughter cards. I added support for this on the
prodding of Nicholas Boichat. As far as I know, nobody uses this 3rd bus.
Is there not any way in which to fix this so things just work?  A 10-second
timeout sounds crazy.
The only way to know if this bus exists is to probe it, unfortunately. And
because it's undocumented, I don't which chipset type has it.  So anyone who
has knowledge of this undocumented feature will probably have the energy
to search for the proper boot option, or know where to mail me :-)

Tony
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help