Re: Build custom module

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

 



On Mon, 2010-10-18 at 17:54 +0200, orschiro@xxxxxxxxxxxxxx wrote:
> It's this module here: http://github.com/tetromino/lenovo-sl-laptop
> 
> I own a Lenovo SL500 with which this module worked very well in the past.
> 
> Thank you for your help.

OK. Before I begin, I have no lenovo laptop to test this patch on and
this part of the kernel (backlight, ACPI) is not something I have
experience in (I looked at other drivers and used them as reference), so
it may literally OOPS your kernel, blowup your display, break into your
bank account and eat your firstborn. In short, make sure you have a
recent backup of your data. (This comment is longer than the actual
patch :))

Patch attached. Good luck.

- Gilboa

--- lenovo-sl-laptop.c.old	2010-10-21 18:01:14.221433370 +0200
+++ lenovo-sl-laptop.c	2010-10-21 18:17:18.690494769 +0200
@@ -652,6 +652,7 @@
 
 static int backlight_init(void)
 {
+	struct backlight_properties props;
 	int status = 0;
 
 	lcdd_handle = NULL;
@@ -670,9 +671,13 @@
 	if (status || !backlight_levels.count)
 		goto err;
 
+	/* At least according to other platform drivers, brightness can stay at 0. 
+	 * max_brightness code was originally calculated right after register. */
+	memset((void *)&props,0,sizeof(struct backlight_properties));
+	props.max_brightness = backlight_levels.count - 1;
 	backlight = backlight_device_register(LENSL_BACKLIGHT_NAME,
-			NULL, NULL, &lensl_backlight_ops);
-	backlight->props.max_brightness = backlight_levels.count - 1;
+											NULL, NULL, &lensl_backlight_ops,
+											&props);
 	backlight->props.brightness = lensl_bd_get_brightness(backlight);
 	vdbg_printk(LENSL_INFO, "Started backlight brightness control\n");
 	goto out;
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux