Nicolas Boichat wrote:

Please send me a patch of what you updated in the driver to make it
working on a Mac Mini. I don't care if it's dirty, I'll clean it up.

I think there is no accelerometer, no light sensors and obviously no
keyboard backlight on the MacMini, is it right ?

You are right: no light sensors and no keyboard backlight. Since I'm running Ubuntu Dapper and therefore kernel 2.6.15 I had to remove all code with respect to led devices. What I basically did then was to remove the whitelist checking. So I don't think my quick and dirty changes won't really help you. Anyway I attached the diff.

With the modification the driver loads and I can read the fan speed but the system gets sluggish, most likely because of these kernel messages:

   [17185346.296000] applesmc: wait status failed: 5 != 10

Hope this helps,

- Jan.


--- applesmc.c.orig	2006-10-15 11:06:03.000000000 +0200
+++ applesmc.c	2006-10-15 11:35:20.000000000 +0200
@@ -32,7 +32,7 @@
 #include <linux/timer.h>
 #include <linux/dmi.h>
 #include <asm/io.h>
-#include <linux/leds.h>
+// #include <linux/leds.h>
 
 /* data port used by apple SMC */
 #define APPLESMC_DATA_PORT	0x300
@@ -513,6 +513,7 @@
 	return count;
 }
 
+/*
 static void applesmc_backlight_set(struct led_classdev *led_cdev,
 				enum led_brightness value)
 {
@@ -555,7 +556,7 @@
 static struct attribute_group applesmc_attribute_group = {
 	.attrs = applesmc_attributes,
 };
-
+*/
 #define sysfs_fan_speeds_offset(offset) \
 static ssize_t show_fan_actual_speed_##offset (struct device *dev, \
 				struct device_attribute *attr, char *buf) \
@@ -680,13 +681,13 @@
 		APPLESMC_DMI_MATCH("MacBook"),
 		{ .ident = NULL }
 	};
-
+/*
 	if (!dmi_check_system(applesmc_whitelist)) {
 		printk(KERN_WARNING "applesmc: supported laptop not found!\n");
 		ret = -ENODEV;
 		goto out;
 	}
-
+*/
 	if (!request_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS,
 								"applesmc")) {
 		ret = -ENXIO;
@@ -703,12 +704,12 @@
 		goto out_driver;
 	}
 
-	if (applesmc_light)
-		ret = sysfs_create_group(&pdev->dev.kobj,
-					&applesmc_light_attribute_group);
-	else
-		ret = sysfs_create_group(&pdev->dev.kobj,
-					&applesmc_attribute_group);		
+//	if (applesmc_light)
+//		ret = sysfs_create_group(&pdev->dev.kobj,
+//					&applesmc_light_attribute_group);
+//	else
+//		ret = sysfs_create_group(&pdev->dev.kobj,
+//					&applesmc_attribute_group);		
 	if (ret)
 		goto out_device;
 
@@ -761,7 +762,7 @@
 	add_timer(&applesmc_timer);
 
 	/* register as a led device */
-	ret = led_classdev_register(&pdev->dev, &applesmc_backlight);
+//	ret = led_classdev_register(&pdev->dev, &applesmc_backlight);
 	if (ret < 0)
 		goto out_input_device;
 
@@ -772,7 +773,7 @@
 	del_timer_sync(&applesmc_timer);
 	input_unregister_device(applesmc_idev);
 out_group:
-	sysfs_remove_group(&pdev->dev.kobj, &applesmc_attribute_group);
+//	sysfs_remove_group(&pdev->dev.kobj, &applesmc_attribute_group);
 out_device:
 	platform_device_unregister(pdev);
 out_driver:
@@ -786,14 +787,14 @@
 
 static void __exit applesmc_exit(void)
 {
-	led_classdev_unregister(&applesmc_backlight);
+//	led_classdev_unregister(&applesmc_backlight);
 	del_timer_sync(&applesmc_timer);
 	input_unregister_device(applesmc_idev);
-	if (applesmc_light)
-		sysfs_remove_group(&pdev->dev.kobj,
-					&applesmc_light_attribute_group);
-	else
-		sysfs_remove_group(&pdev->dev.kobj, &applesmc_attribute_group);
+//	if (applesmc_light)
+//		sysfs_remove_group(&pdev->dev.kobj,
+//					&applesmc_light_attribute_group);
+//	else
+//		sysfs_remove_group(&pdev->dev.kobj, &applesmc_attribute_group);
 	platform_device_unregister(pdev);
 	platform_driver_unregister(&applesmc_driver);
 	release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mactel-linux-devel mailing list
Mactel-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel

Reply via email to