[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New powerbooks support status (again)



On 06 Mar 2005 at 18h03, Antonio-M. Corbi Bellot wrote:

Hi Antonio, 

> After talking in private with Colin Leroy (from therm_adt) and trying
> several ways to see what was happening he suggested me to write to the
> list and see if any of the powerpc developers here can see what is
> happening here.

Can you test the attached patch ?

Thanks,
-- 
Colin
  It's psychosomatic. You need a lobotomy. I'll get a saw.
		-- Calvin
--- drivers/macintosh/therm_adt746x.c.test	2005-03-07 09:03:58.000000000 +0100
+++ drivers/macintosh/therm_adt746x.c	2005-03-07 09:04:35.000000000 +0100
@@ -548,7 +548,15 @@
 	prop = (u32 *)get_property(np, "reg", NULL);
 	if (!prop)
 		return -ENODEV;
-	therm_bus = ((*prop) >> 8) & 0x0f;
+	
+	/* look for bus either by path or using "reg" */
+	if (strstr(np->full_name, "/i2c-bus@") != NULL) {
+		const char *tmp_bus = (strstr(np->full_name, "/i2c-bus@") + 9);
+		therm_bus = tmp_bus[0]-'0';
+	} else {
+		therm_bus = ((*prop) >> 8) & 0x0f;
+	}
+	
 	therm_address = ((*prop) & 0xff) >> 1;
 
 	printk(KERN_INFO "adt746x: Thermostat bus: %d, address: 0x%02x, "

Reply to: