Bugzilla – Attachment 172830 Details for
Bug 308264
ibm thinkpad acpi broken? No backlight changes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
blacklist 61 models to use 15 brightness levels
acpi_ibm_brightness_T61_15_lvl.patch (text/plain), 2.46 KB, created by
Thomas Renninger
on 2007-09-17 17:12:29 UTC
(
hide
)
Description:
blacklist 61 models to use 15 brightness levels
Filename:
MIME Type:
Creator:
Thomas Renninger
Created:
2007-09-17 17:12:29 UTC
Size:
2.46 KB
patch
obsolete
>--- > drivers/misc/thinkpad_acpi.c | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > >Index: linux-2.6.22/drivers/misc/thinkpad_acpi.c >=================================================================== >--- linux-2.6.22.orig/drivers/misc/thinkpad_acpi.c >+++ linux-2.6.22/drivers/misc/thinkpad_acpi.c >@@ -2759,7 +2759,13 @@ static int __init brightness_init(struct > } > vdbg_printk(TPACPI_DBG_INIT, "brightness is supported\n"); > >- ibm_backlight_device->props.max_brightness = 7; >+ if (tp->model_str && strstr(tp->model_str, "61")) >+ printk (KERN_INFO "Found ThinkPad model: [TXZ]61, using 16 " >+ "brightness levels\n"); >+ ibm_backlight_device->props.max_brightness = 15; >+ else >+ ibm_backlight_device->props.max_brightness = 7; >+ > ibm_backlight_device->props.brightness = b; > backlight_update_status(ibm_backlight_device); > >@@ -2821,7 +2827,7 @@ static int brightness_set(int value) > int cmos_cmd, inc, i, res; > int current_value; > >- if (value > 7) >+ if (value > ibm_backlight_device->props.max_brightness) > return -EINVAL; > > res = mutex_lock_interruptible(&brightness_mutex); >@@ -2864,10 +2870,12 @@ static int brightness_read(char *p) > if ((level = brightness_get(NULL)) < 0) { > len += sprintf(p + len, "level:\t\tunreadable\n"); > } else { >- len += sprintf(p + len, "level:\t\t%d\n", level & 0x7); >+ len += sprintf(p + len, "level:\t\t%d\n", level >+ & ibm_backlight_device->props.max_brightness); > len += sprintf(p + len, "commands:\tup, down\n"); > len += sprintf(p + len, "commands:\tlevel <level>" >- " (<level> is 0-7)\n"); >+ " (<level> is 0-%d)\n", >+ ibm_backlight_device->props.max_brightness); > } > > return len; >@@ -2882,14 +2890,17 @@ static int brightness_write(char *buf) > while ((cmd = next_cmd(&buf))) { > if ((level = brightness_get(NULL)) < 0) > return level; >- level &= 7; >+ level &= ibm_backlight_device->props.max_brightness; > > if (strlencmp(cmd, "up") == 0) { >- new_level = level == 7 ? 7 : level + 1; >+ if (new_level < ibm_backlight_device->props.max_brightness) >+ new_level = level + 1; >+ else >+ new_level = ibm_backlight_device->props.max_brightness; > } else if (strlencmp(cmd, "down") == 0) { > new_level = level == 0 ? 0 : level - 1; > } else if (sscanf(cmd, "level %d", &new_level) == 1 && >- new_level >= 0 && new_level <= 7) { >+ new_level >= 0 && new_level <= ibm_backlight_device->props.max_brightness) { > /* new_level set */ > } else > return -EINVAL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 308264
: 172830 |
197471